lol

python3Packages.pyside6-qtads: init at 4.3.1.1

authored by

Spencer Pogorzelski and committed by
Fabian Affolter
5c388601 f4b669e5

+125
+80
pkgs/development/python-modules/pyside6-qtads/default.nix
··· 1 + { 2 + buildPythonPackage, 3 + cmake-build-extension, 4 + fetchFromGitHub, 5 + lib, 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.1"; 17 + pyproject = true; 18 + 19 + src = fetchFromGitHub { 20 + owner = "mborgerson"; 21 + repo = "pyside6_qtads"; 22 + rev = "v${version}"; 23 + hash = "sha256-WSthRtK9IaRDDFEtGMUsQwylD+iGdsZM2vkXBjt8+mI="; 24 + fetchSubmodules = true; 25 + }; 26 + 27 + # bypass the broken parts of their bespoke python script cmake plugin 28 + patches = [ ./find-nix-deps.patch ]; 29 + postPatch = '' 30 + substituteInPlace setup.py \ 31 + --replace-fail @shiboken6@ ${shiboken6} \ 32 + --replace-fail @pyside6@ ${pyside6} 33 + 34 + # can't use pythonRelaxDepsHook because it runs postBuild but the dependency check 35 + # happens during build. 36 + # -Essentials is a smaller version of PySide6, but the name mismatch breaks build 37 + # _generator is also a virtual package with the same issue 38 + substituteInPlace pyproject.toml \ 39 + --replace-warn 'PySide6-Essentials' "" \ 40 + --replace-warn 'shiboken6_generator' "" \ 41 + --replace-quiet '"",' "" \ 42 + --replace-quiet '""' "" 43 + ''; 44 + 45 + buildInputs = [ 46 + qt6.qtbase 47 + qt6.qtquick3d 48 + ]; 49 + 50 + nativeBuildInputs = [ 51 + pythonRelaxDepsHook 52 + ]; 53 + 54 + build-system = [ 55 + cmake-build-extension 56 + setuptools 57 + setuptools-scm 58 + ]; 59 + 60 + dependencies = [ 61 + pyside6 62 + shiboken6 63 + ]; 64 + 65 + # cmake-build-extension will configure 66 + dontUseCmakeConfigure = true; 67 + 68 + dontWrapQtApps = true; 69 + # runtime deps check fails on the pyside6-essentials virtual package 70 + dontCheckRuntimeDeps = true; 71 + 72 + pythonImportsCheck = [ "PySide6QtAds" ]; 73 + 74 + meta = { 75 + description = "Python bindings to Qt Advanced Docking System for PySide6"; 76 + homepage = "https://github.com/mborgerson/pyside6_qtads"; 77 + license = lib.licenses.mit; 78 + maintainers = with lib.maintainers; [ scoder12 ]; 79 + }; 80 + }
+43
pkgs/development/python-modules/pyside6-qtads/find-nix-deps.patch
··· 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 + ),
+2
pkgs/top-level/python-packages.nix
··· 13011 13011 inherit (pkgs) cmake ninja; 13012 13012 }); 13013 13013 13014 + pyside6-qtads = callPackage ../development/python-modules/pyside6-qtads { }; 13015 + 13014 13016 pysigma = callPackage ../development/python-modules/pysigma { }; 13015 13017 13016 13018 pysigma-backend-elasticsearch = callPackage ../development/python-modules/pysigma-backend-elasticsearch { };