4 Run `./fetch.sh` to update package sources from Git.
5 Check for any minor version changes.
9 makeScopeWithSplicing',
10 generateSplicesForMkScope,
35 developerBuild ? false,
36 decryptSslTraffic ? false,
43 srcs = import ./srcs.nix { inherit lib fetchgit fetchFromGitHub; };
45 qtCompatVersion = srcs.qtbase.version;
49 ./qtbase.patch.d/0003-qtbase-mkspecs.patch
50 ./qtbase.patch.d/0004-qtbase-replace-libdir.patch
51 ./qtbase.patch.d/0005-qtbase-cmake.patch
52 ./qtbase.patch.d/0006-qtbase-gtk3.patch
53 ./qtbase.patch.d/0007-qtbase-xcursor.patch
54 ./qtbase.patch.d/0008-qtbase-tzdir.patch
55 ./qtbase.patch.d/0009-qtbase-qtpluginpath.patch
56 ./qtbase.patch.d/0010-qtbase-assert.patch
57 ./qtbase.patch.d/0011-fix-header_module.patch
61 # prevent headaches from stale qmlcache data
62 ./qtdeclarative-default-disable-qmlcache.patch
63 # add version specific QML import path
64 ./qtdeclarative-qml-paths.patch
66 qtlocation = lib.optionals stdenv.cc.isClang [
67 # Fix build with Clang 16
69 url = "https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a.patch";
71 extraPrefix = "src/3rdparty/mapbox-gl-native/deps/boost/1.65.1/";
72 hash = "sha256-UEvIXzn387f9BAeBdhheStD/4M7en+rmqX8C6gstl6k=";
75 qtmultimedia = lib.optionals stdenv.hostPlatform.isDarwin [
76 # build patch for qtmultimedia with xcode 15
78 url = "https://raw.githubusercontent.com/Homebrew/formula-patches/3f509180/qt5/qt5-qtmultimedia-xcode15.patch";
80 hash = "sha256-HrEqfmm8WbapWgLM0L4AKW8168pwT2zYI8HOJruEPSs=";
84 ## Upstream patches after the Qt6 transition that apply without problems & fix bugs
86 # Fixes QList -> QSet conversion
88 url = "https://github.com/qt/qtpim/commit/f337e281e28904741a3b1ac23d15c3a83ef2bbc9.patch";
89 hash = "sha256-zlxD45JnbhIgdJxMmGxGMUBcQPcgzpu3s4bLX939jL0=";
91 # Fixes invalid syntax from a previous bad patch in tests
93 url = "https://github.com/qt/qtpim/commit/2aefdd8bd28a4decf9ef8381f5b255f39f1ee90c.patch";
94 hash = "sha256-mg93QF3hi50igw1/Ok7fEs9iCaN6co1+p2/5fQtxTmc=";
96 # Unit test account for QList index change
98 url = "https://github.com/qt/qtpim/commit/79b41af6a4117f5efb0298289e20c30b4d0b0b2e.patch";
99 hash = "sha256-u+cLl4lu6r2+j5GAiasqbB6/OZPz5A6GpSB33vd/VBg=";
101 # Remove invalid method overload which confuses the QML engine
103 url = "https://github.com/qt/qtpim/commit/5679a6141c76ae7d64c3acc8a87b1adb048289e0.patch";
104 hash = "sha256-z8f8kLhC9CqBOfGPL8W9KJq7MwALAAicXfRkHiQEVJ4=";
106 # Specify enum flag type properly in unit test
108 url = "https://github.com/qt/qtpim/commit/a43cc24e57db8d3c3939fa540d67da3294dcfc5c.patch";
109 hash = "sha256-SsYkxX6prxi8VRZr4az+wqawcRN8tR3UuIFswJL+3T4=";
111 # Update qHash methods to return size_t instead of uint
113 url = "https://github.com/qt/qtpim/commit/9c698155d82fc2b68a87c59d0443c33f9085b117.patch";
114 hash = "sha256-rb8D8taaglhQikYSAPrtLvazgIw8Nga/a9+J21k8gIo=";
116 # Mark virtual methods with override keyword
118 url = "https://github.com/qt/qtpim/commit/f34cf2ff2b0f428d5b8a70763b29088075ebbd1c.patch";
119 hash = "sha256-tNPOEVpx1eqHx5T23ueW32KxMQ/SB+TBCJ4PZ6SA3LI=";
121 # Fix calendardemo example
123 url = "https://github.com/qt/qtpim/commit/a66590d473753bc49105d3132fb9e4150c92a14a.patch";
124 hash = "sha256-RPRtGQ24NQYewnv6+IqYITpwD/XxuK68a1iKgFmKm3c=";
126 # Make the tests pass on big endian systems
128 url = "https://github.com/qt/qtpim/commit/7802f038ed1391078e27fa3f37d785a69314537b.patch";
129 hash = "sha256-hogUXyPXjGE0q53PWOjiQbQ2YzOsvrJ7mo9djGIbjVQ=";
131 # Fix some deprecated QChar constructor issues in unit tests
133 url = "https://github.com/qt/qtpim/commit/114615812dcf9398c957b0833e860befe15f840f.patch";
134 hash = "sha256-yZ1qs8y5DSq8FDXRPyuSPRIzjEUTWAhpVide/b+xaLQ=";
136 # Accessors should be const
138 url = "https://github.com/qt/qtpim/commit/a2bf7cdf05c264b5dd2560f799760b5508f154e4.patch";
139 hash = "sha256-+YfPrKyOKnPkqFokwW/aDsEivg4TzdJwQpDdAtM+rQE=";
141 # Enforce detail access constraints in contact operations by default
143 url = "https://github.com/qt/qtpim/commit/8765a35233aa21a932ee92bbbb92a5f8edd4dc68.patch";
144 hash = "sha256-vp/enerVecEXz4zyxQ66DG+fVVWxI4bYnLj92qaaqNk=";
146 # Fixes broken file generation, which breaks reverse dependencies that try to find one of its modules
148 url = "https://github.com/qt/qtpim/commit/4b2bdce30bd0629c9dc0567af6eeaa1d038f3152.patch";
149 hash = "sha256-2dXhkZyxPvY2KQq2veerAlpXkpU5/FeArWRlm1aOcEY=";
152 ## Patches that haven't been upstreamed
154 # Fix tst_QContactManager::compareVariant_data test
156 url = "https://salsa.debian.org/qt-kde-team/qt/qtpim/-/raw/360682f88457b5ae7c92f32f574e51ccc5edbea0/debian/patches/1001_fix-qtdatetime-null-comparison.patch";
157 hash = "sha256-k/rO9QjwSlRChwFTZLkxDjZWqFkua4FNbaNf1bJKLxc=";
159 # Avoid crash while parsing vCards from different threads
161 url = "https://salsa.debian.org/qt-kde-team/qt/qtpim/-/raw/360682f88457b5ae7c92f32f574e51ccc5edbea0/debian/patches/1002_Avoid-crash-while-parsing-vcards-from-different-threads.patch";
162 hash = "sha256-zhayAoWgcmKosEGVBy2k6a2e6BxyVwfGX18tBbzqEk8=";
164 # Adapt to JSON parser behavior change in Qt 5.15
166 url = "https://salsa.debian.org/qt-kde-team/qt/qtpim/-/raw/360682f88457b5ae7c92f32f574e51ccc5edbea0/debian/patches/1003_adapt_to_json_parser_change.patch";
167 hash = "sha256-qAIa48hmDd8vMH/ywqW+22vISKai76XnjgFuB+tQbIU=";
169 # Fix version being 0.0.0
171 url = "https://salsa.debian.org/qt-kde-team/qt/qtpim/-/raw/360682f88457b5ae7c92f32f574e51ccc5edbea0/debian/patches/2000_revert_module_version.patch";
172 hash = "sha256-6wg/eVu9J83yvIO428U1FX3otz58tAy6pCvp7fqOBKU=";
175 qtscript = [ ./qtscript.patch ];
176 qtserialport = [ ./qtserialport.patch ];
178 # Fix crash if no X11 display available
180 url = "https://salsa.debian.org/qt-kde-team/qt/qtsystems/-/raw/1a4df40671d6f1bb0657a9dfdae4cd9bd48fcf21/debian/patches/1005_check_XOpenDisplay.patch";
181 hash = "sha256-/onla2nlUSySEgz2IYOYajx/LZkJzAKDyxwAZzy0Ivs=";
184 # Enable building with udisks support
186 url = "https://salsa.debian.org/qt-kde-team/qt/qtsystems/-/raw/a23fd92222c33479d7f3b59e48116def6b46894c/debian/patches/2001_build_with_udisk.patch";
187 hash = "sha256-B/z/+tai01RU/bAJSCp5a0/dGI8g36nwso8MiJv27YM=";
192 ./qtwebengine-link-pulseaudio.patch
193 # Fixes Chromium build failure with Ninja 1.12.
194 # See: https://bugreports.qt.io/browse/QTBUG-124375
195 # Backport of: https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit/?id=a766045f65f934df3b5f1aa63bc86fbb3e003a09
196 ./qtwebengine-ninja-1.12.patch
198 ++ lib.optionals stdenv.hostPlatform.isDarwin [
199 ./qtwebengine-darwin-no-platform-check.patch
200 ./qtwebengine-mac-dont-set-dsymutil-path.patch
201 ./qtwebengine-darwin-checks.patch
206 name = "qtwebkit-python39-json.patch";
207 url = "https://github.com/qtwebkit/qtwebkit/commit/78360c01c796b6260bf828bc9c8a0ef73c5132fd.patch";
208 sha256 = "yCX/UL666BPxjnxT6rIsUrJsPcSWHhZwMFJfuHhbkhk=";
211 name = "qtwebkit-bison-3.7-build.patch";
212 url = "https://github.com/qtwebkit/qtwebkit/commit/d92b11fea65364fefa700249bd3340e0cd4c5b31.patch";
213 sha256 = "0h8ymfnwgkjkwaankr3iifiscsvngqpwb91yygndx344qdiw9y0n";
216 name = "qtwebkit-glib-2.68.patch";
217 url = "https://github.com/qtwebkit/qtwebkit/pull/1058/commits/5b698ba3faffd4e198a45be9fe74f53307395e4b.patch";
218 sha256 = "0a3xv0h4lv8wggckgy8cg8xnpkg7n9h45312pdjdnnwy87xvzss0";
221 name = "qtwebkit-darwin-handle.patch";
222 url = "https://github.com/qtwebkit/qtwebkit/commit/5c272a21e621a66862821d3ae680f27edcc64c19.patch";
223 sha256 = "9hjqLyABz372QDgoq7nXXXQ/3OXBGcYN1/92ekcC3WE=";
226 name = "qtwebkit-libxml2-api-change.patch";
227 url = "https://github.com/WebKit/WebKit/commit/1bad176b2496579d760852c80cff3ad9fb7c3a4b.patch";
228 sha256 = "WZEj+UuKhgJBM7auhND3uddk1wWdTY728jtiWVe7CSI=";
231 ./qtwebkit-icu68.patch
232 ./qtwebkit-cstdint.patch
234 ++ lib.optionals stdenv.hostPlatform.isDarwin [
235 ./qtwebkit-darwin-no-readline.patch
236 ./qtwebkit-darwin-no-qos-classes.patch
238 qttools = [ ./qttools.patch ];
244 qtModule = callPackage ../qtModule.nix {
246 # Use a variant of mkDerivation that does not include wrapQtApplications
247 # to avoid cyclic dependencies between Qt modules.
248 mkDerivation = (callPackage ../mkDerivation.nix { wrapQtAppsHook = null; }) stdenv.mkDerivation;
251 callPackage = self.newScope {
269 mkDerivationWith = callPackage ../mkDerivation.nix { };
271 mkDerivation = callPackage ({ mkDerivationWith }: mkDerivationWith stdenv.mkDerivation) { };
273 qtbase = callPackage ../modules/qtbase.nix {
274 inherit (srcs.qtbase) src version;
275 patches = patches.qtbase;
282 withGtk3 = !stdenv.hostPlatform.isDarwin;
284 inherit developerBuild decryptSslTraffic;
287 qt3d = callPackage ../modules/qt3d.nix { };
288 qtcharts = callPackage ../modules/qtcharts.nix { };
289 qtconnectivity = callPackage ../modules/qtconnectivity.nix { };
290 qtdatavis3d = callPackage ../modules/qtdatavis3d.nix { };
291 qtdeclarative = callPackage ../modules/qtdeclarative.nix { };
292 qtdoc = callPackage ../modules/qtdoc.nix { };
293 qtgamepad = callPackage ../modules/qtgamepad.nix { };
294 qtgraphicaleffects = callPackage ../modules/qtgraphicaleffects.nix { };
295 qtimageformats = callPackage ../modules/qtimageformats.nix { };
296 qtlocation = callPackage ../modules/qtlocation.nix { };
297 qtlottie = callPackage ../modules/qtlottie.nix { };
298 qtmacextras = callPackage ../modules/qtmacextras.nix { };
299 qtmultimedia = callPackage ../modules/qtmultimedia.nix {
300 inherit gstreamer gst-plugins-base;
302 qtnetworkauth = callPackage ../modules/qtnetworkauth.nix { };
303 qtpim = callPackage ../modules/qtpim.nix { };
304 qtpositioning = callPackage ../modules/qtpositioning.nix { };
305 qtpurchasing = callPackage ../modules/qtpurchasing.nix { };
307 qtquick3d = callPackage ../modules/qtquick3d.nix { };
308 qtquickcontrols = callPackage ../modules/qtquickcontrols.nix { };
309 qtquickcontrols2 = callPackage ../modules/qtquickcontrols2.nix { };
310 qtremoteobjects = callPackage ../modules/qtremoteobjects.nix { };
311 qtscript = callPackage ../modules/qtscript.nix { };
312 qtsensors = callPackage ../modules/qtsensors.nix { };
313 qtserialbus = callPackage ../modules/qtserialbus.nix { };
314 qtserialport = callPackage ../modules/qtserialport.nix { };
315 qtspeech = callPackage ../modules/qtspeech.nix { };
316 qtsvg = callPackage ../modules/qtsvg.nix { };
317 qtsystems = callPackage ../modules/qtsystems.nix { };
318 qtscxml = callPackage ../modules/qtscxml.nix { };
319 qttools = callPackage ../modules/qttools.nix { };
320 qttranslations = callPackage ../modules/qttranslations.nix { };
321 qtvirtualkeyboard = callPackage ../modules/qtvirtualkeyboard.nix { };
322 qtwayland = callPackage ../modules/qtwayland.nix { };
323 qtwebchannel = callPackage ../modules/qtwebchannel.nix { };
324 qtwebengine = callPackage ../modules/qtwebengine.nix {
325 # The version of Chromium used by Qt WebEngine 5.15.x does not build with clang 16 due
326 # to the following errors:
327 # * -Wenum-constexpr-conversion: This is a downgradable error in clang 16, but it is planned
328 # to be made into a hard error in a future version of clang. Patches are not available for
329 # the version of v8 used by Chromium in Qt WebEngine, and fixing the code is non-trivial.
330 # * -Wincompatible-function-pointer-types: This is also a downgradable error generated
331 # starting with clang 16. Patches are available upstream that can be backported.
332 # Because the first error is non-trivial to fix and suppressing it risks future breakage,
333 # clang is pinned to clang 15. That also makes fixing the second set of errors unnecessary.
334 stdenv = if stdenv.cc.isClang then overrideLibcxx llvmPackages_15.stdenv else stdenv;
335 inherit (srcs.qtwebengine) version;
336 inherit (darwin) bootstrap_cmds;
339 qtwebglplugin = callPackage ../modules/qtwebglplugin.nix { };
340 qtwebkit = callPackage ../modules/qtwebkit.nix { };
341 qtwebsockets = callPackage ../modules/qtwebsockets.nix { };
342 qtwebview = callPackage ../modules/qtwebview.nix { };
343 qtx11extras = callPackage ../modules/qtx11extras.nix { };
344 qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix { };
346 env = callPackage ../qt-env.nix { };
348 callPackage ({ env, qtbase }: env "qt-full-${qtbase.version}") { }
349 # `with self` is ok to use here because having these spliced is unnecessary
380 ++ lib.optional (!stdenv.hostPlatform.isDarwin) qtwayland
381 ++ lib.optional (stdenv.hostPlatform.isDarwin) qtmacextras
384 qmake = callPackage (
389 if stdenv.buildPlatform == stdenv.hostPlatform then
390 "propagatedBuildInputs"
392 "depsTargetTargetPropagated"
397 fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
399 } ../hooks/qmake-hook.sh
402 wrapQtAppsHook = callPackage (
409 name = "wrap-qt5-apps-hook";
410 propagatedBuildInputs = [
413 ] ++ lib.optional stdenv.hostPlatform.isLinux qtwayland.dev;
414 } ../hooks/wrap-qt-apps-hook.sh
418 baseScope = makeScopeWithSplicing' {
419 otherSplices = generateSplicesForMkScope "qt5";
423 bootstrapScope = baseScope.overrideScope (
425 qtbase = prev.qtbase.override { qttranslations = null; };
426 qtdeclarative = null;
430 finalScope = baseScope.overrideScope (
432 # qttranslations causes eval-time infinite recursion when
433 # cross-compiling; disabled for now.
435 if stdenv.buildPlatform == stdenv.hostPlatform then bootstrapScope.qttranslations else null;