Merge pull request #5142 from bosu/static-proot

proot: allow static compilation
This commit is contained in:
Michael Raskin 2015-04-04 13:26:21 +03:00
commit ba82a5d609
2 changed files with 8 additions and 2 deletions

View file

@ -24,6 +24,10 @@ stdenv.mkDerivation rec {
"--builtin-libraries=replace"
];
postInstall = ''
ar qf $out/lib/libtalloc.a bin/default/talloc_5.o
'';
meta = with stdenv.lib; {
description = "Hierarchical pool based memory allocator with destructors";
homepage = http://tdb.samba.org/;

View file

@ -1,4 +1,4 @@
{ stdenv, fetchgit, talloc }:
{ stdenv, fetchgit, talloc, enableStatic ? false }:
stdenv.mkDerivation rec {
name = "proot-${version}";
@ -12,7 +12,9 @@ stdenv.mkDerivation rec {
buildInputs = [ talloc ];
preBuild = ''
preBuild = stdenv.lib.optionalString enableStatic ''
export LDFLAGS="-static -L${talloc}/lib"
'' + ''
substituteInPlace GNUmakefile --replace "/usr/local" "$out"
'';