Skip to content

Commit d1c3337

Browse files
authoredMar 22, 2025
python3Packages.pyside6-qtads: init at 4.3.1.1 (#370105)
2 parents d6fb228 + 3216030 commit d1c3337

File tree

4 files changed

+175
-0
lines changed

4 files changed

+175
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
lib,
3+
buildPythonPackage,
4+
cmake,
5+
fetchFromGitHub,
6+
gitpython,
7+
ninja,
8+
setuptools,
9+
setuptools-scm,
10+
}:
11+
12+
buildPythonPackage rec {
13+
pname = "cmake-build-extension";
14+
version = "0.6.1";
15+
pyproject = true;
16+
17+
src = fetchFromGitHub {
18+
owner = "diegoferigo";
19+
repo = "cmake-build-extension";
20+
tag = "v${version}";
21+
hash = "sha256-taAwxa7Sv+xc8xJRnNM6V7WPcL+TWZOkngwuqjAslzc=";
22+
};
23+
24+
build-system = [
25+
setuptools
26+
setuptools-scm
27+
];
28+
29+
dependencies = [
30+
cmake
31+
ninja
32+
gitpython
33+
];
34+
35+
dontUseCmakeConfigure = true;
36+
37+
pythonImportsCheck = [ "cmake_build_extension" ];
38+
39+
doPythonRuntimeDepsCheck = false;
40+
41+
meta = {
42+
description = "Setuptools extension to build and package CMake projects";
43+
homepage = "https://github.com/diegoferigo/cmake-build-extension";
44+
changelog = "https://github.com/diegoferigo/cmake-build-extension/releases/tag/v${version}";
45+
license = lib.licenses.mit;
46+
maintainers = with lib.maintainers; [ scoder12 ];
47+
};
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
lib,
3+
buildPythonPackage,
4+
cmake-build-extension,
5+
fetchFromGitHub,
6+
pythonRelaxDepsHook,
7+
pyside6,
8+
qt6,
9+
setuptools,
10+
setuptools-scm,
11+
shiboken6,
12+
}:
13+
14+
buildPythonPackage rec {
15+
pname = "pyside6-qtads";
16+
version = "4.3.1.4";
17+
pyproject = true;
18+
19+
src = fetchFromGitHub {
20+
owner = "mborgerson";
21+
repo = "pyside6_qtads";
22+
tag = "v${version}";
23+
hash = "sha256-02YUeD9PfcaYkvz9JX5FucsbG9Idk7OH24U+RXXEmvo=";
24+
fetchSubmodules = true;
25+
};
26+
27+
# bypass the broken parts of their bespoke python script cmake plugin
28+
patches = [ ./find-nix-deps.patch ];
29+
30+
postPatch = ''
31+
substituteInPlace setup.py \
32+
--replace-fail @shiboken6@ ${shiboken6} \
33+
--replace-fail @pyside6@ ${pyside6}
34+
35+
# can't use pythonRelaxDepsHook because it runs postBuild but the dependency check
36+
# happens during build.
37+
# -Essentials is a smaller version of PySide6, but the name mismatch breaks build
38+
# _generator is also a virtual package with the same issue
39+
substituteInPlace pyproject.toml \
40+
--replace-warn 'PySide6-Essentials' "" \
41+
--replace-warn 'shiboken6_generator' "" \
42+
--replace-quiet '"",' "" \
43+
--replace-quiet '""' ""
44+
'';
45+
46+
buildInputs = [
47+
qt6.qtbase
48+
qt6.qtquick3d
49+
];
50+
51+
build-system = [
52+
cmake-build-extension
53+
setuptools
54+
setuptools-scm
55+
];
56+
57+
dependencies = [
58+
pyside6
59+
shiboken6
60+
];
61+
62+
nativeBuildInputs = [ pythonRelaxDepsHook ];
63+
64+
# cmake-build-extension will configure
65+
dontUseCmakeConfigure = true;
66+
67+
dontWrapQtApps = true;
68+
# runtime deps check fails on the pyside6-essentials virtual package
69+
dontCheckRuntimeDeps = true;
70+
71+
pythonImportsCheck = [ "PySide6QtAds" ];
72+
73+
meta = {
74+
description = "Python bindings to Qt Advanced Docking System for PySide6";
75+
homepage = "https://github.com/mborgerson/pyside6_qtads";
76+
changelog = "https://github.com/mborgerson/pyside6_qtads/releases/tag/";
77+
license = lib.licenses.mit;
78+
maintainers = with lib.maintainers; [ scoder12 ];
79+
};
80+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 0c0568a..f12d50e 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -105,15 +105,17 @@ macro(pyside_config option output_var)
6+
endmacro()
7+
8+
# Query for the shiboken generator path, Python path, include paths and linker flags.
9+
+find_package(Shiboken6 REQUIRED)
10+
+find_package(PySide6 REQUIRED)
11+
pyside_config(--shiboken-module-path shiboken_module_path)
12+
-pyside_config(--shiboken-generator-path shiboken_generator_path)
13+
-pyside_config(--pyside-path pyside_path)
14+
-pyside_config(--pyside-include-path pyside_include_dir 1)
15+
+set(shiboken_generator_path "" CACHE PATH "Path where shiboken6 executable can be found")
16+
+set(pyside_path "" CACHE PATH "pyside share path, where typesystems dir can be found")
17+
+get_target_property(pyside_include_dir PySide6::pyside6 INTERFACE_INCLUDE_DIRECTORIES)
18+
pyside_config(--python-include-path python_include_dir)
19+
-pyside_config(--shiboken-generator-include-path shiboken_include_dir 1)
20+
-pyside_config(--shiboken-module-shared-libraries-cmake shiboken_shared_libraries 0)
21+
+get_target_property(shiboken_include_dir Shiboken6::libshiboken INTERFACE_INCLUDE_DIRECTORIES)
22+
+get_target_property(shiboken_shared_libraries Shiboken6::libshiboken IMPORTED_LOCATION_RELEASE)
23+
pyside_config(--python-link-flags-cmake python_linking_data 0)
24+
-pyside_config(--pyside-shared-libraries-cmake pyside_shared_libraries 0)
25+
+get_target_property(pyside_shared_libraries PySide6::pyside6 IMPORTED_LOCATION_RELEASE)
26+
27+
set(shiboken_path "${shiboken_generator_path}/shiboken6${CMAKE_EXECUTABLE_SUFFIX}")
28+
if(NOT EXISTS ${shiboken_path})
29+
diff --git a/setup.py b/setup.py
30+
index 802821b..f522818 100644
31+
--- a/setup.py
32+
+++ b/setup.py
33+
@@ -88,7 +88,9 @@ setuptools.setup(
34+
"-DBUILD_STATIC:BOOL=ON",
35+
"-DADS_VERSION=4.3.0",
36+
f"-DPython3_ROOT_DIR={Path(sys.prefix)}",
37+
- f"-DPython_EXECUTABLE={Path(sys.executable)}"
38+
+ f"-DPython_EXECUTABLE={Path(sys.executable)}",
39+
+ "-Dshiboken_generator_path=@shiboken6@/bin",
40+
+ "-Dpyside_path=@pyside6@/share/PySide6"
41+
],
42+
py_limited_api=True
43+
),

‎pkgs/top-level/python-packages.nix

+4
Original file line numberDiff line numberDiff line change
@@ -2522,6 +2522,8 @@ self: super: with self; {
25222522

25232523
cmake = callPackage ../development/python-modules/cmake { inherit (pkgs) cmake; };
25242524

2525+
cmake-build-extension = callPackage ../development/python-modules/cmake-build-extension { };
2526+
25252527
cmarkgfm = callPackage ../development/python-modules/cmarkgfm { };
25262528

25272529
cmd2 = callPackage ../development/python-modules/cmd2 { };
@@ -13009,6 +13011,8 @@ self: super: with self; {
1300913011
inherit (pkgs) cmake ninja;
1301013012
});
1301113013

13014+
pyside6-qtads = callPackage ../development/python-modules/pyside6-qtads { };
13015+
1301213016
pysigma = callPackage ../development/python-modules/pysigma { };
1301313017

1301413018
pysigma-backend-elasticsearch = callPackage ../development/python-modules/pysigma-backend-elasticsearch { };

0 commit comments

Comments
 (0)
Failed to load comments.