diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2020-06-08 17:16:42 -0500 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2020-06-08 17:47:51 -0500 |
commit | a9924d7ab87235df86f6849ed53e9022f5b8e30e (patch) | |
tree | 9b5ef29b455c12d44d262cae4994e12f168d031d /pkgs/development/libraries/libexecinfo | |
parent | c86af902f443a7f0813467e734b0dcec92e9c2f9 (diff) |
libexecinfo: fix building statically
Diffstat (limited to 'pkgs/development/libraries/libexecinfo')
-rw-r--r-- | pkgs/development/libraries/libexecinfo/default.nix | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgs/development/libraries/libexecinfo/default.nix b/pkgs/development/libraries/libexecinfo/default.nix index 147b213735db..9c649c223c12 100644 --- a/pkgs/development/libraries/libexecinfo/default.nix +++ b/pkgs/development/libraries/libexecinfo/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, fetchpatch }: +{ stdenv, fetchurl, fetchpatch, enableStatic ? true, enableShared ? true }: stdenv.mkDerivation rec { pname = "libexecinfo"; @@ -29,12 +29,19 @@ stdenv.mkDerivation rec { makeFlags = [ "CC:=$(CC)" "AR:=$(AR)" ]; + buildFlags = + stdenv.lib.optional enableStatic "static" + ++ stdenv.lib.optional enableShared "dynamic"; + patchFlags = [ "-p0" ]; installPhase = '' install -Dm644 execinfo.h stacktraverse.h -t $out/include - install -Dm755 libexecinfo.{a,so.1} -t $out/lib + '' + stdenv.lib.optionalString enableShared '' + install -Dm755 libexecinfo.so.1 -t $out/lib ln -s $out/lib/libexecinfo.so{.1,} + '' + stdenv.lib.optionalString enableStatic '' + install -Dm755 libexecinfo.a -t $out/lib ''; meta = with stdenv.lib; { |