linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / libraries / qt-5 / 5.15 / default.nix
blobf969254b59524bdee3b4b4aeb7a4751da76a49e1
1 /*
3 # Updates
5 Before a major version update, make a copy of this directory. (We like to
6 keep the old version around for a short time after major updates.) Add a
7 top-level attribute to `top-level/all-packages.nix`.
9 1. Update the URL in `pkgs/development/libraries/qt-5/$VERSION/fetch.sh`.
10 2. From the top of the Nixpkgs tree, run
11    `./maintainers/scripts/fetch-kde-qt.sh pkgs/development/libraries/qt-5/$VERSION`.
12 3. Check that the new packages build correctly.
13 4. Commit the changes and open a pull request.
18   newScope,
19   lib, stdenv, fetchurl, fetchpatch, fetchgit, fetchFromGitHub, makeSetupHook, makeWrapper,
20   bison, cups ? null, harfbuzz, libGL, perl,
21   gstreamer, gst-plugins-base, gtk3, dconf,
22   llvmPackages_5,
24   # options
25   developerBuild ? false,
26   decryptSslTraffic ? false,
27   debug ? false,
30 with lib;
32 let
34   qtCompatVersion = srcs.qtbase.version;
36   stdenvActual = if stdenv.cc.isClang then llvmPackages_5.stdenv else stdenv;
38   mirror = "https://download.qt.io";
39   srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; } // {
40     # qtwebkit does not have an official release tarball on the qt mirror and is
41     # mostly maintained by the community.
42     qtwebkit = rec {
43       src = fetchFromGitHub {
44         owner = "qt";
45         repo = "qtwebkit";
46         rev = "v${version}";
47         sha256 = "0x8rng96h19xirn7qkz3lydal6v4vn00bcl0s3brz36dfs0z8wpg";
48       };
49       version = "5.212.0-alpha4";
50     };
52     # Even if developed in the public, QtWebEngine does not have official
53     # releases or new tags since the Qt company made 5.15.3 proprietary.
54     # Apparently they care more about licensing than the security of their users.
55     # See https://lists.qt-project.org/pipermail/interest/2021-March/036387.html
56     qtwebengine =
57       let
58         branchName = "5.15.3";
59         rev = "a059e7404a6db799f4da0ad696e65ae9c854b4b0";
60       in
61       {
62         version = "${branchName}-${lib.substring 0 7 rev}";
64         src = fetchgit {
65           url = "https://github.com/qt/qtwebengine.git";
66           sha256 = "1vdgxfbmx4z4qrm2g61dl64gqn3fv5f83jwpp7h1gyfx5z2qvfmv";
67           inherit rev branchName;
68           fetchSubmodules = true;
69           leaveDotGit = true;
70           name = "qtwebengine-${substring 0 7 rev}.tar.gz";
71           postFetch = ''
72             # remove submodule .git directory
73             rm -rf $out/src/3rdparty/.git
75             # compress to not exceed the 2GB output limit
76             mv $out source
77             # try to make a deterministic tarball
78             tar -I 'gzip -n' \
79               --sort name \
80               --mtime 1970-01-01 \
81               --owner=root --group=root \
82               --numeric-owner --mode=go=rX,u+rw,a-s \
83               -cf $out source
84           '';
85         };
86       };
87   };
89   patches = {
90     qtbase =
91       optionals stdenv.isDarwin [
92         ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
94         # Downgrade minimal required SDK to 10.12
95         ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch
96         ./qtbase.patch.d/macos-sdk-10.12/0001-Revert-QCocoaDrag-set-image-only-on-the-first-drag-i.patch
97         ./qtbase.patch.d/macos-sdk-10.12/0002-Revert-QCocoaDrag-drag-make-sure-clipboard-is-ours-a.patch
98         ./qtbase.patch.d/macos-sdk-10.12/0003-Revert-QCocoaDrag-maybeDragMultipleItems-fix-erroneo.patch
99         ./qtbase.patch.d/macos-sdk-10.12/0004-Revert-QCocoaDrag-avoid-using-the-deprecated-API-if-.patch
100         ./qtbase.patch.d/macos-sdk-10.12/0005-Revert-macOS-Fix-use-of-deprecated-NSOffState.patch
101         ./qtbase.patch.d/macos-sdk-10.12/0006-git-checkout-v5.15.0-src-plugins-platforms-cocoa-qco.patch
102         ./qtbase.patch.d/qtbase-sdk-10.12-mac.patch
104         # Patch framework detection to support X.framework/X.tbd,
105         # extending the current support for X.framework/X.
106         ./qtbase.patch.d/0012-qtbase-tbd-frameworks.patch
107       ]
108       ++ [
109         ./qtbase.patch.d/0003-qtbase-mkspecs.patch
110         ./qtbase.patch.d/0004-qtbase-replace-libdir.patch
111         ./qtbase.patch.d/0005-qtbase-cmake.patch
112         ./qtbase.patch.d/0006-qtbase-gtk3.patch
113         ./qtbase.patch.d/0007-qtbase-xcursor.patch
114         ./qtbase.patch.d/0008-qtbase-tzdir.patch
115         ./qtbase.patch.d/0009-qtbase-qtpluginpath.patch
116         ./qtbase.patch.d/0010-qtbase-assert.patch
117         ./qtbase.patch.d/0011-fix-header_module.patch
118       ];
119     qtdeclarative = [ ./qtdeclarative.patch ];
120     qtscript = [ ./qtscript.patch ];
121     qtserialport = [ ./qtserialport.patch ];
122     qtwebengine = [
123       # Fix crashes with non en_US.UTF-8 locales
124       (fetchpatch {
125         url = "https://github.com/qt/qtwebengine/commit/199ea00a9eea13315a652c62778738629185b059.patch";
126         sha256 = "1b5k2g1v8913cvsgvp6ja4mcprjlk5vcwqzi0p1qq7b1wyi4f0g2";
127       })
128     ] ++ optionals stdenv.isDarwin [
129       ./qtwebengine-darwin-no-platform-check.patch
130       ./qtwebengine-mac-dont-set-dsymutil-path.patch
131     ];
132     qtwebkit = [
133       (fetchpatch {
134         name = "qtwebkit-bison-3.7-build.patch";
135         url = "https://github.com/qtwebkit/qtwebkit/commit/d92b11fea65364fefa700249bd3340e0cd4c5b31.patch";
136         sha256 = "0h8ymfnwgkjkwaankr3iifiscsvngqpwb91yygndx344qdiw9y0n";
137       })
138       ./qtwebkit.patch
139       ./qtwebkit-icu68.patch
140     ] ++ optionals stdenv.isDarwin [
141       ./qtwebkit-darwin-no-readline.patch
142       ./qtwebkit-darwin-no-qos-classes.patch
143     ];
144     qttools = [ ./qttools.patch ];
145   };
147   qtModule =
148     import ../qtModule.nix
149     {
150       inherit perl;
151       inherit lib;
152       # Use a variant of mkDerivation that does not include wrapQtApplications
153       # to avoid cyclic dependencies between Qt modules.
154       mkDerivation =
155         import ../mkDerivation.nix
156         { inherit lib; inherit debug; wrapQtAppsHook = null; }
157         stdenvActual.mkDerivation;
158     }
159     { inherit self srcs patches; };
161   addPackages = self: with self;
162     let
163       callPackage = self.newScope { inherit qtCompatVersion qtModule srcs; };
164     in {
166       mkDerivationWith =
167         import ../mkDerivation.nix
168         { inherit lib; inherit debug; inherit (self) wrapQtAppsHook; };
170       mkDerivation = mkDerivationWith stdenvActual.mkDerivation;
172       qtbase = callPackage ../modules/qtbase.nix {
173         inherit (srcs.qtbase) src version;
174         patches = patches.qtbase;
175         inherit bison cups harfbuzz libGL;
176         withGtk3 = true; inherit dconf gtk3;
177         inherit developerBuild decryptSslTraffic;
178       };
180       qtcharts = callPackage ../modules/qtcharts.nix {};
181       qtconnectivity = callPackage ../modules/qtconnectivity.nix {};
182       qtdeclarative = callPackage ../modules/qtdeclarative.nix {};
183       qtdoc = callPackage ../modules/qtdoc.nix {};
184       qtgraphicaleffects = callPackage ../modules/qtgraphicaleffects.nix {};
185       qtimageformats = callPackage ../modules/qtimageformats.nix {};
186       qtlocation = callPackage ../modules/qtlocation.nix {};
187       qtmacextras = callPackage ../modules/qtmacextras.nix {};
188       qtmultimedia = callPackage ../modules/qtmultimedia.nix {
189         inherit gstreamer gst-plugins-base;
190       };
191       qtnetworkauth = callPackage ../modules/qtnetworkauth.nix {};
192       qtquick1 = null;
193       qtquickcontrols = callPackage ../modules/qtquickcontrols.nix {};
194       qtquickcontrols2 = callPackage ../modules/qtquickcontrols2.nix {};
195       qtscript = callPackage ../modules/qtscript.nix {};
196       qtsensors = callPackage ../modules/qtsensors.nix {};
197       qtserialport = callPackage ../modules/qtserialport.nix {};
198       qtspeech = callPackage ../modules/qtspeech.nix {};
199       qtsvg = callPackage ../modules/qtsvg.nix {};
200       qtscxml = callPackage ../modules/qtscxml.nix {};
201       qttools = callPackage ../modules/qttools.nix {};
202       qttranslations = callPackage ../modules/qttranslations.nix {};
203       qtvirtualkeyboard = callPackage ../modules/qtvirtualkeyboard.nix {};
204       qtwayland = callPackage ../modules/qtwayland.nix {};
205       qtwebchannel = callPackage ../modules/qtwebchannel.nix {};
206       qtwebengine = callPackage ../modules/qtwebengine.nix {
207         inherit (srcs.qtwebengine) version;
208       };
209       qtwebglplugin = callPackage ../modules/qtwebglplugin.nix {};
210       qtwebkit = callPackage ../modules/qtwebkit.nix {};
211       qtwebsockets = callPackage ../modules/qtwebsockets.nix {};
212       qtwebview = callPackage ../modules/qtwebview.nix {};
213       qtx11extras = callPackage ../modules/qtx11extras.nix {};
214       qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {};
216       env = callPackage ../qt-env.nix {};
217       full = env "qt-full-${qtbase.version}" ([
218         qtcharts qtconnectivity qtdeclarative qtdoc qtgraphicaleffects
219         qtimageformats qtlocation qtmultimedia qtquickcontrols qtquickcontrols2
220         qtscript qtsensors qtserialport qtsvg qttools qttranslations
221         qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets
222         qtwebview qtx11extras qtxmlpatterns
223       ] ++ optional (!stdenv.isDarwin) qtwayland
224         ++ optional (stdenv.isDarwin) qtmacextras);
226       qmake = makeSetupHook {
227         deps = [ self.qtbase.dev ];
228         substitutions = {
229           inherit debug;
230           fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
231         };
232       } ../hooks/qmake-hook.sh;
234       wrapQtAppsHook = makeSetupHook {
235         deps =
236           [ self.qtbase.dev makeWrapper ]
237           ++ optional stdenv.isLinux self.qtwayland.dev;
238       } ../hooks/wrap-qt-apps-hook.sh;
239     };
241    self = makeScope newScope addPackages;
243 in self