Merge pull request #265987 from lilyinstarlight/upd/pyside6

python3Packages.{shiboken6,pyside6}: 6.5.2 -> 6.6.0
This commit is contained in:
K900 2023-11-27 17:00:43 +03:00 committed by GitHub
commit 494d8bcc83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 19 deletions

View File

@ -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.

View File

@ -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}
'';