From f92f6b6a84205f817ae3df709295eb2a216bb108 Mon Sep 17 00:00:00 2001 From: Yureka Date: Fri, 15 Sep 2023 20:00:43 +0200 Subject: [PATCH] parallel: fix cross-compilation --- pkgs/tools/misc/parallel/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/misc/parallel/default.nix b/pkgs/tools/misc/parallel/default.nix index c36393dab29d..704f30d9dbe2 100644 --- a/pkgs/tools/misc/parallel/default.nix +++ b/pkgs/tools/misc/parallel/default.nix @@ -1,4 +1,4 @@ -{ fetchurl, lib, stdenv, perl, makeWrapper, procps, coreutils }: +{ fetchurl, lib, stdenv, perl, makeWrapper, procps, coreutils, buildPackages }: stdenv.mkDerivation rec { pname = "parallel"; @@ -14,6 +14,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; buildInputs = [ perl procps ]; + postPatch = lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + substituteInPlace Makefile.in \ + --replace '$(DESTDIR)$(bindir)/parallel --shell-completion' '${lib.getExe buildPackages.parallel} --shell-completion' + ''; + preInstall = '' patchShebangs ./src/parallel ''; @@ -48,5 +53,6 @@ stdenv.mkDerivation rec { license = licenses.gpl3Plus; platforms = platforms.all; maintainers = with maintainers; [ pSub vrthra tomberek ]; + mainProgram = "parallel"; }; }