nixpkgs/pkgs/development/libraries/libiberty/default.nix
John Ericson f52263ced0 treewide: Start to break up static overlay
We can use use `stdenv.hostPlatform.isStatic` instead, and move the
logic per package. The least opionated benefit of this is that it makes
it much easier to replace packages with modified ones, as there is no
longer any issue of overlay order.

CC @FRidh @matthewbauer
2021-01-03 19:18:16 +00:00

32 lines
813 B
Nix

{ stdenv, buildPackages
, staticBuild ? stdenv.hostPlatform.isStatic
}:
let inherit (buildPackages.buildPackages) gcc; in
stdenv.mkDerivation {
pname = "libiberty";
version = "${gcc.cc.version}";
inherit (gcc.cc) src;
outputs = [ "out" "dev" ];
postUnpack = "sourceRoot=\${sourceRoot}/libiberty";
configureFlags = [ "--enable-install-libiberty" ]
++ stdenv.lib.optional (!staticBuild) "--enable-shared";
postInstall = stdenv.lib.optionalString (!staticBuild) ''
cp pic/libiberty.a $out/lib*/libiberty.a
'';
meta = with stdenv.lib; {
homepage = "https://gcc.gnu.org/";
license = licenses.lgpl2;
description = "Collection of subroutines used by various GNU programs";
maintainers = with maintainers; [ abbradar ericson2314 ];
platforms = platforms.unix;
};
}