graphene-hardened-malloc: 2024123000 -> 2025012700 (#378307)
[NixPkgs.git] / pkgs / development / libraries / qt-6 / default.nix
blob578137a3f3ecf7ac2f51edab2c35220cb9ac4352
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,
22 let
23   srcs = import ./srcs.nix {
24     inherit fetchurl;
25     mirror = "mirror://qt";
26   };
28   addPackages =
29     self:
30     let
31       callPackage = self.newScope ({
32         inherit (self) qtModule;
33         inherit srcs python3 stdenv;
34       });
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       ];
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     {
58       inherit callPackage srcs darwinVersionInputs;
60       qtModule = callPackage ./qtModule.nix {
61         inherit darwinVersionInputs;
62       };
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       full = callPackage (
71         { env, qtbase }:
72         env "qt-full-${qtbase.version}"
73           # `with self` is ok to use here because having these spliced is unnecessary
74           (
75             with self;
76             [
77               qt3d
78               qt5compat
79               qtcharts
80               qtconnectivity
81               qtdatavis3d
82               qtdeclarative
83               qtdoc
84               qtgraphs
85               qtgrpc
86               qthttpserver
87               qtimageformats
88               qtlanguageserver
89               qtlocation
90               qtlottie
91               qtmultimedia
92               qtmqtt
93               qtnetworkauth
94               qtpositioning
95               qtsensors
96               qtserialbus
97               qtserialport
98               qtshadertools
99               qtspeech
100               qtquick3d
101               qtquick3dphysics
102               qtquickeffectmaker
103               qtquicktimeline
104               qtremoteobjects
105               qtsvg
106               qtscxml
107               qttools
108               qttranslations
109               qtvirtualkeyboard
110               qtwebchannel
111               qtwebengine
112               qtwebsockets
113               qtwebview
114             ]
115             ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
116               qtwayland
117               libglvnd
118             ]
119           )
120       ) { };
122       qt3d = callPackage ./modules/qt3d.nix { };
123       qt5compat = callPackage ./modules/qt5compat.nix { };
124       qtcharts = callPackage ./modules/qtcharts.nix { };
125       qtconnectivity = callPackage ./modules/qtconnectivity.nix { };
126       qtdatavis3d = callPackage ./modules/qtdatavis3d.nix { };
127       qtdeclarative = callPackage ./modules/qtdeclarative { };
128       qtdoc = callPackage ./modules/qtdoc.nix { };
129       qtgraphs = callPackage ./modules/qtgraphs.nix { };
130       qtgrpc = callPackage ./modules/qtgrpc.nix { };
131       qthttpserver = callPackage ./modules/qthttpserver.nix { };
132       qtimageformats = callPackage ./modules/qtimageformats.nix { };
133       qtlanguageserver = callPackage ./modules/qtlanguageserver.nix { };
134       qtlocation = callPackage ./modules/qtlocation.nix { };
135       qtlottie = callPackage ./modules/qtlottie.nix { };
136       qtmultimedia = callPackage ./modules/qtmultimedia {
137         inherit (gst_all_1)
138           gstreamer
139           gst-plugins-bad
140           gst-plugins-base
141           gst-plugins-good
142           gst-libav
143           gst-vaapi
144           ;
145       };
146       qtmqtt = callPackage ./modules/qtmqtt.nix { };
147       qtnetworkauth = callPackage ./modules/qtnetworkauth.nix { };
148       qtpositioning = callPackage ./modules/qtpositioning.nix { };
149       qtsensors = callPackage ./modules/qtsensors.nix { };
150       qtserialbus = callPackage ./modules/qtserialbus.nix { };
151       qtserialport = callPackage ./modules/qtserialport.nix { };
152       qtshadertools = callPackage ./modules/qtshadertools.nix { };
153       qtspeech = callPackage ./modules/qtspeech.nix { };
154       qtquick3d = callPackage ./modules/qtquick3d.nix { };
155       qtquick3dphysics = callPackage ./modules/qtquick3dphysics.nix { };
156       qtquickeffectmaker = callPackage ./modules/qtquickeffectmaker.nix { };
157       qtquicktimeline = callPackage ./modules/qtquicktimeline.nix { };
158       qtremoteobjects = callPackage ./modules/qtremoteobjects.nix { };
159       qtsvg = callPackage ./modules/qtsvg.nix { };
160       qtscxml = callPackage ./modules/qtscxml.nix { };
161       qttools = callPackage ./modules/qttools { };
162       qttranslations = callPackage ./modules/qttranslations.nix { };
163       qtvirtualkeyboard = callPackage ./modules/qtvirtualkeyboard.nix { };
164       qtwayland = callPackage ./modules/qtwayland.nix { };
165       qtwebchannel = callPackage ./modules/qtwebchannel.nix { };
166       qtwebengine = callPackage ./modules/qtwebengine {
167         inherit (darwin) bootstrap_cmds;
168       };
169       qtwebsockets = callPackage ./modules/qtwebsockets.nix { };
170       qtwebview = callPackage ./modules/qtwebview.nix { };
172       wrapQtAppsHook = callPackage (
173         {
174           makeBinaryWrapper,
175           qtwayland,
176           qtbase,
177         }:
178         makeSetupHook {
179           name = "wrap-qt6-apps-hook";
180           propagatedBuildInputs = [ makeBinaryWrapper ];
181           depsTargetTargetPropagated =
182             [
183               (onlyPluginsAndQml qtbase)
184             ]
185             ++ lib.optionals (lib.meta.availableOn stdenv.targetPlatform qtwayland) [
186               (onlyPluginsAndQml qtwayland)
187             ];
188         } ./hooks/wrap-qt-apps-hook.sh
189       ) { };
191       wrapQtAppsNoGuiHook = callPackage (
192         { makeBinaryWrapper, qtbase }:
193         makeSetupHook {
194           name = "wrap-qt6-apps-no-gui-hook";
195           propagatedBuildInputs = [ makeBinaryWrapper ];
196           depsTargetTargetPropagated = [
197             (onlyPluginsAndQml qtbase)
198           ];
199         } ./hooks/wrap-qt-apps-hook.sh
200       ) { };
202       qmake = callPackage (
203         { qtbase }:
204         makeSetupHook {
205           name = "qmake6-hook";
206           propagatedBuildInputs = [ qtbase.dev ];
207           substitutions = {
208             fix_qmake_libtool = ./hooks/fix-qmake-libtool.sh;
209           };
210         } ./hooks/qmake-hook.sh
211       ) { };
212     };
214   baseScope = makeScopeWithSplicing' {
215     otherSplices = generateSplicesForMkScope "qt6";
216     f = addPackages;
217   };
219   bootstrapScope = baseScope.overrideScope (
220     final: prev: {
221       qtbase = prev.qtbase.override { qttranslations = null; };
222       qtdeclarative = null;
223     }
224   );
226   finalScope = baseScope.overrideScope (
227     final: prev: {
228       qttranslations = bootstrapScope.qttranslations;
229     }
230   );
232 finalScope