2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
python,
|
2024-09-19 14:19:46 +00:00
|
|
|
pythonAtLeast,
|
2024-06-05 15:53:02 +00:00
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
pyside2,
|
|
|
|
cmake,
|
|
|
|
qt5,
|
|
|
|
libxcrypt,
|
|
|
|
llvmPackages_15,
|
2022-12-28 21:21:41 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "shiboken2";
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
inherit (pyside2) version src patches;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
postPatch =
|
|
|
|
(lib.optionalString (pythonAtLeast "3.12") ''
|
|
|
|
substituteInPlace \
|
|
|
|
ez_setup.py \
|
|
|
|
build_scripts/main.py \
|
|
|
|
build_scripts/options.py \
|
|
|
|
build_scripts/utils.py \
|
|
|
|
build_scripts/wheel_override.py \
|
|
|
|
build_scripts/wheel_utils.py \
|
|
|
|
sources/shiboken2/CMakeLists.txt \
|
|
|
|
sources/shiboken2/data/shiboken_helpers.cmake \
|
|
|
|
--replace-fail "from distutils" "import setuptools; from distutils"
|
|
|
|
substituteInPlace \
|
|
|
|
build_scripts/config.py \
|
|
|
|
build_scripts/main.py \
|
|
|
|
build_scripts/options.py \
|
|
|
|
build_scripts/setup_runner.py \
|
|
|
|
build_scripts/utils.py \
|
|
|
|
--replace-fail "import distutils" "import setuptools; import distutils"
|
|
|
|
'')
|
|
|
|
+ ''
|
|
|
|
cd sources/shiboken2
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
CLANG_INSTALL_DIR = llvmPackages_15.libclang.out;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
(python.withPackages (ps: with ps; [ setuptools ]))
|
|
|
|
];
|
2022-12-28 21:21:41 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs =
|
|
|
|
[
|
|
|
|
llvmPackages_15.libclang
|
|
|
|
python.pkgs.setuptools
|
|
|
|
qt5.qtbase
|
|
|
|
qt5.qtxmlpatterns
|
|
|
|
]
|
|
|
|
++ (lib.optionals (python.pythonOlder "3.9") [
|
|
|
|
# see similar issue: 202262
|
|
|
|
# libxcrypt is required for crypt.h for building older python modules
|
|
|
|
libxcrypt
|
|
|
|
]);
|
|
|
|
|
|
|
|
cmakeFlags = [ "-DBUILD_TESTS=OFF" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
2022-07-18 16:21:45 +00:00
|
|
|
cd ../../..
|
2023-11-16 04:20:00 +00:00
|
|
|
${python.pythonOnBuildForHost.interpreter} setup.py egg_info --build-type=shiboken2
|
2022-07-18 16:21:45 +00:00
|
|
|
cp -r shiboken2.egg-info $out/${python.sitePackages}/
|
2020-04-24 23:36:52 +00:00
|
|
|
rm $out/bin/shiboken_tool.py
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Generator for the PySide2 Qt bindings";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "shiboken2";
|
2024-06-05 15:53:02 +00:00
|
|
|
license = with licenses; [
|
|
|
|
gpl2
|
|
|
|
lgpl21
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://wiki.qt.io/Qt_for_Python";
|
|
|
|
maintainers = with maintainers; [ gebner ];
|
|
|
|
};
|
|
|
|
}
|