summary refs log tree commit diff
path: root/pkgs/development/tools/misc/elfutils
diff options
context:
space:
mode:
authorRyan Burns <rtburns@protonmail.com>2021-08-26 18:41:24 -0700
committerRyan Burns <rtburns@protonmail.com>2021-09-23 12:35:20 -0700
commit4794a8aeeeeb393520573e3d8efd63670d427e03 (patch)
tree1213b015254c65b80cd6f1dd56f74f66cba29b94 /pkgs/development/tools/misc/elfutils
parent06f968ff54343e588f07c18db41c59e80677e49f (diff)
downloadnixpkgs-4794a8aeeeeb393520573e3d8efd63670d427e03.tar
nixpkgs-4794a8aeeeeb393520573e3d8efd63670d427e03.tar.gz
nixpkgs-4794a8aeeeeb393520573e3d8efd63670d427e03.tar.bz2
nixpkgs-4794a8aeeeeb393520573e3d8efd63670d427e03.tar.lz
nixpkgs-4794a8aeeeeb393520573e3d8efd63670d427e03.tar.xz
nixpkgs-4794a8aeeeeb393520573e3d8efd63670d427e03.tar.zst
nixpkgs-4794a8aeeeeb393520573e3d8efd63670d427e03.zip
elfutils: 0.182 -> 0.185, cleanup
Remove obsolete musl patches & musl-specific autoreconfHook
(same as https://git.alpinelinux.org/aports/commit/main/elfutils?id=a8779348058ef0f42d31c814d2792ccdc8062007)

Also add zstd support, enable tests, and allow "format" hardening.

Co-authored-by: Sergei Trofimovich <slyich@gmail.com>
Diffstat (limited to 'pkgs/development/tools/misc/elfutils')
-rw-r--r--pkgs/development/tools/misc/elfutils/default.nix56
1 files changed, 22 insertions, 34 deletions
diff --git a/pkgs/development/tools/misc/elfutils/default.nix b/pkgs/development/tools/misc/elfutils/default.nix
index c1227775785..c89dd583299 100644
--- a/pkgs/development/tools/misc/elfutils/default.nix
+++ b/pkgs/development/tools/misc/elfutils/default.nix
@@ -1,5 +1,5 @@
-{ lib, stdenv, fetchurl, fetchpatch, pkg-config, autoreconfHook, musl-fts
-, musl-obstack, m4, zlib, bzip2, bison, flex, gettext, xz, setupDebugInfoDirs
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, musl-fts
+, musl-obstack, m4, zlib, zstd, bzip2, bison, flex, gettext, xz, setupDebugInfoDirs
 , argp-standalone
 , enableDebuginfod ? false, sqlite, curl, libmicrohttpd_0_9_70, libarchive
 }:
@@ -7,11 +7,11 @@
 # TODO: Look at the hardcoded paths to kernel, modules etc.
 stdenv.mkDerivation rec {
   pname = "elfutils";
-  version = "0.182";
+  version = "0.185";
 
   src = fetchurl {
     url = "https://sourceware.org/elfutils/ftp/${version}/${pname}-${version}.tar.bz2";
-    sha256 = "7MQGkU7fM18Lf8CE6+bEYMTW1Rdb/dZojBx42RRriFg=";
+    sha256 = "sha256-3I0+dKsglGXn9Wjhs7uaWhQvhlbitX0QBJpz2irmtaY=";
   };
 
   patches = [
@@ -28,42 +28,28 @@ stdenv.mkDerivation rec {
       sha256 = "8D1wPcdgAkE/TNBOgsHaeTZYhd9l+9TrZg8d5C7kG6k=";
     })
     (fetchpatch {
-      name = "musl-fts-obstack.patch";
-      url = "https://git.alpinelinux.org/aports/plain/main/elfutils/musl-fts-obstack.patch?id=2e3d4976eeffb4704cf83e2cc3306293b7c7b2e9";
-      sha256 = "3lbC0UtscTIJgT7kOXnnjWrpPAVt2PYMbW+uJK6K350=";
-    })
-    (fetchpatch {
       name = "musl-macros.patch";
       url = "https://git.alpinelinux.org/aports/plain/main/elfutils/musl-macros.patch?id=2e3d4976eeffb4704cf83e2cc3306293b7c7b2e9";
       sha256 = "tp6O1TRsTAMsFe8vw3LMENT/vAu6OmyA8+pzgThHeA8=";
     })
     (fetchpatch {
-      name = "musl-qsort_r.patch";
-      url = "https://git.alpinelinux.org/aports/plain/main/elfutils/musl-qsort_r.patch?id=2e3d4976eeffb4704cf83e2cc3306293b7c7b2e9";
-      sha256 = "FPWCkdtFT3zw8aNnz0Jz5Vmu8B/mRfNgfhbM/ej7d8M=";
-    })
-    (fetchpatch {
-      name = "musl-strerror_r.patch";
-      url = "https://git.alpinelinux.org/aports/plain/main/elfutils/musl-strerror_r.patch?id=2e3d4976eeffb4704cf83e2cc3306293b7c7b2e9";
-      sha256 = "QF6YwWkcT12dZHKzfqFgxy/1fkIllo0AAosbV0sM5PU=";
-    })
-    (fetchpatch {
       name = "musl-strndupa.patch";
       url = "https://git.alpinelinux.org/aports/plain/main/elfutils/musl-strndupa.patch?id=2e3d4976eeffb4704cf83e2cc3306293b7c7b2e9";
       sha256 = "sha256-7daehJj1t0wPtQzTv+/Rpuqqs5Ng/EYnZzrcf2o/Lb0=";
     })
-  ] ++ lib.optional stdenv.hostPlatform.isMusl [ ./musl-error_h.patch ];
+  ] ++ lib.optionals stdenv.hostPlatform.isMusl [ ./musl-error_h.patch ];
 
