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/development/libraries/python-qt/default.nix b/pkgs/development/libraries/python-qt/default.nix index d238b8137d33..16c2124cf083 100644 --- a/pkgs/development/libraries/python-qt/default.nix +++ b/pkgs/development/libraries/python-qt/default.nix @@ -1,39 +1,42 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, python, qmake, - qtwebengine, qtxmlpatterns, - qttools, unzip }: +{ + lib, + stdenv, + fetchFromGitHub, + fetchpatch, + python3, + qmake, + qtwebengine, + qtxmlpatterns, + qttools, +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "python-qt"; - version = "3.4.2"; + version = "3.5.1"; src = fetchFromGitHub { owner = "MeVisLab"; repo = "pythonqt"; - rev = "v${version}"; - hash = "sha256-xJYOD07ACOKtY3psmfHNSCjm6t0fr8JU9CrL0w5P5G0="; + rev = "v${finalAttrs.version}"; + hash = "sha256-IED6UFk8UTle7g/yPC0nXOEgJwrs6sB/Dk3OTyVgHPo="; }; - # https://github.com/CsoundQt/CsoundQt/blob/develop/BUILDING.md#pythonqt - postPatch = '' - substituteInPlace build/python.prf \ - --replace "PYTHON_VERSION=2.7" "PYTHON_VERSION=${python.pythonVersion}" - ''; + nativeBuildInputs = [ + qmake + qttools + qtxmlpatterns + qtwebengine + ]; - hardeningDisable = [ "all" ]; - - 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; - unpackCmd = "unzip $src"; - installPhase = '' mkdir -p $out/include/PythonQt cp -r ./lib $out @@ -42,6 +45,15 @@ stdenv.mkDerivation rec { cp -r ./extensions $out/include/PythonQt ''; + 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 + 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/"; @@ -49,4 +61,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 dc83c7246644..9c0846d71df7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24071,16 +24071,7 @@ with pkgs; pylode = callPackage ../misc/pylode { }; - python-qt = (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; }; - }); + python-qt = libsForQt5.callPackage ../development/libraries/python-qt { }; pyotherside = libsForQt5.callPackage ../development/libraries/pyotherside { }; @@ -30344,9 +30335,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; };