From 9604890e7228b5e389e28a53cbbb31a9b4a27bb6 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Mon, 10 Apr 2023 17:33:39 +0800 Subject: [PATCH 1/6] qt6: use callPackage in all-packages.nix --- pkgs/development/libraries/qt-6/default.nix | 8 ++------ pkgs/top-level/all-packages.nix | 9 ++------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pkgs/development/libraries/qt-6/default.nix b/pkgs/development/libraries/qt-6/default.nix index f0cfc91ac014..20fd5e70c20f 100644 --- a/pkgs/development/libraries/qt-6/default.nix +++ b/pkgs/development/libraries/qt-6/default.nix @@ -15,11 +15,7 @@ , cmake , ninja , writeText -, gstreamer -, gst-plugins-base -, gst-plugins-good -, gst-libav -, gst-vaapi +, gst_all_1 , gtk3 , dconf , libglvnd @@ -111,7 +107,7 @@ let qtlanguageserver = callPackage ./modules/qtlanguageserver.nix { }; qtlottie = callPackage ./modules/qtlottie.nix { }; qtmultimedia = callPackage ./modules/qtmultimedia.nix { - inherit gstreamer gst-plugins-base gst-plugins-good gst-libav gst-vaapi; + inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-good gst-libav gst-vaapi; inherit (darwin.apple_sdk_11_0.frameworks) VideoToolbox; }; qtnetworkauth = callPackage ./modules/qtnetworkauth.nix { }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1f0487330181..033486a28c6e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23216,13 +23216,8 @@ with pkgs; qtEnv = qt5.env; qt5Full = qt5.full; - qt6 = recurseIntoAttrs (makeOverridable - (import ../development/libraries/qt-6) { - inherit newScope; - inherit lib fetchurl fetchpatch fetchgit fetchFromGitHub makeSetupHook makeWrapper writeText; - inherit bison cups dconf harfbuzz libGL perl gtk3 ninja; - inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-good gst-libav gst-vaapi; - inherit darwin buildPackages libglvnd; + qt6 = recurseIntoAttrs + (callPackage ../development/libraries/qt-6 { stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; cmake = cmake.overrideAttrs (attrs: { patches = attrs.patches ++ [ From 845e491205297c02d3cf25702f2762ced9b30c55 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Mon, 10 Apr 2023 17:50:44 +0800 Subject: [PATCH 2/6] qt6.qtModules: use callPackage --- pkgs/development/libraries/qt-6/default.nix | 11 ++++------- pkgs/development/libraries/qt-6/qtModule.nix | 4 +--- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/qt-6/default.nix b/pkgs/development/libraries/qt-6/default.nix index 20fd5e70c20f..4fcca3fd7b9f 100644 --- a/pkgs/development/libraries/qt-6/default.nix +++ b/pkgs/development/libraries/qt-6/default.nix @@ -33,18 +33,15 @@ let mirror = "mirror://qt"; }; - qtModule = - import ./qtModule.nix - { inherit stdenv lib perl cmake ninja writeText; } - { inherit self srcs; }; - addPackages = self: with self; let - callPackage = self.newScope ({ inherit qtModule stdenv srcs; }); + callPackage = self.newScope ({ inherit qtModule stdenv srcs cmake; }); in { - inherit callPackage qtModule srcs; + inherit callPackage srcs; + + qtModule = callPackage ./qtModule.nix { inherit self; }; qtbase = callPackage ./modules/qtbase.nix { withGtk3 = true; diff --git a/pkgs/development/libraries/qt-6/qtModule.nix b/pkgs/development/libraries/qt-6/qtModule.nix index 28180d3b0ca3..896455cbb27a 100644 --- a/pkgs/development/libraries/qt-6/qtModule.nix +++ b/pkgs/development/libraries/qt-6/qtModule.nix @@ -1,6 +1,4 @@ -{ stdenv, lib, perl, cmake, ninja, writeText }: - -{ self, srcs, patches ? [ ] }: +{ stdenv, lib, perl, cmake, ninja, writeText, self, srcs, patches ? [ ] }: args: From 12cfa69c8e1509d17280028b5ef43e7beafbe4d0 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Mon, 10 Apr 2023 17:53:27 +0800 Subject: [PATCH 3/6] qt6: move stdenv and cmake override to within pkgs/development/libraries/qt-6 --- pkgs/development/libraries/qt-6/default.nix | 12 ++++++++++-- pkgs/top-level/all-packages.nix | 10 +--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/development/libraries/qt-6/default.nix b/pkgs/development/libraries/qt-6/default.nix index 4fcca3fd7b9f..a6baef108753 100644 --- a/pkgs/development/libraries/qt-6/default.nix +++ b/pkgs/development/libraries/qt-6/default.nix @@ -35,7 +35,15 @@ let addPackages = self: with self; let - callPackage = self.newScope ({ inherit qtModule stdenv srcs cmake; }); + callPackage = self.newScope ({ + inherit qtModule srcs; + stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; + cmake = cmake.overrideAttrs (attrs: { + patches = attrs.patches ++ [ + ./patches/cmake.patch + ]; + }); + }); in { @@ -46,7 +54,7 @@ let qtbase = callPackage ./modules/qtbase.nix { withGtk3 = true; inherit (srcs.qtbase) src version; - inherit bison cups harfbuzz libGL dconf gtk3 developerBuild cmake; + inherit bison cups harfbuzz libGL dconf gtk3 developerBuild; inherit (darwin.apple_sdk_11_0.frameworks) AGL AVFoundation AppKit GSS MetalKit; patches = [ ./patches/qtbase-qmake-mkspecs-mac.patch diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 033486a28c6e..332cd76b290d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23216,15 +23216,7 @@ with pkgs; qtEnv = qt5.env; qt5Full = qt5.full; - qt6 = recurseIntoAttrs - (callPackage ../development/libraries/qt-6 { - stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; - cmake = cmake.overrideAttrs (attrs: { - patches = attrs.patches ++ [ - ../development/libraries/qt-6/patches/cmake.patch - ]; - }); - }); + qt6 = recurseIntoAttrs (callPackage ../development/libraries/qt-6 { }); qt6Packages = recurseIntoAttrs (import ./qt6-packages.nix { inherit lib pkgs qt6; From 8a159fe975718331d07036219a5553b206459f9a Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Mon, 10 Apr 2023 17:56:35 +0800 Subject: [PATCH 4/6] qt6.qtbase: removed unnecessary callPackage arguments --- pkgs/development/libraries/qt-6/default.nix | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/pkgs/development/libraries/qt-6/default.nix b/pkgs/development/libraries/qt-6/default.nix index a6baef108753..4a62234ddd93 100644 --- a/pkgs/development/libraries/qt-6/default.nix +++ b/pkgs/development/libraries/qt-6/default.nix @@ -2,22 +2,11 @@ , lib , stdenv , fetchurl -, fetchgit , fetchpatch -, fetchFromGitHub , makeSetupHook , makeWrapper -, bison -, cups -, harfbuzz -, libGL -, perl , cmake -, ninja -, writeText , gst_all_1 -, gtk3 -, dconf , libglvnd , darwin , buildPackages @@ -54,7 +43,7 @@ let qtbase = callPackage ./modules/qtbase.nix { withGtk3 = true; inherit (srcs.qtbase) src version; - inherit bison cups harfbuzz libGL dconf gtk3 developerBuild; + inherit developerBuild; inherit (darwin.apple_sdk_11_0.frameworks) AGL AVFoundation AppKit GSS MetalKit; patches = [ ./patches/qtbase-qmake-mkspecs-mac.patch From 5d13961fd6516f3b2a8486c6e206c6fe1e8881ef Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Mon, 10 Apr 2023 17:57:50 +0800 Subject: [PATCH 5/6] qt6: format pkgs/development/libraries/qt-6/default.nix --- pkgs/development/libraries/qt-6/default.nix | 26 +++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/pkgs/development/libraries/qt-6/default.nix b/pkgs/development/libraries/qt-6/default.nix index 4a62234ddd93..9346bc56099e 100644 --- a/pkgs/development/libraries/qt-6/default.nix +++ b/pkgs/development/libraries/qt-6/default.nix @@ -58,7 +58,7 @@ let }) ]; }; - env = callPackage ./qt-env.nix {}; + env = callPackage ./qt-env.nix { }; full = env "qt-full-${qtbase.version}" ([ qt3d qt5compat @@ -130,19 +130,21 @@ let inherit (darwin.apple_sdk_11_0.frameworks) WebKit; }; - wrapQtAppsHook = makeSetupHook { - name = "wrap-qt6-apps-hook"; - propagatedBuildInputs = [ buildPackages.makeWrapper ]; + wrapQtAppsHook = makeSetupHook + { + name = "wrap-qt6-apps-hook"; + propagatedBuildInputs = [ buildPackages.makeWrapper ]; } ./hooks/wrap-qt-apps-hook.sh; - qmake = makeSetupHook { - name = "qmake6-hook"; - propagatedBuildInputs = [ self.qtbase.dev ]; - substitutions = { - inherit debug; - fix_qmake_libtool = ./hooks/fix-qmake-libtool.sh; - }; - } ./hooks/qmake-hook.sh; + qmake = makeSetupHook + { + name = "qmake6-hook"; + propagatedBuildInputs = [ self.qtbase.dev ]; + substitutions = { + inherit debug; + fix_qmake_libtool = ./hooks/fix-qmake-libtool.sh; + }; + } ./hooks/qmake-hook.sh; }; # TODO(@Artturin): convert to makeScopeWithSplicing From c14e333ec0835692e35a7335be88a57be9bacd05 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Mon, 10 Apr 2023 18:00:35 +0800 Subject: [PATCH 6/6] qt6.qtModule: removed unnecessary callPackage arguments --- pkgs/development/libraries/qt-6/default.nix | 2 +- pkgs/development/libraries/qt-6/qtModule.nix | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/qt-6/default.nix b/pkgs/development/libraries/qt-6/default.nix index 9346bc56099e..d790ecafbf4d 100644 --- a/pkgs/development/libraries/qt-6/default.nix +++ b/pkgs/development/libraries/qt-6/default.nix @@ -38,7 +38,7 @@ let inherit callPackage srcs; - qtModule = callPackage ./qtModule.nix { inherit self; }; + qtModule = callPackage ./qtModule.nix { }; qtbase = callPackage ./modules/qtbase.nix { withGtk3 = true; diff --git a/pkgs/development/libraries/qt-6/qtModule.nix b/pkgs/development/libraries/qt-6/qtModule.nix index 896455cbb27a..4a149108e077 100644 --- a/pkgs/development/libraries/qt-6/qtModule.nix +++ b/pkgs/development/libraries/qt-6/qtModule.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, perl, cmake, ninja, writeText, self, srcs, patches ? [ ] }: +{ stdenv, lib, perl, cmake, ninja, writeText, qtbase, qmake, srcs, patches ? [ ] }: args: @@ -16,7 +16,7 @@ stdenv.mkDerivation (args // { perl cmake ninja - self.qmake + qmake ]; propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or [ ]); @@ -59,7 +59,7 @@ stdenv.mkDerivation (args // { if [[ -z "$dontSyncQt" && -f sync.profile ]]; then # FIXME: this probably breaks crosscompiling as it's not from nativeBuildInputs # I don't know how to get /libexec from nativeBuildInputs to work, it's not under /bin - ${lib.getDev self.qtbase}/libexec/syncqt.pl -version "''${version%%-*}" + ${lib.getDev qtbase}/libexec/syncqt.pl -version "''${version%%-*}" fi '';