nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pyqt5,
6 pyqt-builder,
7 python,
8 qt3d,
9 setuptools,
10 sip,
11}:
12
13buildPythonPackage rec {
14 pname = "pyqt3d";
15 version = "5.15.7";
16 pyproject = true;
17
18 src = fetchPypi {
19 pname = "PyQt3D";
20 inherit version;
21 hash = "sha256-6ng+tUbH2tLV6q+C6lBQ3eRSVamELgoddYSIHp4lqVE=";
22 };
23
24 postPatch = ''
25 substituteInPlace pyproject.toml \
26 --replace "[tool.sip.project]" "[tool.sip.project]''\nsip-include-dirs = [\"${pyqt5}/${python.sitePackages}/PyQt5/bindings\"]"
27 '';
28
29 outputs = [
30 "out"
31 "dev"
32 ];
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 = [ qt3d ];
55
56 propagatedBuildInputs = [ pyqt5 ];
57
58 dontConfigure = true;
59
60 # has no tests
61 doCheck = false;
62
63 pythonImportsCheck = [ "PyQt5.Qt3DCore" ];
64
65 meta = {
66 description = "Python bindings for the Qt 3D framework";
67 homepage = "https://riverbankcomputing.com/";
68 license = lib.licenses.gpl3Only;
69 maintainers = with lib.maintainers; [ panicgh ];
70 };
71}