1{ stdenv, fetchurl, openssl, flex, bison, pkgconfig, groff, libxml2, utillinux
2, file, libtool, which }:
3
4stdenv.mkDerivation rec {
5 name = "torque-4.2.10";
6
7 src = fetchurl {
8 name = "${name}.tar.gz";
9 url = "http://www.adaptivecomputing.com/index.php?wpfb_dl=2880";
10 sha256 = "1qpsk3bla6b6m7m0i1xpr183yj79liy3p34xhnz1grgq0776wg5l";
11 };
12
13 buildInputs = [ openssl flex bison pkgconfig groff libxml2 utillinux libtool
14 which ];
15
16 enableParallelBuilding = true;
17
18 preConfigure = ''
19 substituteInPlace ./configure \
20 --replace '/usr/bin/file' '${file}/bin/file'
21
22 # fix broken libxml2 detection
23 sed -i '/xmlLib\=/c\xmlLib=xml2' ./configure
24
25 for s in fifo cray_t3e dec_cluster msic_cluster sgi_origin umn_cluster; do
26 substituteInPlace src/scheduler.cc/samples/$s/Makefile.in \
27 --replace "schedprivdir = " "schedprivdir = $out/"
28 done
29
30 for f in $(find ./ -name Makefile.in); do
31 echo patching $f...
32 sed -i $f -e '/PBS_MKDIRS/d'
33 done
34 '';
35
36 postInstall = ''
37 mv $out/sbin/* $out/bin/
38 rmdir $out/sbin
39 cp -v buildutils/pbs_mkdirs $out/bin/
40 cp -v torque.setup $out/bin/
41 chmod +x $out/bin/pbs_mkdirs $out/bin/torque.setup
42 '';
43
44 meta = with stdenv.lib; {
45 homepage = http://www.adaptivecomputing.com/products/open-source/torque;
46 description = "Resource management system for submitting and controlling jobs on supercomputers, clusters, and grids";
47 platforms = platforms.linux;
48 };
49}