From 088231fe9ff77b1a03f8e87fe4f402e9f4a38be7 Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Wed, 30 Mar 2016 17:51:00 +0200 Subject: [PATCH] libiberty: add static variant --- pkgs/development/libraries/libiberty/default.nix | 13 +++++++++---- pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) 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 { };