Skip to content

Commit

Permalink
torque: add missing dependency, format, do minor cleanup (#352489)
Browse files Browse the repository at this point in the history
  • Loading branch information
wegank authored Nov 2, 2024
2 parents f2d93e4 + 2ea9273 commit 9e273e5
Showing 1 changed file with 44 additions and 18 deletions.
62 changes: 44 additions & 18 deletions pkgs/servers/computing/torque/default.nix
Original file line number Diff line number Diff line change
@@ -1,25 +1,56 @@
{ lib, stdenv, fetchFromGitHub, openssl, flex, bison, pkg-config, groff, libxml2, util-linux
, coreutils, file, libtool, which, boost, autoreconfHook
{
lib,
stdenv,
fetchFromGitHub,

autoreconfHook,
pkg-config,
flex,
bison,

openssl,
groff,
libxml2,
util-linux,
libtool,
which,
coreutils,
boost,
zlib,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation {
pname = "torque";
version = "6.1.3h2";

src = fetchFromGitHub {
owner = "adaptivecomputing";
repo = pname;
repo = "torque";
# branch 6.1.3h2, as they aren't pushing tags
# https://github.com/adaptivecomputing/torque/issues/467
rev = "458883319157cfc5c509046d09f9eb8e68e8d398";
sha256 = "1b56bc5j9wg87kcywzmhf7234byyrwax9v1pqsr9xmv2x7saakrr";
};

strictDeps = true;
nativeBuildInputs = [ autoreconfHook pkg-config flex bison libxml2 ];

nativeBuildInputs = [
autoreconfHook
pkg-config
flex
bison
libxml2
];

buildInputs = [
openssl groff libxml2 util-linux libtool
which boost
openssl
groff
libxml2
util-linux
libtool
which
boost
zlib
];

enableParallelBuilding = true;
Expand All @@ -29,25 +60,22 @@ stdenv.mkDerivation rec {

postPatch = ''
substituteInPlace Makefile.am \
--replace "contrib/init.d contrib/systemd" ""
--replace-fail "contrib/init.d contrib/systemd" ""
substituteInPlace src/cmds/Makefile.am \
--replace "/etc/" "$out/etc/"
--replace-fail "/etc/" "$out/etc/"
substituteInPlace src/mom_rcp/pathnames.h \
--replace /bin/cp ${coreutils}/bin/cp
--replace-fail /bin/cp ${coreutils}/bin/cp
substituteInPlace src/resmom/requests.c \
--replace /bin/cp ${coreutils}/bin/cp
--replace-fail /bin/cp ${coreutils}/bin/cp
'';

preConfigure = ''
substituteInPlace ./configure \
--replace '/usr/bin/file' '${file}/bin/file'
# fix broken libxml2 detection
sed -i '/xmlLib\=/c\xmlLib=xml2' ./configure
for s in fifo cray_t3e dec_cluster msic_cluster sgi_origin umn_cluster; do
substituteInPlace src/scheduler.cc/samples/$s/Makefile.in \
--replace "schedprivdir = " "schedprivdir = $out/"
--replace-fail "schedprivdir = " "schedprivdir = $out/"
done
for f in $(find ./ -name Makefile.in); do
Expand All @@ -59,9 +87,7 @@ stdenv.mkDerivation rec {
'';

postInstall = ''
cp -v buildutils/pbs_mkdirs $out/bin/
cp -v torque.setup $out/bin/
chmod +x $out/bin/pbs_mkdirs $out/bin/torque.setup
install -Dm755 torque.setup buildutils/pbs_mkdirs -t $out/bin/
'';

meta = with lib; {
Expand Down

0 comments on commit 9e273e5

Please sign in to comment.