at 24.05-pre 1.5 kB view raw
1{ lib 2, stdenv 3, libsigrok 4, toPythonModule 5, python 6, autoreconfHook 7, pythonImportsCheckHook 8, pythonCatchConflictsHook 9, swig 10, setuptools 11, numpy 12, pygobject3 13}: 14 15# build libsigrok plus its Python bindings. Unfortunately it does not appear 16# to be possible to build them separately, at least not easily. 17toPythonModule ((libsigrok.override { 18 inherit python; 19}).overrideAttrs (orig: { 20 pname = "${python.libPrefix}-sigrok"; 21 22 patches = orig.patches or [] ++ [ 23 # Makes libsigrok install the bindings into site-packages properly (like 24 # we expect) instead of making a version-specific *.egg subdirectory. 25 ./python-install.patch 26 ]; 27 28 nativeBuildInputs = orig.nativeBuildInputs or [] ++ [ 29 autoreconfHook 30 setuptools 31 swig 32 numpy 33 ] ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ 34 pythonImportsCheckHook 35 pythonCatchConflictsHook 36 ]; 37 38 buildInputs = orig.buildInputs or [] ++ [ 39 pygobject3 # makes headers available the configure script checks for 40 ]; 41 42 propagatedBuildInputs = orig.propagatedBuildInputs or [] ++ [ 43 pygobject3 44 numpy 45 ]; 46 47 postInstall = '' 48 ${orig.postInstall or ""} 49 50 # for pythonImportsCheck 51 export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH" 52 ''; 53 54 pythonImportsCheck = [ "sigrok" "sigrok.core" ]; 55 56 meta = orig.meta // { 57 description = "Python bindings for libsigrok"; 58 maintainers = orig.meta.maintainers ++ [ 59 lib.maintainers.sternenseemann 60 ]; 61 }; 62}))