summary refs log tree commit diff
path: root/pkgs/development/libraries/libbfd
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2017-10-10 18:48:42 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2017-11-13 00:47:37 -0500
commitde28bd48321a3e9ed5da005e69e01862e5551873 (patch)
treee95ebd67010b9d96b9a88d38cc15679ae61acedc /pkgs/development/libraries/libbfd
parentc0a04ec2f537d21ab18d72d67cc65fe651598e14 (diff)
downloadnixpkgs-de28bd48321a3e9ed5da005e69e01862e5551873.tar
nixpkgs-de28bd48321a3e9ed5da005e69e01862e5551873.tar.gz
nixpkgs-de28bd48321a3e9ed5da005e69e01862e5551873.tar.bz2
nixpkgs-de28bd48321a3e9ed5da005e69e01862e5551873.tar.lz
nixpkgs-de28bd48321a3e9ed5da005e69e01862e5551873.tar.xz
nixpkgs-de28bd48321a3e9ed5da005e69e01862e5551873.tar.zst
nixpkgs-de28bd48321a3e9ed5da005e69e01862e5551873.zip
bfd, opcodes: Init separate derivations for binutils libraries
On most distros, these are just built and distributed as part of
binutils. We don't use binutils across the board, however, but rather
switch between binutils and a cctools-binutils mashup, and change the
outputs on binutils too. This creates a combinatorial conditional soup
which is hard to maintain.

My hope is to lower the the state space. While my patch isn't the most
maintainable, they make downstream packages become more maintainable to
compensate. The additional derivations themselves are completely
platform-agnostic, always they always supports all possible target
platforms, and always yield "out" and "dev" outputs. That, in turn,
allows downstream packages to not worry about a dependency
shape-shifting under them.

In fact, the actual binutils package can avoid needing multiple outputs
now that these serve the requisite libraries, so that also can become
simpler on all platforms, too, removing the original wart this PR
circumnavigates for now. Actually changing the binutils package to
leverage is a mass rebuild, however, so I'll leave that for a separate
PR.

I do hope to upstream something like my patch too, but until then I'll
make myself maintainer of these derivations
Diffstat (limited to 'pkgs/development/libraries/libbfd')
-rw-r--r--pkgs/development/libraries/libbfd/default.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/development/libraries/libbfd/default.nix b/pkgs/development/libraries/libbfd/default.nix
new file mode 100644
index 00000000000..7709f550675
--- /dev/null
+++ b/pkgs/development/libraries/libbfd/default.nix
@@ -0,0 +1,47 @@
+{ stdenv
+, fetchurl, autoreconfHook264, bison, binutils
+, libiberty, zlib
+}:
+
+stdenv.mkDerivation rec {
+  name = "libbfd-${version}";
+  inherit (binutils) version src;
+
+  outputs = [ "out" "dev" ];
+
+  patches = binutils.patches ++ [
+    ../../tools/misc/binutils/build-components-separately.patch
+  ];
+
+  # We just want to build libbfd
+  postPatch = ''
+    cd bfd
+  '';
+
+  nativeBuildInputs = [ autoreconfHook264 bison ];
+  buildInputs = [ libiberty zlib ];
+
+  configurePlatforms = [ "build" "host" ];
+  configureFlags = [
+    "--enable-targets=all" "--enable-64-bit-bfd"
+    "--enable-install-libbfd"
+    "--enable-shared"
+    "--with-system-zlib"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A library for manipulating containers of machine code";
+    longDescription = ''
+      BFD is a library which provides a single interface to read and write
+      object files, executables, archive files, and core files in any format.
+      It is associated with GNU Binutils, and elsewhere often distributed with
+      it.
+    '';
+    homepage = http://www.gnu.org/software/binutils/;
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ ericson2314 ];
+    platforms = platforms.unix;
+  };
+}