nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 newScope,
3 lib,
4 stdenv,
5 generateSplicesForMkScope,
6 makeScopeWithSplicing',
7 fetchurl,
8 fetchpatch2,
9 makeSetupHook,
10 makeWrapper,
11 runCommand,
12 gst_all_1,
13 libglvnd,
14 darwin,
15 apple-sdk_15,
16 darwinMinVersionHook,
17 buildPackages,
18 python3,
19 config,
20}:
21
22let
23 srcs = import ./srcs.nix {
24 inherit fetchurl;
25 mirror = "mirror://qt";
26 };
27
28 addPackages =
29 self:
30 let
31 callPackage = self.newScope {
32 inherit (self) qtModule;
33 inherit srcs python3 stdenv;
34 };
35
36 # Per <https://doc.qt.io/qt-6/macos.html#supported-versions>.
37 # This should reflect the highest “Build Environment” and the
38 # lowest “Target Platform”.
39 darwinVersionInputs = [
40 apple-sdk_15
41 (darwinMinVersionHook "12.0")
42 ];
43
44 onlyPluginsAndQml =
45 drv:
46 let
47 drv' = drv.__spliced.targetTarget or drv;
48 inherit (self.qtbase) qtPluginPrefix qtQmlPrefix;
49 in
50 (runCommand "${drv'.name}-only-plugins-qml" { } ''
51 mkdir -p $(dirname "$out/${qtPluginPrefix}")
52 test -d "${drv'}/${qtPluginPrefix}" && ln -s "${drv'}/${qtPluginPrefix}" "$out/${qtPluginPrefix}" || true
53 test -d "${drv'}/${qtQmlPrefix}" && ln -s "${drv'}/${qtQmlPrefix}" "$out/${qtQmlPrefix}" || true
54 '');
55 in
56 {
57
58 inherit callPackage srcs darwinVersionInputs;
59
60 qtModule = callPackage ./qtModule.nix {
61 inherit darwinVersionInputs;
62 };
63
64 qtbase = callPackage ./modules/qtbase {
65 withGtk3 = !stdenv.hostPlatform.isMinGW;
66 inherit darwinVersionInputs;
67 inherit (srcs.qtbase) src version;
68 };
69 env = callPackage ./qt-env.nix { };
70 qt3d = callPackage ./modules/qt3d.nix { };
71 qt5compat = callPackage ./modules/qt5compat.nix { };
72 qtcharts = callPackage ./modules/qtcharts.nix { };
73 qtconnectivity = callPackage ./modules/qtconnectivity.nix { };
74 qtdatavis3d = callPackage ./modules/qtdatavis3d.nix { };
75 qtdeclarative = callPackage ./modules/qtdeclarative { };
76 qtdoc = callPackage ./modules/qtdoc.nix { };
77 qtgraphs = callPackage ./modules/qtgraphs.nix { };
78 qtgrpc = callPackage ./modules/qtgrpc.nix { };
79 qthttpserver = callPackage ./modules/qthttpserver.nix { };
80 qtimageformats = callPackage ./modules/qtimageformats.nix { };
81 qtlanguageserver = callPackage ./modules/qtlanguageserver.nix { };
82 qtlocation = callPackage ./modules/qtlocation.nix { };
83 qtlottie = callPackage ./modules/qtlottie.nix { };
84 qtmultimedia = callPackage ./modules/qtmultimedia {
85 inherit (gst_all_1)
86 gstreamer
87 gst-plugins-bad
88 gst-plugins-base
89 gst-plugins-good
90 gst-libav
91 gst-vaapi
92 ;
93 };
94 qtmqtt = callPackage ./modules/qtmqtt.nix { };
95 qtnetworkauth = callPackage ./modules/qtnetworkauth.nix { };
96 qtpositioning = callPackage ./modules/qtpositioning.nix { };
97 qtsensors = callPackage ./modules/qtsensors.nix { };
98 qtserialbus = callPackage ./modules/qtserialbus.nix { };
99 qtserialport = callPackage ./modules/qtserialport.nix { };
100 qtshadertools = callPackage ./modules/qtshadertools.nix { };
101 qtspeech = callPackage ./modules/qtspeech.nix { };
102 qtquick3d = callPackage ./modules/qtquick3d.nix { };
103 qtquick3dphysics = callPackage ./modules/qtquick3dphysics.nix { };
104 qtquickeffectmaker = callPackage ./modules/qtquickeffectmaker.nix { };
105 qtquicktimeline = callPackage ./modules/qtquicktimeline.nix { };
106 qtremoteobjects = callPackage ./modules/qtremoteobjects.nix { };
107 qtsvg = callPackage ./modules/qtsvg.nix { };
108 qtscxml = callPackage ./modules/qtscxml.nix { };
109 qttools = callPackage ./modules/qttools { };
110 qttranslations = callPackage ./modules/qttranslations.nix {
111 qttools = self.qttools.override {
112 qtbase = self.qtbase.override { qttranslations = null; };
113 qtdeclarative = null;
114 };
115 };
116 qtvirtualkeyboard = callPackage ./modules/qtvirtualkeyboard.nix { };
117 qtwayland = callPackage ./modules/qtwayland.nix { };
118 qtwebchannel = callPackage ./modules/qtwebchannel.nix { };
119 qtwebengine = callPackage ./modules/qtwebengine {
120 inherit (darwin) bootstrap_cmds;
121 };
122 qtwebsockets = callPackage ./modules/qtwebsockets.nix { };
123 qtwebview = callPackage ./modules/qtwebview.nix { };
124
125 wrapQtAppsHook = callPackage (
126 {
127 makeBinaryWrapper,
128 qtwayland,
129 qtbase,
130 }:
131 makeSetupHook {
132 name = "wrap-qt6-apps-hook";
133 propagatedBuildInputs = [ makeBinaryWrapper ];
134 depsTargetTargetPropagated = [
135 (onlyPluginsAndQml qtbase)
136 ];
137 } ./hooks/wrap-qt-apps-hook.sh
138 ) { };
139
140 qmake = callPackage (
141 { qtbase }:
142 makeSetupHook {
143 name = "qmake6-hook";
144 propagatedBuildInputs = [ qtbase.dev ];
145 substitutions = {
146 fix_qmake_libtool = ./hooks/fix-qmake-libtool.sh;
147 };
148 } ./hooks/qmake-hook.sh
149 ) { };
150 }
151 // lib.optionalAttrs config.allowAliases {
152 full = throw "qt6.full has been removed. Please use individual packages instead."; # Added 2025-10-21
153 wrapQtAppsNoGuiHook = lib.warn "wrapQtAppsNoGuiHook is deprecated, use wrapQtAppsHook instead" self.wrapQtAppsHook;
154 };
155
156 baseScope = makeScopeWithSplicing' {
157 otherSplices = generateSplicesForMkScope "qt6";
158 f = addPackages;
159 };
160in
161baseScope