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