Skip to content

Instantly share code, notes, and snippets.

@matejc
Created November 27, 2015 23:50
Show Gist options
  • Save matejc/99deb0260038bac2869b to your computer and use it in GitHub Desktop.
Save matejc/99deb0260038bac2869b to your computer and use it in GitHub Desktop.
{ stdenv, fetchurl }:
stdenv.mkDerivation rec {
name = "your-program-${version}";
version = "1.2.3";
src = fetchurl {
url = "https://your-program.com/download/v${version}.tar.gz";
sha256 = "05s3kvsz6pzh4.......lqwg0qn0ljz58sdqh";
};
phases = [ "installPhase" "fixupPhase" ];
installPhase = ''
mkdir -p $out/bin
cp -r ./bin/* $out/bin
# and if needed:
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${stdenv.cc.cc}/lib64:${stdenv.cc.cc}/lib" \
$out/bin/your-program
'';
meta = with stdenv.lib; {
description = "A super your-program that does something";
homepage = https://your-program.com/;
license = licenses.mit;
maintainers = [ maintainers.you ];
platforms = platforms.linux;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment