Commit 404d45e9 authored by Philip Taron's avatar Philip Taron
Browse files

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.
parent c8bcc29f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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";