libiberty: derive from gcc
This commit is contained in:
parent
a589b7bd5f
commit
d0630da09e
@ -1,26 +1,16 @@
|
|||||||
{ stdenv, fetchurl, staticBuild ? false }:
|
{ stdenv, lib, fetchurl, gcc, staticBuild ? false }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "4.9.3";
|
name = "libiberty-${gcc.cc.version}";
|
||||||
name = "libiberty-${version}";
|
|
||||||
|
|
||||||
src = fetchurl {
|
inherit (gcc.cc) src;
|
||||||
url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2";
|
|
||||||
sha256 = "0zmnm00d2a1hsd41g34bhvxzvxisa2l584q3p447bd91lfjv4ci3";
|
|
||||||
};
|
|
||||||
|
|
||||||
postUnpack = "sourceRoot=\${sourceRoot}/libiberty";
|
postUnpack = "sourceRoot=\${sourceRoot}/libiberty";
|
||||||
|
|
||||||
enable_shared = !staticBuild;
|
configureFlags = [ "--enable-install-libiberty" ] ++ lib.optional (!staticBuild) "--enable-shared";
|
||||||
|
|
||||||
installPhase = ''
|
postInstall = lib.optionalString (!staticBuild) ''
|
||||||
mkdir -p $out/lib $out/include
|
cp pic/libiberty.a $out/lib*/libiberty.a
|
||||||
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; {
|
meta = with stdenv.lib; {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user