1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, pyqt5
6, pyqt-builder
7, python
8, pythonOlder
9, qt3d
10, setuptools
11, sip
12}:
13
14buildPythonPackage rec {
15 pname = "pyqt3d";
16 version = "5.15.6";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchPypi {
22 pname = "PyQt3D";
23 inherit version;
24 hash = "sha256-fWxtVc2PwiGzE8mVwPhymjdxFJJvA3f46QEdRevziBw=";
25 };
26
27 postPatch = ''
28 substituteInPlace pyproject.toml \
29 --replace "[tool.sip.project]" "[tool.sip.project]''\nsip-include-dirs = [\"${pyqt5}/${python.sitePackages}/PyQt5/bindings\"]"
30 '';
31
32 outputs = [ "out" "dev" ];
33
34 enableParallelBuilding = true;
35 # HACK: paralellize compilation of make calls within pyqt's setup.py
36 # pkgs/stdenv/generic/setup.sh doesn't set this for us because
37 # make gets called by python code and not its build phase
38 # format=pyproject means the pip-build-hook hook gets used to build this project
39 # pkgs/development/interpreters/python/hooks/pip-build-hook.sh
40 # does not use the enableParallelBuilding flag
41 preBuild = ''
42 export MAKEFLAGS+="''${enableParallelBuilding:+-j$NIX_BUILD_CORES}"
43 '';
44
45 dontWrapQtApps = true;
46
47 nativeBuildInputs = [
48 sip
49 qt3d
50 setuptools
51 pyqt-builder
52 ];
53
54 buildInputs = [
55 qt3d
56 ];
57
58 propagatedBuildInputs = [
59 pyqt5
60 ];
61
62 dontConfigure = true;
63
64 # has no tests
65 doCheck = false;
66
67 pythonImportsCheck = [
68 "PyQt5.Qt3DCore"
69 ];
70
71 meta = with lib; {
72 description = "Python bindings for the Qt 3D framework";
73 homepage = "https://riverbankcomputing.com/";
74 license = licenses.gpl3Only;
75 maintainers = with maintainers; [ panicgh ];
76 };
77}