diff --git a/pkgs/development/libraries/libiberty/default.nix b/pkgs/development/libraries/libiberty/default.nix index 6a68b5610da2..c3dc3a4e8526 100644 --- a/pkgs/development/libraries/libiberty/default.nix +++ b/pkgs/development/libraries/libiberty/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchurl, staticBuild ? false }: stdenv.mkDerivation rec { version = "4.9.3"; @@ -11,11 +11,16 @@ stdenv.mkDerivation rec { postUnpack = "sourceRoot=\${sourceRoot}/libiberty"; - enable_shared = 1; + enable_shared = !staticBuild; installPhase = '' - mkdir -p $out/lib - cp pic/libiberty.a $out/lib/libiberty_pic.a + mkdir -p $out/lib $out/include + cp ../include/libiberty.h $out/include/ + if [ -z "$enabled_shared" ]; then + cp libiberty.a $out/lib/libiberty.a + else + cp pic/libiberty.a $out/lib/libiberty_pic.a + fi ''; meta = with stdenv.lib; { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d40165b05d23..caab56d4b76e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2206,6 +2206,8 @@ in libiberty = callPackage ../development/libraries/libiberty { }; + libiberty_static = callPackage ../development/libraries/libiberty { staticBuild = true; }; + libibverbs = callPackage ../development/libraries/libibverbs { }; libxcomp = callPackage ../development/libraries/libxcomp { };