1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pythonOlder,
7 setuptools,
8 numactl,
9}:
10
11buildPythonPackage rec {
12 pname = "py-libnuma";
13 version = "1.2";
14 pyproject = true;
15
16 src = fetchFromGitHub {
17 owner = "eedalong";
18 repo = "pynuma";
19 rev = "66cab0e008b850a04cfec5c4fb3f50bf28e3d488";
20 hash = "sha256-ALYCcdN5eXrVWsTRwkHCwo4xsLMs/du3mUl1xSlo5iU=";
21 };
22
23 postPatch = ''
24 substituteInPlace numa/__init__.py \
25 --replace-fail \
26 'LIBNUMA = CDLL(find_library("numa"))' \
27 'LIBNUMA = CDLL("${numactl}/lib/libnuma${stdenv.hostPlatform.extensions.sharedLibrary}")'
28 '';
29
30 build-system = [ setuptools ];
31
32 dependencies = [
33 numactl
34 ];
35
36 # Tests write NUMA configuration, which may be persistent until reboot.
37 doCheck = false;
38
39 pythonImportsCheck = [ "numa" ];
40
41 meta = {
42 description = "Python3 Interface to numa Linux library";
43 homepage = "https://github.com/eedalong/pynuma";
44 platforms = lib.platforms.linux;
45 license = lib.licenses.mit;
46 };
47}