From 404d45e9a9c51f782a4c194e9f89321745eb2d16 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Tue, 17 Mar 2026 12:36:01 -0700 Subject: [PATCH] libtar: fix cross-compilation by removing hardcoded strip from install libtar/Makefile.in hardcodes `INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s`, which runs bare `strip` during `make install`. This fails in cross builds where only the target-prefixed strip is available in PATH. Nix's fixup phase already handles stripping with the correct tool, so the flag is redundant even for native builds. --- pkgs/by-name/li/libtar/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/li/libtar/package.nix b/pkgs/by-name/li/libtar/package.nix index 9045a2c5d3cd..3611ddf6ae6e 100644 --- a/pkgs/by-name/li/libtar/package.nix +++ b/pkgs/by-name/li/libtar/package.nix @@ -49,6 +49,16 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ autoreconfHook ]; + # libtar/Makefile.in hardcodes `INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s`, + # which runs bare `strip` during `make install`. This fails in cross builds + # where only the prefixed strip (e.g. aarch64-unknown-linux-gnu-strip) is + # available. Nix's fixup phase handles stripping with the correct tool, so + # just remove the flag. + postPatch = '' + substituteInPlace libtar/Makefile.in \ + --replace-fail '@INSTALL_PROGRAM@ -s' '@INSTALL_PROGRAM@' + ''; + meta = { description = "C library for manipulating POSIX tar files"; mainProgram = "libtar";