1 { lib, stdenv, fetchFromGitHub, openssl, flex, bison, pkg-config, groff, libxml2, util-linux
2 , coreutils, file, libtool, which, boost, autoreconfHook
5 stdenv.mkDerivation rec {
9 src = fetchFromGitHub {
10 owner = "adaptivecomputing";
12 # branch 6.1.3h2, as they aren't pushing tags
13 # https://github.com/adaptivecomputing/torque/issues/467
14 rev = "458883319157cfc5c509046d09f9eb8e68e8d398";
15 sha256 = "1b56bc5j9wg87kcywzmhf7234byyrwax9v1pqsr9xmv2x7saakrr";
19 nativeBuildInputs = [ autoreconfHook pkg-config flex bison libxml2 ];
21 openssl groff libxml2 util-linux libtool
25 enableParallelBuilding = true;
27 # added to fix build with gcc7
28 env.NIX_CFLAGS_COMPILE = "-Wno-error -fpermissive";
31 substituteInPlace Makefile.am \
32 --replace "contrib/init.d contrib/systemd" ""
33 substituteInPlace src/cmds/Makefile.am \
34 --replace "/etc/" "$out/etc/"
35 substituteInPlace src/mom_rcp/pathnames.h \
36 --replace /bin/cp ${coreutils}/bin/cp
37 substituteInPlace src/resmom/requests.c \
38 --replace /bin/cp ${coreutils}/bin/cp
42 substituteInPlace ./configure \
43 --replace '/usr/bin/file' '${file}/bin/file'
45 # fix broken libxml2 detection
46 sed -i '/xmlLib\=/c\xmlLib=xml2' ./configure
48 for s in fifo cray_t3e dec_cluster msic_cluster sgi_origin umn_cluster; do
49 substituteInPlace src/scheduler.cc/samples/$s/Makefile.in \
50 --replace "schedprivdir = " "schedprivdir = $out/"
53 for f in $(find ./ -name Makefile.in); do
55 sed -i $f -e '/PBS_MKDIRS/d' -e '/chmod u+s/d'
58 patchShebangs buildutils
62 cp -v buildutils/pbs_mkdirs $out/bin/
63 cp -v torque.setup $out/bin/
64 chmod +x $out/bin/pbs_mkdirs $out/bin/torque.setup
68 homepage = "http://www.adaptivecomputing.com/products/open-source/torque";
69 description = "Resource management system for submitting and controlling jobs on supercomputers, clusters, and grids";
70 platforms = platforms.linux;
71 license = "TORQUEv1.1";