Skip to content

Instantly share code, notes, and snippets.

@LinArcX
Created April 16, 2019 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LinArcX/b324be306bd4fc7e5a5595886313ce64 to your computer and use it in GitHub Desktop.
Save LinArcX/b324be306bd4fc7e5a5595886313ce64 to your computer and use it in GitHub Desktop.
{ stdenv, fetchurl, dpkg, makeWrapper }:
stdenv.mkDerivation rec {
pname = "etcher-bin";
version = "1.5.26";
src = fetchurl {
url = "https://github.com/balena-io/etcher/releases/download/v${version}/balena-etcher-electron_${version}_amd64.deb";
sha256 = "01zsgi420vbllfzwz86j8daqgbywf5vvaf3rlk0cka8plgy505ji";
};
nativeBuildInputs = [ dpkg makeWrapper ];
phases = [ "installPhase" ];
# unpackPhase = ''
# dpkg-deb -x $src $out
# '';
#
# dontBuild = true;
installPhase = ''
dpkg-deb -x $src $out
echo "Hello"
program=$out/opt/balenaEtcher/balena-etcher-electron
echo $program
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $program
'';
# mkdir -p "$out/bin"
# cp -a usr/* "$out/"
#dpkg-deb -x ${src} ./
#interpreter=${stdenv.glibc}/lib/ld-linux-x86-64.so.2
#wrapProgram $pgm --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ openssl stdenv.cc.cc ]}
#patchelf --set-interpreter "$interpreter" $program
meta = with stdenv.lib; {
description = "Flash OS images to SD cards & USB drives, safely and easily";
homepage = https://etcher.io;
license = licenses.asl20;
platforms = platforms.linux;
maintainers = [ maintainers.linarcx ];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment