2023-11-16 04:20:00 +00:00
|
|
|
{ fetchurl, lib, stdenv, perl, makeWrapper, procps, coreutils, gawk, buildPackages }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-02-19 19:06:45 +00:00
|
|
|
pname = "parallel";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "20240322";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-02-19 19:06:45 +00:00
|
|
|
url = "mirror://gnu/parallel/${pname}-${version}.tar.bz2";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-CxcCmiA9q/e6bKflLC05EP/0ayl5R24SqREJILeeapU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-17 17:02:09 +00:00
|
|
|
outputs = [ "out" "man" "doc" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ perl procps ];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postPatch = lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
|
|
substituteInPlace Makefile.in \
|
|
|
|
--replace '$(DESTDIR)$(bindir)/parallel --shell-completion' '${lib.getExe buildPackages.parallel} --shell-completion'
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
preInstall = ''
|
|
|
|
patchShebangs ./src/parallel
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/parallel \
|
2023-11-16 04:20:00 +00:00
|
|
|
--prefix PATH : "${lib.makeBinPath [ procps perl coreutils gawk ]}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Shell tool for executing jobs in parallel";
|
|
|
|
longDescription =
|
|
|
|
'' GNU Parallel is a shell tool for executing jobs in parallel. A job
|
|
|
|
is typically a single command or a small script that has to be run
|
|
|
|
for each of the lines in the input. The typical input is a list of
|
|
|
|
files, a list of hosts, a list of users, or a list of tables.
|
|
|
|
|
|
|
|
If you use xargs today you will find GNU Parallel very easy to use.
|
|
|
|
If you write loops in shell, you will find GNU Parallel may be able
|
|
|
|
to replace most of the loops and make them run faster by running
|
|
|
|
jobs in parallel. If you use ppss or pexec you will find GNU
|
|
|
|
Parallel will often make the command easier to read.
|
|
|
|
|
|
|
|
GNU Parallel makes sure output from the commands is the same output
|
|
|
|
as you would get had you run the commands sequentially. This makes
|
|
|
|
it possible to use output from GNU Parallel as input for other
|
|
|
|
programs.
|
|
|
|
'';
|
|
|
|
homepage = "https://www.gnu.org/software/parallel/";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ pSub vrthra tomberek ];
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "parallel";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|