about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libiberty/default.nix
blob: 2040ef3bee082968e70d5911216ebe6ad997ea53 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ lib, 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" ]
    ++ lib.optional (!staticBuild) "--enable-shared";

  postInstall = lib.optionalString (!staticBuild) ''
    cp pic/libiberty.a $out/lib*/libiberty.a
  '';

  meta = with 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;
  };
}