-  outputs = [ "bin" "dev" "out" "man" ];
+  postPatch = ''
+    patchShebangs tests/*.sh
+  '';
 
-  hardeningDisable = [ "format" ];
+  outputs = [ "bin" "dev" "out" "man" ];
 
   # We need bzip2 in NativeInputs because otherwise we can't unpack the src,
   # as the host-bzip2 will be in the path.
   nativeBuildInputs = [ m4 bison flex gettext bzip2 ]
-    ++ lib.optional stdenv.hostPlatform.isMusl autoreconfHook
-    ++ lib.optional (enableDebuginfod || stdenv.hostPlatform.isMusl) pkg-config;
-  buildInputs = [ zlib bzip2 xz ]
+    ++ lib.optional enableDebuginfod pkg-config;
+  buildInputs = [ zlib zstd bzip2 xz ]
     ++ lib.optionals stdenv.hostPlatform.isMusl [
     argp-standalone
     musl-fts
@@ -77,22 +63,24 @@ stdenv.mkDerivation rec {
 
   propagatedNativeBuildInputs = [ setupDebugInfoDirs ];
 
-  preConfigure = lib.optionalString stdenv.hostPlatform.isMusl ''
-    NIX_CFLAGS_COMPILE+=" -Wno-null-dereference"
-  '';
+  NIX_CFLAGS_COMPILE = lib.optionals stdenv.hostPlatform.isMusl [
+    "-Wno-null-dereference"
+  ];
 
   configureFlags = [
     "--program-prefix=eu-" # prevent collisions with binutils
     "--enable-deterministic-archives"
-  ] ++ lib.optionals (!enableDebuginfod) [
-    "--disable-libdebuginfod"
-    "--disable-debuginfod"
+    (lib.enableFeature enableDebuginfod "libdebuginfod")
+    (lib.enableFeature enableDebuginfod "debuginfod")
   ];
 
   enableParallelBuilding = true;
 
-  doCheck = false; # fails 3 out of 174 tests
-  doInstallCheck = false; # fails 70 out of 174 tests
+  # Backtrace unwinding tests rely on glibc-internal symbol names.
+  # Musl provides slightly different forms and fails.
+  # Let's disable tests there until musl support is fully upstreamed.
+  doCheck = !stdenv.hostPlatform.isMusl;
+  doInstallCheck = !stdenv.hostPlatform.isMusl;
 
   meta = with lib; {
     homepage = "https://sourceware.org/elfutils/";
@@ -101,6 +89,6 @@ stdenv.mkDerivation rec {
     # licenses are GPL2 or LGPL3+ for libraries, GPL3+ for bins,
     # but since this package isn't split that way, all three are listed.
     license = with licenses; [ gpl2Only lgpl3Plus gpl3Plus ];
-    maintainers = [ maintainers.eelco ];
+    maintainers = with maintainers; [ eelco r-burns ];
   };
 }