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 14buildPythonPackage rec { 15 pname = "pyside6-qtads"; 16 version = "4.4.1"; 17 pyproject = true; 18 19 src = fetchFromGitHub { 20 owner = "mborgerson"; 21 repo = "pyside6_qtads"; 22 tag = "v${version}"; 23 hash = "sha256-XEPhZBFAZOvr3Kelz9mplkJiQH3zUf2QZJs/NNJE114="; 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}