From f272f575abdba0769e02e014f24931ca18a6645f Mon Sep 17 00:00:00 2001 From: Lily Foster Date: Wed, 22 Nov 2023 15:28:22 -0500 Subject: [PATCH] python3Packages.{shiboken6,pyside6}: 6.5.2 -> 6.6.0 --- .../python-modules/pyside6/default.nix | 13 +-------- .../python-modules/shiboken6/default.nix | 27 ++++++++++++++----- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/pkgs/development/python-modules/pyside6/default.nix b/pkgs/development/python-modules/pyside6/default.nix index e03516742527..e5029c387a3c 100644 --- a/pkgs/development/python-modules/pyside6/default.nix +++ b/pkgs/development/python-modules/pyside6/default.nix @@ -1,12 +1,10 @@ { lib , stdenv -, fetchpatch2 , cmake , ninja , python , moveBuildTree , shiboken6 -, libxcrypt }: stdenv.mkDerivation rec { @@ -14,16 +12,7 @@ stdenv.mkDerivation rec { inherit (shiboken6) version src; - sourceRoot = "pyside-setup-everywhere-src-${version}/sources/${pname}"; - - patches = [ - # Needed to build against qt 6.5.3, until pyside 6.5.3 is released - (fetchpatch2 { - url = "https://code.qt.io/cgit/pyside/pyside-setup.git/patch/sources/pyside6?id=63ef7628091c8827e3d0d688220d3ae165587eb2"; - hash = "sha256-TN1xdBkrzZhNontShMC1SKyJK6a8fOk/Di3zX3kv5+I="; - stripLen = 2; - }) - ]; + sourceRoot = "pyside-setup-everywhere-src-${lib.removeSuffix ".0" version}/sources/${pname}"; # FIXME: cmake/Macros/PySideModules.cmake supposes that all Qt frameworks on macOS # reside in the same directory as QtCore.framework, which is not true for Nix. diff --git a/pkgs/development/python-modules/shiboken6/default.nix b/pkgs/development/python-modules/shiboken6/default.nix index ca227a625b73..fe3e2e34fdd9 100644 --- a/pkgs/development/python-modules/shiboken6/default.nix +++ b/pkgs/development/python-modules/shiboken6/default.nix @@ -1,11 +1,11 @@ { lib , fetchurl +, fetchpatch , llvmPackages , python , cmake , autoPatchelfHook , stdenv -, libxcrypt }: let @@ -13,23 +13,30 @@ let in stdenv'.mkDerivation rec { pname = "shiboken6"; - version = "6.5.2"; + version = "6.6.0"; src = fetchurl { # https://download.qt.io/official_releases/QtForPython/shiboken6/ url = "https://download.qt.io/official_releases/QtForPython/shiboken6/PySide6-${version}-src/pyside-setup-everywhere-src-${version}.tar.xz"; - sha256 = "sha256-kNvx0U/NQcmKfL6kS4pJUeENC3mOFUdJdW5JRmVNG6g"; + sha256 = "sha256-LdAC24hRqHFzNU84qoxuxC0P8frJnqQisp4t/OUtFjg="; }; - sourceRoot = "pyside-setup-everywhere-src-${version}/sources/${pname}"; + sourceRoot = "pyside-setup-everywhere-src-${lib.removeSuffix ".0" version}/sources/${pname}"; patches = [ ./fix-include-qt-headers.patch + # TODO: remove after bumping above 6.6.0 + (fetchpatch { + name = "shiboken6-improve-api-extractor-argument-parsing.patch"; + url = "https://code.qt.io/cgit/pyside/pyside-setup.git/patch/?id=6abde77c3df60ccac25089660df5797de7f6e68c"; + hash = "sha256-uctp5rjY16X37BYzsZzg9AAgM2hwNVkcNxT1bCobb0I="; + stripLen = 2; + }) ]; nativeBuildInputs = [ cmake - python + (python.pythonOnBuildForHost.withPackages (ps: [ ps.setuptools ])) ] ++ lib.optionals stdenv.isLinux [ autoPatchelfHook ]; @@ -47,14 +54,20 @@ stdenv'.mkDerivation rec { "-DBUILD_TESTS=OFF" ]; - # Due to Shiboken.abi3.so being linked to libshiboken6.abi3.so.6.5 in the build tree, + # We intentionally use single quotes around `${BASH}` since it expands from a CMake + # variable available in this file. + postPatch = '' + substituteInPlace cmake/ShibokenHelpers.cmake --replace '#!/bin/bash' '#!''${BASH}' + ''; + + # Due to Shiboken.abi3.so being linked to libshiboken6.abi3.so.6.6 in the build tree, # we need to remove the build tree reference from the RPATH and then add the correct # directory to the RPATH. On Linux, the second part is handled by autoPatchelfHook. # https://bugreports.qt.io/browse/PYSIDE-2233 preFixup = '' echo "fixing RPATH of Shiboken.abi3.so" '' + lib.optionalString stdenv.isDarwin '' - install_name_tool -change {@rpath,$out/lib}/libshiboken6.abi3.6.5.dylib $out/${python.sitePackages}/shiboken6/Shiboken.abi3.so + install_name_tool -change {@rpath,$out/lib}/libshiboken6.abi3.6.6.dylib $out/${python.sitePackages}/shiboken6/Shiboken.abi3.so '' + lib.optionalString stdenv.isLinux '' patchelf $out/${python.sitePackages}/shiboken6/Shiboken.abi3.so --shrink-rpath --allowed-rpath-prefixes ${builtins.storeDir} '';