Skip to content

Instantly share code, notes, and snippets.

@eugeneia
Created August 14, 2018 08:37
Show Gist options
  • Save eugeneia/05f4d186bd66b27b811c67af5e3e24c4 to your computer and use it in GitHub Desktop.
Save eugeneia/05f4d186bd66b27b811c67af5e3e24c4 to your computer and use it in GitHub Desktop.
# Run like this:
# nix-build /path/to/this/directory
# ... and the files are produced in ./result/bin/snabb
{ pkgs ? (import <nixpkgs> {}), source ? ./., version ? "dev" }:
with pkgs;
stdenv.mkDerivation rec {
name = "athens-${version}";
src = lib.cleanSource source;
buildInputs = [ makeWrapper ccl openssl libxml2 ];
inherit version openssl libxml2;
preBuild = ''
make clean
export LD_LIBRARY_PATH=${lib.makeLibraryPath [ openssl libxml2 ]}
export XDG_CACHE_HOME="$TMP/.cache"
'';
installPhase = ''
mkdir -p $out/bin
cp bin/athens $out/bin/athens.orig
makeWrapper $out/bin/athens.orig $out/bin/athens \
--suffix LD_LIBRARY_PATH : $LD_LIBRARY_PATH
'';
dontStrip = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment