libiberty: add static variant

This commit is contained in:
Luca Bruno 2016-03-30 17:51:00 +02:00
parent e2e56a902f
commit 088231fe9f
2 changed files with 11 additions and 4 deletions

View file

@ -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; {

View file

@ -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 { };