1 { lib, stdenv, fetchFromGitHub, pkg-config, libtool, curl
2 , python3, munge, perl, pam, shadow, coreutils, dbus, libbpf
3 , ncurses, libmysqlclient, lua, hwloc, numactl
4 , readline, freeipmi, xorg, lz4, rdma-core, nixosTests
10 # enable internal X11 support via libssh2
12 , enableGtk2 ? false, gtk2
15 stdenv.mkDerivation rec {
17 version = "23.02.6.1";
19 # N.B. We use github release tags instead of https://www.schedmd.com/downloads.php
20 # because the latter does not keep older releases.
21 src = fetchFromGitHub {
24 # The release tags use - instead of .
25 rev = "${pname}-${builtins.replaceStrings ["."] ["-"] version}";
26 sha256 = "sha256-azgGM4qfS0xtUaiGfXtu8MNYdgpZRUfx+zBgAAlmt6g=";
29 outputs = [ "out" "dev" ];
32 # increase string length to allow for full
33 # path of 'echo' in nix store
34 ./common-env-echo.patch
38 substituteInPlace src/common/env.c \
39 --replace "/bin/echo" "${coreutils}/bin/echo"
40 '' + (lib.optionalString enableX11 ''
41 substituteInPlace src/common/x11_util.c \
42 --replace '"/usr/bin/xauth"' '"${xorg.xauth}/bin/xauth"'
45 # nixos test fails to start slurmd with 'undefined symbol: slurm_job_preempt_mode'
46 # https://groups.google.com/forum/#!topic/slurm-devel/QHOajQ84_Es
47 # this doesn't fix tests completely at least makes slurmd to launch
48 hardeningDisable = [ "bindnow" ];
50 nativeBuildInputs = [ pkg-config libtool python3 perl ];
52 curl python3 munge pam
53 libmysqlclient ncurses lz4 rdma-core
54 lua hwloc numactl readline freeipmi shadow.su
55 pmix json_c libjwt libyaml dbus libbpf
57 ] ++ lib.optionals enableX11 [ xorg.xauth ]
58 ++ lib.optionals enableGtk2 [ gtk2 ];
60 configureFlags = with lib;
61 [ "--with-freeipmi=${freeipmi}"
62 "--with-http-parser=${http-parser}"
63 "--with-hwloc=${hwloc.dev}"
64 "--with-json=${json_c.dev}"
65 "--with-jwt=${libjwt}"
66 "--with-lz4=${lz4.dev}"
67 "--with-munge=${munge}"
68 "--with-yaml=${libyaml.dev}"
69 "--with-ofed=${lib.getDev rdma-core}"
70 "--sysconfdir=/etc/slurm"
72 "--with-bpf=${libbpf}"
73 "--without-rpath" # Required for configure to pick up the right dlopen path
74 ] ++ (optional enableGtk2 "--disable-gtktest")
75 ++ (optional (!enableX11) "--disable-x11");
79 patchShebangs ./doc/html/shtml2html.py
80 patchShebangs ./doc/man/man2html.py
84 rm -f $out/lib/*.la $out/lib/slurm/*.la
87 enableParallelBuilding = true;
89 passthru.tests.slurm = nixosTests.slurm;
92 homepage = "http://www.schedmd.com/";
93 description = "Simple Linux Utility for Resource Management";
94 platforms = platforms.linux;
95 license = licenses.gpl2Only;
96 maintainers = with maintainers; [ jagajaga markuskowa ];