Skip to content

Commit

Permalink
libexecinfo: fix building statically
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewbauer committed Jun 8, 2020
1 parent c86af90 commit a9924d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkgs/development/libraries/libexecinfo/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchpatch }:
{ stdenv, fetchurl, fetchpatch, enableStatic ? true, enableShared ? true }:

stdenv.mkDerivation rec {
pname = "libexecinfo";
Expand Down Expand Up @@ -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; {
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,6 @@ in {


libev = super.libev.override { static = true; };

libexecinfo = super.libexecinfo.override { enableShared = false; };
}

0 comments on commit a9924d7

Please sign in to comment.