@@ -0,0 +1,65 @@
1+{ lib, stdenv, fetchurl
2+, flex, installShellFiles, ncurses, which
3+}:
4+
5+stdenv.mkDerivation rec {
6+ pname = "xjobs";
7+ version = "20200726";
8+
9+ src = fetchurl {
10+ url = "mirror://sourceforge//xjobs/files/${pname}-${version}.tgz";
11+ sha256 = "0ay6gn43pnm7r1jamwgpycl67bjg5n87ncl27jb01w2x6x70z0i3";
12+ };
13+
14+ nativeBuildInputs = [
15+ flex
16+ installShellFiles
17+ which
18+ ];
19+ buildInputs = [
20+ ncurses
21+ ];
22+
23+ checkPhase = ''
24+ runHook preCheck
25+ ./${pname} -V
26+ runHook postCheck
27+ '';
28+
29+ installPhase = ''
30+ runHook preInstall
31+ mkdir -p $out/{bin,etc}
32+ install -m755 ${pname} $out/bin/${pname}
33+ install -m644 ${pname}.rc $out/etc/${pname}.rc
34+ installManPage ${pname}.1
35+ runHook postInstall
36+ '';
37+
38+ meta = with lib; {
39+ description = "A program which reads job descriptions line by line and executes them in parallel";
40+ homepage = "https://www.maier-komor.de/xjobs.html";
41+ license = licenses.gpl2Plus;
42+ platforms = platforms.all;
43+ maintainers = [ maintainers.siriobalmelli ];
44+ longDescription = ''
45+ xjobs reads job descriptions line by line and executes them in parallel.
46+
47+ It limits the number of parallel executing jobs and starts new jobs when jobs finish.
48+
49+ Therefore, it combines the arguments from every input line with the utility
50+ and arguments given on the command line.
51+ If no utility is given as an argument to xjobs,
52+ then the first argument on every job line will be used as utility.
53+ To execute utility xjobs searches the directories given in the PATH environment variable
54+ and uses the first file found in these directories.
55+
56+ xjobs is most useful on multi-processor/core machines when one needs to execute
57+ several time consuming command several that could possibly be run in parallel.
58+ With xjobs this can be achieved easily, and it is possible to limit the load
59+ of the machine to a useful value.
60+
61+ It works similar to xargs, but starts several processes simultaneously
62+ and gives only one line of arguments to each utility call.
63+ '';
64+ };
65+}