lol

Merge pull request #225555 from NickCao/qt6-cleanup

qt6: general cleanup to ease future reworking of packaging

authored by

Nick Cao and committed by
GitHub
528dd7fa f5d4f9cc

+33 -56
+29 -37
pkgs/development/libraries/qt-6/default.nix
··· 2 2 , lib 3 3 , stdenv 4 4 , fetchurl 5 - , fetchgit 6 5 , fetchpatch 7 - , fetchFromGitHub 8 6 , makeSetupHook 9 7 , makeWrapper 10 - , bison 11 - , cups 12 - , harfbuzz 13 - , libGL 14 - , perl 15 8 , cmake 16 - , ninja 17 - , writeText 18 - , gstreamer 19 - , gst-plugins-base 20 - , gst-plugins-good 21 - , gst-libav 22 - , gst-vaapi 23 - , gtk3 24 - , dconf 9 + , gst_all_1 25 10 , libglvnd 26 11 , darwin 27 12 , buildPackages ··· 37 22 mirror = "mirror://qt"; 38 23 }; 39 24 40 - qtModule = 41 - import ./qtModule.nix 42 - { inherit stdenv lib perl cmake ninja writeText; } 43 - { inherit self srcs; }; 44 - 45 25 addPackages = self: with self; 46 26 let 47 - callPackage = self.newScope ({ inherit qtModule stdenv srcs; }); 27 + callPackage = self.newScope ({ 28 + inherit qtModule srcs; 29 + stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; 30 + cmake = cmake.overrideAttrs (attrs: { 31 + patches = attrs.patches ++ [ 32 + ./patches/cmake.patch 33 + ]; 34 + }); 35 + }); 48 36 in 49 37 { 50 38 51 - inherit callPackage qtModule srcs; 39 + inherit callPackage srcs; 40 + 41 + qtModule = callPackage ./qtModule.nix { }; 52 42 53 43 qtbase = callPackage ./modules/qtbase.nix { 54 44 withGtk3 = true; 55 45 inherit (srcs.qtbase) src version; 56 - inherit bison cups harfbuzz libGL dconf gtk3 developerBuild cmake; 46 + inherit developerBuild; 57 47 inherit (darwin.apple_sdk_11_0.frameworks) AGL AVFoundation AppKit GSS MetalKit; 58 48 patches = [ 59 49 ./patches/qtbase-qmake-mkspecs-mac.patch ··· 68 58 }) 69 59 ]; 70 60 }; 71 - env = callPackage ./qt-env.nix {}; 61 + env = callPackage ./qt-env.nix { }; 72 62 full = env "qt-full-${qtbase.version}" ([ 73 63 qt3d 74 64 qt5compat ··· 111 101 qtlanguageserver = callPackage ./modules/qtlanguageserver.nix { }; 112 102 qtlottie = callPackage ./modules/qtlottie.nix { }; 113 103 qtmultimedia = callPackage ./modules/qtmultimedia.nix { 114 - inherit gstreamer gst-plugins-base gst-plugins-good gst-libav gst-vaapi; 104 + inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-good gst-libav gst-vaapi; 115 105 inherit (darwin.apple_sdk_11_0.frameworks) VideoToolbox; 116 106 }; 117 107 qtnetworkauth = callPackage ./modules/qtnetworkauth.nix { }; ··· 140 130 inherit (darwin.apple_sdk_11_0.frameworks) WebKit; 141 131 }; 142 132 143 - wrapQtAppsHook = makeSetupHook { 144 - name = "wrap-qt6-apps-hook"; 145 - propagatedBuildInputs = [ buildPackages.makeWrapper ]; 133 + wrapQtAppsHook = makeSetupHook 134 + { 135 + name = "wrap-qt6-apps-hook"; 136 + propagatedBuildInputs = [ buildPackages.makeWrapper ]; 146 137 } ./hooks/wrap-qt-apps-hook.sh; 147 138 148 - qmake = makeSetupHook { 149 - name = "qmake6-hook"; 150 - propagatedBuildInputs = [ self.qtbase.dev ]; 151 - substitutions = { 152 - inherit debug; 153 - fix_qmake_libtool = ./hooks/fix-qmake-libtool.sh; 154 - }; 155 - } ./hooks/qmake-hook.sh; 139 + qmake = makeSetupHook 140 + { 141 + name = "qmake6-hook"; 142 + propagatedBuildInputs = [ self.qtbase.dev ]; 143 + substitutions = { 144 + inherit debug; 145 + fix_qmake_libtool = ./hooks/fix-qmake-libtool.sh; 146 + }; 147 + } ./hooks/qmake-hook.sh; 156 148 }; 157 149 158 150 # TODO(@Artturin): convert to makeScopeWithSplicing
+3 -5
pkgs/development/libraries/qt-6/qtModule.nix
··· 1 - { stdenv, lib, perl, cmake, ninja, writeText }: 2 - 3 - { self, srcs, patches ? [ ] }: 1 + { stdenv, lib, perl, cmake, ninja, writeText, qtbase, qmake, srcs, patches ? [ ] }: 4 2 5 3 args: 6 4 ··· 18 16 perl 19 17 cmake 20 18 ninja 21 - self.qmake 19 + qmake 22 20 ]; 23 21 propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or [ ]); 24 22 ··· 61 59 if [[ -z "$dontSyncQt" && -f sync.profile ]]; then 62 60 # FIXME: this probably breaks crosscompiling as it's not from nativeBuildInputs 63 61 # I don't know how to get /libexec from nativeBuildInputs to work, it's not under /bin 64 - ${lib.getDev self.qtbase}/libexec/syncqt.pl -version "''${version%%-*}" 62 + ${lib.getDev qtbase}/libexec/syncqt.pl -version "''${version%%-*}" 65 63 fi 66 64 ''; 67 65
+1 -14
pkgs/top-level/all-packages.nix
··· 23227 23227 qtEnv = qt5.env; 23228 23228 qt5Full = qt5.full; 23229 23229 23230 - qt6 = recurseIntoAttrs (makeOverridable 23231 - (import ../development/libraries/qt-6) { 23232 - inherit newScope; 23233 - inherit lib fetchurl fetchpatch fetchgit fetchFromGitHub makeSetupHook makeWrapper writeText; 23234 - inherit bison cups dconf harfbuzz libGL perl gtk3 ninja; 23235 - inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-good gst-libav gst-vaapi; 23236 - inherit darwin buildPackages libglvnd; 23237 - stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; 23238 - cmake = cmake.overrideAttrs (attrs: { 23239 - patches = attrs.patches ++ [ 23240 - ../development/libraries/qt-6/patches/cmake.patch 23241 - ]; 23242 - }); 23243 - }); 23230 + qt6 = recurseIntoAttrs (callPackage ../development/libraries/qt-6 { }); 23244 23231 23245 23232 qt6Packages = recurseIntoAttrs (import ./qt6-packages.nix { 23246 23233 inherit lib pkgs qt6;