From 4f7cb34d635d098efbc07353660cee18501ca2f9 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 7 Apr 2024 15:24:12 +0200 Subject: [PATCH 1/9] Revert "python-qt: hit it in the head with a hammer" This reverts commit 5c964287288ae617dadc3cf7ef87a1e0c96bf3b8. --- pkgs/top-level/all-packages.nix | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 21c907aab72a..600db20322e3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24095,15 +24095,9 @@ with pkgs; pylode = callPackage ../misc/pylode { }; - python-qt = (callPackage ../development/libraries/python-qt { + python-qt = disable-warnings-if-gcc13 (callPackage ../development/libraries/python-qt { python = python3; - inherit (builtins.mapAttrs (_: pkg: pkg.override (previousArgs: lib.optionalAttrs (previousArgs ? stdenv) { stdenv = gcc12Stdenv; })) qt5) - qmake qttools qtwebengine qtxmlpatterns; - stdenv = gcc12Stdenv; - }) - .overrideAttrs(previousAttrs: { - NIX_CFLAGS_COMPILE = "-w"; - meta = previousAttrs.meta // { broken = true; }; + inherit (qt5) qmake qttools qtwebengine qtxmlpatterns; }); pyotherside = libsForQt5.callPackage ../development/libraries/pyotherside { }; From 04a1d9b204e49a8f936a41d407f18aba48472a3c Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 7 Apr 2024 16:16:03 +0200 Subject: [PATCH 2/9] python-qt: update to v3.5.0 --- .../libraries/python-qt/default.nix | 32 +++++++++---------- pkgs/top-level/all-packages.nix | 5 ++- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/pkgs/development/libraries/python-qt/default.nix b/pkgs/development/libraries/python-qt/default.nix index d238b8137d33..7b48739a8189 100644 --- a/pkgs/development/libraries/python-qt/default.nix +++ b/pkgs/development/libraries/python-qt/default.nix @@ -1,33 +1,33 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, python, qmake, +{ lib, stdenv, fetchFromGitHub, fetchpatch, python3, qmake, qtwebengine, qtxmlpatterns, qttools, unzip }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "python-qt"; - version = "3.4.2"; + version = "3.5.0"; src = fetchFromGitHub { owner = "MeVisLab"; repo = "pythonqt"; - rev = "v${version}"; - hash = "sha256-xJYOD07ACOKtY3psmfHNSCjm6t0fr8JU9CrL0w5P5G0="; + rev = "v${finalAttrs.version}"; + hash = "sha256-Yz7w5Gs0W3ilrZXjkC+wXLCCXWTKkhCpWXbg+PshXKI="; }; - # https://github.com/CsoundQt/CsoundQt/blob/develop/BUILDING.md#pythonqt - postPatch = '' - substituteInPlace build/python.prf \ - --replace "PYTHON_VERSION=2.7" "PYTHON_VERSION=${python.pythonVersion}" - ''; - - hardeningDisable = [ "all" ]; + patches = [ + (fetchpatch { + name = "fix-format-security.patch"; + url = "https://github.com/MeVisLab/pythonqt/pull/197/commits/c35d1efd00b83e0ebd826d7ed8454f3684ddffff.patch"; + hash = "sha256-WJBLPdMemuKlZWoqYVU9TXldoDpaBm84RxkepIaocUQ="; + }) + ]; nativeBuildInputs = [ qmake qtwebengine qtxmlpatterns qttools unzip ]; - buildInputs = [ python ]; + buildInputs = [ python3 ]; qmakeFlags = [ - "PythonQt.pro" - "PYTHON_DIR=${python}" + "PYTHON_DIR=${python3}" + "PYTHON_VERSION=3.${python3.sourceVersion.minor}" ]; dontWrapQtApps = true; @@ -49,4 +49,4 @@ stdenv.mkDerivation rec { platforms = platforms.all; maintainers = with maintainers; [ hlolli ]; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 600db20322e3..f9d2874e68e7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24095,10 +24095,9 @@ with pkgs; pylode = callPackage ../misc/pylode { }; - python-qt = disable-warnings-if-gcc13 (callPackage ../development/libraries/python-qt { - python = python3; + python-qt = callPackage ../development/libraries/python-qt { inherit (qt5) qmake qttools qtwebengine qtxmlpatterns; - }); + }; pyotherside = libsForQt5.callPackage ../development/libraries/pyotherside { }; From c01125ff83aca0b1ca36085ee57ca57cd0f1c644 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 7 Apr 2024 16:48:23 +0200 Subject: [PATCH 3/9] csound: clean after python-qt update --- pkgs/applications/audio/csound/csound-qt/default.nix | 8 ++++---- pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/audio/csound/csound-qt/default.nix b/pkgs/applications/audio/csound/csound-qt/default.nix index e48b45aec3e4..c2c9432eaeb0 100644 --- a/pkgs/applications/audio/csound/csound-qt/default.nix +++ b/pkgs/applications/audio/csound/csound-qt/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, csound, desktop-file-utils, - fetchFromGitHub, python, python-qt, qmake, + fetchFromGitHub, python3, python-qt, qmake, qtwebengine, qtxmlpatterns, rtmidi, wrapQtAppsHook }: stdenv.mkDerivation rec { @@ -26,13 +26,13 @@ stdenv.mkDerivation rec { "CSOUND_INCLUDE_DIR=${csound}/include/csound" "CSOUND_LIBRARY_DIR=${csound}/lib" "RTMIDI_DIR=${rtmidi.src}" - "PYTHONQT_SRC_DIR=${python-qt}/include/PythonQt" + "PYTHONQT_SRC_DIR=${python-qt.src}" "PYTHONQT_LIB_DIR=${python-qt}/lib" "LIBS+=-L${python-qt}/lib" - "INCLUDEPATH+=${python-qt}/include/PythonQt" - "INCLUDEPATH+=${python}/include/python${python.pythonVersion}" "INSTALL_DIR=${placeholder "out"}" "SHARE_DIR=${placeholder "out"}/share" + "PYTHON_DIR=${python3}" + "PYTHON_VERSION=3.${python3.sourceVersion.minor}" ]; meta = with lib; { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f9d2874e68e7..8b7405dad54e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30348,9 +30348,7 @@ with pkgs; csound-manual = callPackage ../applications/audio/csound/csound-manual { }; - csound-qt = libsForQt5.callPackage ../applications/audio/csound/csound-qt { - python = python3; - }; + csound-qt = libsForQt5.callPackage ../applications/audio/csound/csound-qt { }; codeblocks = callPackage ../applications/editors/codeblocks { }; codeblocksFull = codeblocks.override { contribPlugins = true; }; From d338ea8382164334ce48d41a7f36e7bee0cd1ad4 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 16 Apr 2024 08:30:09 +0200 Subject: [PATCH 4/9] python-qt: clean --- .../libraries/python-qt/default.nix | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/python-qt/default.nix b/pkgs/development/libraries/python-qt/default.nix index 7b48739a8189..34af8281ba81 100644 --- a/pkgs/development/libraries/python-qt/default.nix +++ b/pkgs/development/libraries/python-qt/default.nix @@ -1,6 +1,14 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, python3, qmake, - qtwebengine, qtxmlpatterns, - qttools, unzip }: +{ + lib, + stdenv, + fetchFromGitHub, + fetchpatch, + python3, + qmake, + qtwebengine, + qtxmlpatterns, + qttools, +}: stdenv.mkDerivation (finalAttrs: { pname = "python-qt"; @@ -14,6 +22,7 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ + # fix a -Werror=format-security. was merged upstream, so can be removed on next release. (fetchpatch { name = "fix-format-security.patch"; url = "https://github.com/MeVisLab/pythonqt/pull/197/commits/c35d1efd00b83e0ebd826d7ed8454f3684ddffff.patch"; @@ -21,7 +30,12 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - nativeBuildInputs = [ qmake qtwebengine qtxmlpatterns qttools unzip ]; + nativeBuildInputs = [ + qmake + qttools + qtxmlpatterns + qtwebengine + ]; buildInputs = [ python3 ]; @@ -32,8 +46,6 @@ stdenv.mkDerivation (finalAttrs: { dontWrapQtApps = true; - unpackCmd = "unzip $src"; - installPhase = '' mkdir -p $out/include/PythonQt cp -r ./lib $out From 7246b5035cfabc26b9fa7fb9eaad94527457311a Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 16 Apr 2024 09:35:52 +0200 Subject: [PATCH 5/9] python-qt: switch to libsForQt5.callPackage --- pkgs/top-level/all-packages.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8b7405dad54e..dd13393cf3f3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24095,9 +24095,7 @@ with pkgs; pylode = callPackage ../misc/pylode { }; - python-qt = callPackage ../development/libraries/python-qt { - inherit (qt5) qmake qttools qtwebengine qtxmlpatterns; - }; + python-qt = libsForQt5.callPackage ../development/libraries/python-qt { }; pyotherside = libsForQt5.callPackage ../development/libraries/pyotherside { }; From a69334e5ad3b90ccd3ce009e5e088e33827e874a Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 16 Apr 2024 11:58:34 +0200 Subject: [PATCH 6/9] python-qt: fix for darwin --- pkgs/development/libraries/python-qt/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/libraries/python-qt/default.nix b/pkgs/development/libraries/python-qt/default.nix index 34af8281ba81..e17136b47a50 100644 --- a/pkgs/development/libraries/python-qt/default.nix +++ b/pkgs/development/libraries/python-qt/default.nix @@ -28,6 +28,12 @@ stdenv.mkDerivation (finalAttrs: { url = "https://github.com/MeVisLab/pythonqt/pull/197/commits/c35d1efd00b83e0ebd826d7ed8454f3684ddffff.patch"; hash = "sha256-WJBLPdMemuKlZWoqYVU9TXldoDpaBm84RxkepIaocUQ="; }) + # same for darwin. not yet merged upstream. + (fetchpatch { + name = "fix-format-security-darwin.patch"; + url = "https://github.com/MeVisLab/pythonqt/pull/207/commits/4d5a742bccdc4e98ad862f028b96debe4c195906.patch"; + hash = "sha256-u3aDi9ncv7CuKYrz5JC1s1Xjy4d9z07mEqQmobtdzKU="; + }) ]; nativeBuildInputs = [ From 54b90c14cba77dd22a1b980a1d8e33a2c4dbfd52 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 16 Apr 2024 12:58:35 +0200 Subject: [PATCH 7/9] python-qt: prefix lib with $out on darwin --- pkgs/development/libraries/python-qt/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/libraries/python-qt/default.nix b/pkgs/development/libraries/python-qt/default.nix index e17136b47a50..43cf3254fc7d 100644 --- a/pkgs/development/libraries/python-qt/default.nix +++ b/pkgs/development/libraries/python-qt/default.nix @@ -60,6 +60,15 @@ stdenv.mkDerivation (finalAttrs: { cp -r ./extensions $out/include/PythonQt ''; + postFixup = lib.optionalString stdenv.isDarwin '' + install_name_tool -id \ + $out/lib/libPythonQt-Qt5-Python3.${python3.sourceVersion.minor}.dylib \ + $out/lib/libPythonQt-Qt5-Python3.${python3.sourceVersion.minor}.dylib + install_name_tool -id \ + $out/lib/libPythonQt_QtAll-Qt5-Python3.${python3.sourceVersion.minor}.dylib \ + $out/lib/libPythonQt_QtAll-Qt5-Python3.${python3.sourceVersion.minor}.dylib + ''; + meta = with lib; { description = "PythonQt is a dynamic Python binding for the Qt framework. It offers an easy way to embed the Python scripting language into your C++ Qt applications"; homepage = "https://pythonqt.sourceforge.net/"; From 23df3266c9a42e990229852b4695f0ed9cf941c4 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 16 Apr 2024 20:15:29 +0200 Subject: [PATCH 8/9] python-qt: fix code signing on darwin --- pkgs/development/libraries/python-qt/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/python-qt/default.nix b/pkgs/development/libraries/python-qt/default.nix index 43cf3254fc7d..7fa35a5b09ef 100644 --- a/pkgs/development/libraries/python-qt/default.nix +++ b/pkgs/development/libraries/python-qt/default.nix @@ -60,7 +60,7 @@ stdenv.mkDerivation (finalAttrs: { cp -r ./extensions $out/include/PythonQt ''; - postFixup = lib.optionalString stdenv.isDarwin '' + preFixup = lib.optionalString stdenv.isDarwin '' install_name_tool -id \ $out/lib/libPythonQt-Qt5-Python3.${python3.sourceVersion.minor}.dylib \ $out/lib/libPythonQt-Qt5-Python3.${python3.sourceVersion.minor}.dylib From bcaf5dd0fba1a902aa1377971560d6fd82a427dd Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 21 Apr 2024 21:21:28 +0200 Subject: [PATCH 9/9] python-qt: 3.5.0 -> 3.5.1 --- .../libraries/python-qt/default.nix | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/pkgs/development/libraries/python-qt/default.nix b/pkgs/development/libraries/python-qt/default.nix index 7fa35a5b09ef..16c2124cf083 100644 --- a/pkgs/development/libraries/python-qt/default.nix +++ b/pkgs/development/libraries/python-qt/default.nix @@ -12,30 +12,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "python-qt"; - version = "3.5.0"; + version = "3.5.1"; src = fetchFromGitHub { owner = "MeVisLab"; repo = "pythonqt"; rev = "v${finalAttrs.version}"; - hash = "sha256-Yz7w5Gs0W3ilrZXjkC+wXLCCXWTKkhCpWXbg+PshXKI="; + hash = "sha256-IED6UFk8UTle7g/yPC0nXOEgJwrs6sB/Dk3OTyVgHPo="; }; - patches = [ - # fix a -Werror=format-security. was merged upstream, so can be removed on next release. - (fetchpatch { - name = "fix-format-security.patch"; - url = "https://github.com/MeVisLab/pythonqt/pull/197/commits/c35d1efd00b83e0ebd826d7ed8454f3684ddffff.patch"; - hash = "sha256-WJBLPdMemuKlZWoqYVU9TXldoDpaBm84RxkepIaocUQ="; - }) - # same for darwin. not yet merged upstream. - (fetchpatch { - name = "fix-format-security-darwin.patch"; - url = "https://github.com/MeVisLab/pythonqt/pull/207/commits/4d5a742bccdc4e98ad862f028b96debe4c195906.patch"; - hash = "sha256-u3aDi9ncv7CuKYrz5JC1s1Xjy4d9z07mEqQmobtdzKU="; - }) - ]; - nativeBuildInputs = [ qmake qttools