1{ lib, fetchFromGitHub, fetchpatch, buildPythonPackage, cython, slurm }:
2
3buildPythonPackage rec {
4 pname = "pyslurm";
5 version = "18-08-3";
6
7 src = fetchFromGitHub {
8 repo = "pyslurm";
9 owner = "PySlurm";
10 rev = version;
11 sha256 = "1rymx106xa99wd4n44s7jw0w41spg39y1ji4fgn01yk7wjfrdrwg";
12 };
13
14 # Needed for patch below to apply
15 prePatch = ''
16 sed -i -e '/__max_slurm_hex_version__ = "0x1208/c__max_slurm_hex_version__ = "0x120804"' setup.py
17 '';
18
19 patches = [
20 # Implements a less strict slurm version check
21 (fetchpatch {
22 url = "https://github.com/PySlurm/pyslurm/commit/d3703f2d58b5177d29092fe1aae1f7a96da61765.diff";
23 sha256 = "1s41z9bhzhplgg08p1llc3i8zw20r1479s04y0l1vx0ak51b6w0k";
24 })
25 ];
26
27 buildInputs = [ cython slurm ];
28 setupPyBuildFlags = [ "--slurm-lib=${slurm}/lib" "--slurm-inc=${slurm.dev}/include" ];
29
30 # Test cases need /etc/slurm/slurm.conf and require a working slurm installation
31 doCheck = false;
32
33 meta = with lib; {
34 homepage = https://github.com/PySlurm/pyslurm;
35 description = "Python bindings to Slurm";
36 license = licenses.gpl2;
37 maintainers = [ maintainers.veprbl ];
38 };
39}