parallel: fix cross-compilation

This commit is contained in:
Yureka 2023-09-15 20:00:43 +02:00
parent 1f832ad576
commit f92f6b6a84

View file

@ -1,4 +1,4 @@
{ fetchurl, lib, stdenv, perl, makeWrapper, procps, coreutils }: { fetchurl, lib, stdenv, perl, makeWrapper, procps, coreutils, buildPackages }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "parallel"; pname = "parallel";
@ -14,6 +14,11 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
buildInputs = [ perl procps ]; 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 = '' preInstall = ''
patchShebangs ./src/parallel patchShebangs ./src/parallel
''; '';
@ -48,5 +53,6 @@ stdenv.mkDerivation rec {
license = licenses.gpl3Plus; license = licenses.gpl3Plus;
platforms = platforms.all; platforms = platforms.all;
maintainers = with maintainers; [ pSub vrthra tomberek ]; maintainers = with maintainers; [ pSub vrthra tomberek ];
mainProgram = "parallel";
}; };
} }