From f4b669e5d02a51a05d2107995feec408c7316165 Mon Sep 17 00:00:00 2001 From: Spencer Pogorzelski <34356756+spencerpogo@users.noreply.github.com> Date: Wed, 1 Jan 2025 18:25:53 -0800 Subject: [PATCH 1/4] python3Packages.cmake-build-extension: init at 0.6.1 --- .../cmake-build-extension/default.nix | 47 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/development/python-modules/cmake-build-extension/default.nix diff --git a/pkgs/development/python-modules/cmake-build-extension/default.nix b/pkgs/development/python-modules/cmake-build-extension/default.nix new file mode 100644 index 000000000000..d27629477669 --- /dev/null +++ b/pkgs/development/python-modules/cmake-build-extension/default.nix @@ -0,0 +1,47 @@ +{ + buildPythonPackage, + cmake, + fetchFromGitHub, + gitpython, + lib, + ninja, + setuptools, + setuptools-scm, +}: + +buildPythonPackage rec { + pname = "cmake-build-extension"; + version = "0.6.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "diegoferigo"; + repo = "cmake-build-extension"; + rev = "v${version}"; + hash = "sha256-taAwxa7Sv+xc8xJRnNM6V7WPcL+TWZOkngwuqjAslzc="; + }; + + build-system = [ + setuptools + setuptools-scm + ]; + + dependencies = [ + cmake + ninja + gitpython + ]; + + dontUseCmakeConfigure = true; + + pythonImportsCheck = [ "cmake_build_extension" ]; + doPythonRuntimeDepsCheck = false; + + meta = { + description = "Setuptools extension to build and package CMake projects"; + homepage = "https://github.com/diegoferigo/cmake-build-extension"; + changelog = "https://github.com/diegoferigo/cmake-build-extension/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ scoder12 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 36c797c832f6..0c1af1ba043c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2522,6 +2522,8 @@ self: super: with self; { cmake = callPackage ../development/python-modules/cmake { inherit (pkgs) cmake; }; + cmake-build-extension = callPackage ../development/python-modules/cmake-build-extension { }; + cmarkgfm = callPackage ../development/python-modules/cmarkgfm { }; cmd2 = callPackage ../development/python-modules/cmd2 { }; From 5c3886014d3ed43106aa98d14264f41fdcfbeacd Mon Sep 17 00:00:00 2001 From: Spencer Pogorzelski <34356756+spencerpogo@users.noreply.github.com> Date: Wed, 1 Jan 2025 18:26:13 -0800 Subject: [PATCH 2/4] python3Packages.pyside6-qtads: init at 4.3.1.1 --- .../python-modules/pyside6-qtads/default.nix | 80 +++++++++++++++++++ .../pyside6-qtads/find-nix-deps.patch | 43 ++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 125 insertions(+) create mode 100644 pkgs/development/python-modules/pyside6-qtads/default.nix create mode 100644 pkgs/development/python-modules/pyside6-qtads/find-nix-deps.patch diff --git a/pkgs/development/python-modules/pyside6-qtads/default.nix b/pkgs/development/python-modules/pyside6-qtads/default.nix new file mode 100644 index 000000000000..58fb70638033 --- /dev/null +++ b/pkgs/development/python-modules/pyside6-qtads/default.nix @@ -0,0 +1,80 @@ +{ + buildPythonPackage, + cmake-build-extension, + fetchFromGitHub, + lib, + pythonRelaxDepsHook, + pyside6, + qt6, + setuptools, + setuptools-scm, + shiboken6, +}: + +buildPythonPackage rec { + pname = "pyside6-qtads"; + version = "4.3.1.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "mborgerson"; + repo = "pyside6_qtads"; + rev = "v${version}"; + hash = "sha256-WSthRtK9IaRDDFEtGMUsQwylD+iGdsZM2vkXBjt8+mI="; + fetchSubmodules = true; + }; + + # bypass the broken parts of their bespoke python script cmake plugin + patches = [ ./find-nix-deps.patch ]; + postPatch = '' + substituteInPlace setup.py \ + --replace-fail @shiboken6@ ${shiboken6} \ + --replace-fail @pyside6@ ${pyside6} + + # can't use pythonRelaxDepsHook because it runs postBuild but the dependency check + # happens during build. + # -Essentials is a smaller version of PySide6, but the name mismatch breaks build + # _generator is also a virtual package with the same issue + substituteInPlace pyproject.toml \ + --replace-warn 'PySide6-Essentials' "" \ + --replace-warn 'shiboken6_generator' "" \ + --replace-quiet '"",' "" \ + --replace-quiet '""' "" + ''; + + buildInputs = [ + qt6.qtbase + qt6.qtquick3d + ]; + + nativeBuildInputs = [ + pythonRelaxDepsHook + ]; + + build-system = [ + cmake-build-extension + setuptools + setuptools-scm + ]; + + dependencies = [ + pyside6 + shiboken6 + ]; + + # cmake-build-extension will configure + dontUseCmakeConfigure = true; + + dontWrapQtApps = true; + # runtime deps check fails on the pyside6-essentials virtual package + dontCheckRuntimeDeps = true; + + pythonImportsCheck = [ "PySide6QtAds" ]; + + meta = { + description = "Python bindings to Qt Advanced Docking System for PySide6"; + homepage = "https://github.com/mborgerson/pyside6_qtads"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ scoder12 ]; + }; +} diff --git a/pkgs/development/python-modules/pyside6-qtads/find-nix-deps.patch b/pkgs/development/python-modules/pyside6-qtads/find-nix-deps.patch new file mode 100644 index 000000000000..5ec2f5ab8259 --- /dev/null +++ b/pkgs/development/python-modules/pyside6-qtads/find-nix-deps.patch @@ -0,0 +1,43 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0c0568a..f12d50e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -105,15 +105,17 @@ macro(pyside_config option output_var) + endmacro() + + # Query for the shiboken generator path, Python path, include paths and linker flags. ++find_package(Shiboken6 REQUIRED) ++find_package(PySide6 REQUIRED) + pyside_config(--shiboken-module-path shiboken_module_path) +-pyside_config(--shiboken-generator-path shiboken_generator_path) +-pyside_config(--pyside-path pyside_path) +-pyside_config(--pyside-include-path pyside_include_dir 1) ++set(shiboken_generator_path "" CACHE PATH "Path where shiboken6 executable can be found") ++set(pyside_path "" CACHE PATH "pyside share path, where typesystems dir can be found") ++get_target_property(pyside_include_dir PySide6::pyside6 INTERFACE_INCLUDE_DIRECTORIES) + pyside_config(--python-include-path python_include_dir) +-pyside_config(--shiboken-generator-include-path shiboken_include_dir 1) +-pyside_config(--shiboken-module-shared-libraries-cmake shiboken_shared_libraries 0) ++get_target_property(shiboken_include_dir Shiboken6::libshiboken INTERFACE_INCLUDE_DIRECTORIES) ++get_target_property(shiboken_shared_libraries Shiboken6::libshiboken IMPORTED_LOCATION_RELEASE) + pyside_config(--python-link-flags-cmake python_linking_data 0) +-pyside_config(--pyside-shared-libraries-cmake pyside_shared_libraries 0) ++get_target_property(pyside_shared_libraries PySide6::pyside6 IMPORTED_LOCATION_RELEASE) + + set(shiboken_path "${shiboken_generator_path}/shiboken6${CMAKE_EXECUTABLE_SUFFIX}") + if(NOT EXISTS ${shiboken_path}) +diff --git a/setup.py b/setup.py +index 802821b..f522818 100644 +--- a/setup.py ++++ b/setup.py +@@ -88,7 +88,9 @@ setuptools.setup( + "-DBUILD_STATIC:BOOL=ON", + "-DADS_VERSION=4.3.0", + f"-DPython3_ROOT_DIR={Path(sys.prefix)}", +- f"-DPython_EXECUTABLE={Path(sys.executable)}" ++ f"-DPython_EXECUTABLE={Path(sys.executable)}", ++ "-Dshiboken_generator_path=@shiboken6@/bin", ++ "-Dpyside_path=@pyside6@/share/PySide6" + ], + py_limited_api=True + ), diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0c1af1ba043c..26581cde0bc4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13011,6 +13011,8 @@ self: super: with self; { inherit (pkgs) cmake ninja; }); + pyside6-qtads = callPackage ../development/python-modules/pyside6-qtads { }; + pysigma = callPackage ../development/python-modules/pysigma { }; pysigma-backend-elasticsearch = callPackage ../development/python-modules/pysigma-backend-elasticsearch { }; From b60b02b8e3d24eda41e16d14be0dae6824782949 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 22 Mar 2025 21:03:06 +0100 Subject: [PATCH 3/4] python313Packages.cmake-build-extension: refactor --- .../python-modules/cmake-build-extension/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/cmake-build-extension/default.nix b/pkgs/development/python-modules/cmake-build-extension/default.nix index d27629477669..23388f7d7d50 100644 --- a/pkgs/development/python-modules/cmake-build-extension/default.nix +++ b/pkgs/development/python-modules/cmake-build-extension/default.nix @@ -1,9 +1,9 @@ { + lib, buildPythonPackage, cmake, fetchFromGitHub, gitpython, - lib, ninja, setuptools, setuptools-scm, @@ -17,7 +17,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "diegoferigo"; repo = "cmake-build-extension"; - rev = "v${version}"; + tag = "v${version}"; hash = "sha256-taAwxa7Sv+xc8xJRnNM6V7WPcL+TWZOkngwuqjAslzc="; }; @@ -35,6 +35,7 @@ buildPythonPackage rec { dontUseCmakeConfigure = true; pythonImportsCheck = [ "cmake_build_extension" ]; + doPythonRuntimeDepsCheck = false; meta = { From 32160302b97247a568e5f3cb61bd9f44483d021f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 22 Mar 2025 21:17:36 +0100 Subject: [PATCH 4/4] python313Packages.pyside6-qtads: 4.3.1.1 -> 4.3.1.4 Diff: https://github.com/mborgerson/pyside6_qtads/compare/refs/tags/v4.3.1.1...v4.3.1.4 Changelog: https://github.com/mborgerson/pyside6_qtads/releases/tag/ --- .../python-modules/pyside6-qtads/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/pyside6-qtads/default.nix b/pkgs/development/python-modules/pyside6-qtads/default.nix index 58fb70638033..b9476e6dd10b 100644 --- a/pkgs/development/python-modules/pyside6-qtads/default.nix +++ b/pkgs/development/python-modules/pyside6-qtads/default.nix @@ -1,8 +1,8 @@ { + lib, buildPythonPackage, cmake-build-extension, fetchFromGitHub, - lib, pythonRelaxDepsHook, pyside6, qt6, @@ -13,19 +13,20 @@ buildPythonPackage rec { pname = "pyside6-qtads"; - version = "4.3.1.1"; + version = "4.3.1.4"; pyproject = true; src = fetchFromGitHub { owner = "mborgerson"; repo = "pyside6_qtads"; - rev = "v${version}"; - hash = "sha256-WSthRtK9IaRDDFEtGMUsQwylD+iGdsZM2vkXBjt8+mI="; + tag = "v${version}"; + hash = "sha256-02YUeD9PfcaYkvz9JX5FucsbG9Idk7OH24U+RXXEmvo="; fetchSubmodules = true; }; # bypass the broken parts of their bespoke python script cmake plugin patches = [ ./find-nix-deps.patch ]; + postPatch = '' substituteInPlace setup.py \ --replace-fail @shiboken6@ ${shiboken6} \ @@ -47,10 +48,6 @@ buildPythonPackage rec { qt6.qtquick3d ]; - nativeBuildInputs = [ - pythonRelaxDepsHook - ]; - build-system = [ cmake-build-extension setuptools @@ -62,6 +59,8 @@ buildPythonPackage rec { shiboken6 ]; + nativeBuildInputs = [ pythonRelaxDepsHook ]; + # cmake-build-extension will configure dontUseCmakeConfigure = true; @@ -74,6 +73,7 @@ buildPythonPackage rec { meta = { description = "Python bindings to Qt Advanced Docking System for PySide6"; homepage = "https://github.com/mborgerson/pyside6_qtads"; + changelog = "https://github.com/mborgerson/pyside6_qtads/releases/tag/"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ scoder12 ]; };