Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at flake-libs 80 lines 1.9 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchpatch, 5 gnu-config, 6 autoreconfHook, 7 bison, 8 binutils-unwrapped_2_38, 9 libiberty, 10 libintl, 11 zlib, 12}: 13 14stdenv.mkDerivation { 15 pname = "libbfd"; 16 inherit (binutils-unwrapped_2_38) version src; 17 18 outputs = [ 19 "out" 20 "dev" 21 ]; 22 23 patches = binutils-unwrapped_2_38.patches ++ [ 24 ./build-components-separately.patch 25 (fetchpatch { 26 url = "https://raw.githubusercontent.com/mxe/mxe/e1d4c144ee1994f70f86cf7fd8168fe69bd629c6/src/bfd-1-disable-subdir-doc.patch"; 27 sha256 = "0pzb3i74d1r7lhjan376h59a7kirw15j7swwm8pz3zy9lkdqkj6q"; 28 }) 29 ]; 30 31 # We just want to build libbfd 32 postPatch = '' 33 cd bfd 34 ''; 35 36 postAutoreconf = '' 37 echo "Updating config.guess and config.sub from ${gnu-config}" 38 cp -f ${gnu-config}/config.{guess,sub} ../ 39 ''; 40 41 # We update these ourselves 42 dontUpdateAutotoolsGnuConfigScripts = true; 43 44 strictDeps = true; 45 nativeBuildInputs = [ 46 autoreconfHook 47 bison 48 ]; 49 buildInputs = [ 50 libiberty 51 zlib 52 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libintl ]; 53 54 configurePlatforms = [ 55 "build" 56 "host" 57 ]; 58 configureFlags = [ 59 "--enable-targets=all" 60 "--enable-64-bit-bfd" 61 "--enable-install-libbfd" 62 "--with-system-zlib" 63 ] ++ lib.optional (!stdenv.hostPlatform.isStatic) "--enable-shared"; 64 65 enableParallelBuilding = true; 66 67 meta = with lib; { 68 description = "Library for manipulating containers of machine code"; 69 longDescription = '' 70 BFD is a library which provides a single interface to read and write 71 object files, executables, archive files, and core files in any format. 72 It is associated with GNU Binutils, and elsewhere often distributed with 73 it. 74 ''; 75 homepage = "https://www.gnu.org/software/binutils/"; 76 license = licenses.gpl3Plus; 77 maintainers = with maintainers; [ ericson2314 ]; 78 platforms = platforms.unix; 79 }; 80}