Created
August 13, 2018 13:36
-
-
Save eugeneia/b5e1ca3a31594dd84d077ae670f7b257 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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; | |
LD_LIBRARY_PATH = lib.makeLibraryPath [ openssl libxml2 ]; | |
# DRY :-( | |
preBuild = '' | |
make clean | |
''; | |
buildPhase = '' | |
XDG_CACHE_HOME="$TMP/.cache" make bin/athens | |
''; | |
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