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