1{
2 lib,
3 fetchurl,
4 llvmPackages,
5 python,
6 cmake,
7 autoPatchelfHook,
8 stdenv,
9}:
10
11let
12 stdenv' = if stdenv.cc.isClang then stdenv else llvmPackages.stdenv;
13in
14stdenv'.mkDerivation (finalAttrs: {
15 pname = "shiboken6";
16 version = "6.8.0.2";
17
18 src = fetchurl {
19 # https://download.qt.io/official_releases/QtForPython/shiboken6/
20 # FIXME: inconsistent version numbers in directory name and tarball?
21 url = "mirror://qt/official_releases/QtForPython/shiboken6/PySide6-6.8.0.2-src/pyside-setup-everywhere-src-6.8.0.tar.xz";
22 hash = "sha256-Ghohmo8yfjQNJYJ1+tOp8mG48EvFcEF0fnPdatJStOE=";
23 };
24
25 sourceRoot = "pyside-setup-everywhere-src-6.8.0/sources/shiboken6";
26
27 patches = [ ./fix-include-qt-headers.patch ];
28
29 nativeBuildInputs = [
30 cmake
31 (python.pythonOnBuildForHost.withPackages (ps: [ ps.setuptools ]))
32 ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
33
34 buildInputs =
35 [
36 llvmPackages.llvm
37 llvmPackages.libclang
38 python.pkgs.qt6.qtbase
39 python.pkgs.ninja
40 python.pkgs.packaging
41 python.pkgs.setuptools
42 ]
43 ++ lib.optionals stdenv.hostPlatform.isDarwin [
44 python.pkgs.qt6.darwinVersionInputs
45 ];
46
47 cmakeFlags = [ "-DBUILD_TESTS=OFF" ];
48
49 # We intentionally use single quotes around `${BASH}` since it expands from a CMake
50 # variable available in this file.
51 postPatch = ''
52 substituteInPlace cmake/ShibokenHelpers.cmake --replace-fail '#!/bin/bash' '#!''${BASH}'
53 '';
54
55 postInstall = ''
56 cd ../../..
57 ${python.pythonOnBuildForHost.interpreter} setup.py egg_info --build-type=shiboken6
58 cp -r shiboken6.egg-info $out/${python.sitePackages}/
59 '';
60
61 dontWrapQtApps = true;
62
63 meta = {
64 description = "Generator for the pyside6 Qt bindings";
65 license = with lib.licenses; [
66 lgpl3Only
67 gpl2Only
68 gpl3Only
69 ];
70 homepage = "https://wiki.qt.io/Qt_for_Python";
71 changelog = "https://code.qt.io/cgit/pyside/pyside-setup.git/tree/doc/changelogs/changes-${finalAttrs.version}?h=v${finalAttrs.version}";
72 maintainers = with lib.maintainers; [ gebner ];
73 platforms = lib.platforms.all;
74 };
75})