1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 python3,
6 qmake,
7 qtwebengine,
8 qtxmlpatterns,
9 qttools,
10}:
11
12stdenv.mkDerivation (finalAttrs: {
13 pname = "python-qt";
14 version = "3.6.1";
15
16 src = fetchFromGitHub {
17 owner = "MeVisLab";
18 repo = "pythonqt";
19 rev = "v${finalAttrs.version}";
20 hash = "sha256-OYFQtDGq+d32RQ0vChRKH//O9QgQPLMd1he8X3zCi+U=";
21 };
22
23 nativeBuildInputs = [
24 qmake
25 qttools
26 qtxmlpatterns
27 qtwebengine
28 ];
29
30 buildInputs = [ python3 ];
31
32 qmakeFlags = [
33 "PYTHON_DIR=${python3}"
34 "PYTHON_VERSION=3.${python3.sourceVersion.minor}"
35 ];
36
37 dontWrapQtApps = true;
38
39 installPhase = ''
40 mkdir -p $out/include/PythonQt
41 cp -r ./lib $out
42 cp -r ./src/* $out/include/PythonQt
43 cp -r ./build $out/include/PythonQt
44 cp -r ./extensions $out/include/PythonQt
45 '';
46
47 preFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
48 install_name_tool -id \
49 $out/lib/libPythonQt-Qt5-Python3.${python3.sourceVersion.minor}.dylib \
50 $out/lib/libPythonQt-Qt5-Python3.${python3.sourceVersion.minor}.dylib
51 install_name_tool -change \
52 libPythonQt-Qt5-Python3.${python3.sourceVersion.minor}.3.dylib \
53 $out/lib/libPythonQt-Qt5-Python3.${python3.sourceVersion.minor}.3.dylib \
54 -id \
55 $out/lib/libPythonQt_QtAll-Qt5-Python3.${python3.sourceVersion.minor}.dylib \
56 $out/lib/libPythonQt_QtAll-Qt5-Python3.${python3.sourceVersion.minor}.dylib
57 '';
58
59 meta = with lib; {
60 description = "PythonQt is a dynamic Python binding for the Qt framework. It offers an easy way to embed the Python scripting language into your C++ Qt applications";
61 homepage = "https://pythonqt.sourceforge.net/";
62 license = licenses.lgpl21;
63 platforms = platforms.all;
64 maintainers = with maintainers; [ hlolli ];
65 };
66})