linuxPackages_latest.broadcom_sta: add patch to compile on Kernel 6.12 (#359484)
[NixPkgs.git] / pkgs / development / python-modules / shiboken6 / default.nix
bloba5c3b63f8ec75aafe29f1ff79d1e160969b282eb
2   lib,
3   fetchurl,
4   llvmPackages,
5   python,
6   cmake,
7   autoPatchelfHook,
8   stdenv,
9 }:
11 let
12   stdenv' = if stdenv.cc.isClang then stdenv else llvmPackages.stdenv;
14 stdenv'.mkDerivation (finalAttrs: {
15   pname = "shiboken6";
16   version = "6.8.0.2";
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   };
25   sourceRoot = "pyside-setup-everywhere-src-6.8.0/sources/shiboken6";
27   patches = [ ./fix-include-qt-headers.patch ];
29   nativeBuildInputs = [
30     cmake
31     (python.pythonOnBuildForHost.withPackages (ps: [ ps.setuptools ]))
32   ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
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     ];
47   cmakeFlags = [ "-DBUILD_TESTS=OFF" ];
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   '';
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   '';
61   dontWrapQtApps = true;
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   };