forked from mirrors/nixpkgs
python2Packages.pyslurm: init
This commit is contained in:
parent
b917a8760e
commit
00d73c4240
24
pkgs/development/python-modules/pyslurm/default.nix
Normal file
24
pkgs/development/python-modules/pyslurm/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{ lib, fetchFromGitHub, buildPythonPackage, cython, slurm }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
name = "pyslurm";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
repo = "pyslurm";
|
||||
owner = "PySlurm";
|
||||
rev = "69e4f4fd66003b98ddb7da25613fe641d4ae160d";
|
||||
sha256 = "051kafkndbniklxyf0drb360aiblnqcf9rqjbvmqh66zrfya1m28";
|
||||
};
|
||||
|
||||
patches = [ ./pyslurm-dlfcn.patch ];
|
||||
|
||||
buildInputs = [ cython slurm ];
|
||||
setupPyBuildFlags = [ "--slurm-lib=${slurm}/lib" "--slurm-inc=${slurm.dev}/include" ];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/PySlurm/pyslurm";
|
||||
description = "Python bindings to Slurm";
|
||||
license = licenses.gpl2;
|
||||
maintainers = [ maintainers.veprbl ];
|
||||
};
|
||||
}
|
18
pkgs/development/python-modules/pyslurm/pyslurm-dlfcn.patch
Normal file
18
pkgs/development/python-modules/pyslurm/pyslurm-dlfcn.patch
Normal file
|
@ -0,0 +1,18 @@
|
|||
diff --git a/pyslurm/__init__.py b/pyslurm/__init__.py
|
||||
index 81643e1..e8b6836 100644
|
||||
--- a/pyslurm/__init__.py
|
||||
+++ b/pyslurm/__init__.py
|
||||
@@ -11,8 +11,11 @@ import sys
|
||||
old_dlopen_flags = ''
|
||||
if hasattr(sys, "setdlopenflags"):
|
||||
old_dlopen_flags = sys.getdlopenflags()
|
||||
- import DLFCN
|
||||
- sys.setdlopenflags(old_dlopen_flags | DLFCN.RTLD_GLOBAL)
|
||||
+ if sys.version_info >= (3,6):
|
||||
+ from os import RTLD_GLOBAL
|
||||
+ else:
|
||||
+ from DLFCN import RTLD_GLOBAL
|
||||
+ sys.setdlopenflags(old_dlopen_flags | RTLD_GLOBAL)
|
||||
|
||||
from .pyslurm import *
|
||||
|
|
@ -324,6 +324,10 @@ in {
|
|||
|
||||
pysideTools = callPackage ../development/python-modules/pyside/tools.nix { };
|
||||
|
||||
pyslurm = callPackage ../development/python-modules/pyslurm {
|
||||
slurm = pkgs.slurm;
|
||||
};
|
||||
|
||||
python-sql = callPackage ../development/python-modules/python-sql { };
|
||||
|
||||
python-stdnum = callPackage ../development/python-modules/python-stdnum { };
|
||||
|
|
Loading…
Reference in a new issue