Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
051cefa
qt5: simplify package functions' definitions and calls
Dec 4, 2023
f4423ca
qt5.qtbase: remove the unused withQttranslation parameter
Jan 10, 2024
636a275
qt5.qtbase: remove broken QMAKEMODULES code
Dec 6, 2023
3bfdd7d
qt5.qtbase: fix mysql support for cross builds
Dec 6, 2023
f97b098
qt5.qtbase: strictDeps works without mysql in nativeBuildInputs
Aug 28, 2025
a3868fe
qt5.qtdeclarative: fix building with gcc15 and remove unused qtsvg de…
Feb 3, 2026
7c4d335
qt5.qtwebkit: fix build and use hyphen and woff2 from pkgs
Aug 31, 2025
ed823ab
Revert "qt5.qtwebengine: Pin to GCC 14"
Jan 19, 2026
a258d0b
qt5.qtwebengine: fix building with gcc 15, use more system librares, and
Feb 4, 2026
e04ba27
qt5.qmake: make it usable again for packages that pass file names in …
Sep 1, 2025
7eb40a1
distccMasquerade: add ar
Nov 13, 2023
bd45046
qt5: rework bootstrapping
Dec 7, 2023
f26fb79
qt5.qtbase: always build all packaged binaries for the hostPlatform
Dec 7, 2023
0aabd1c
qt5.qtbase: support substituting a cross-built qtbase dependency with…
Jan 10, 2024
929b55d
qt5.full: add disallowedReferences for qmake from buildHost
Nov 13, 2023
fa6ed86
qt5: fix discovery of QT modules in cross builds
Nov 13, 2023
4a18f10
qt5.qtbase: add preliminary support for cross on Darwin
Dec 3, 2023
3c7ac68
qt5.qtwayland: fix cross compilation and dependencies
Nov 13, 2023
0b2dde4
qt5.qtdeclarative: fix cross for qtdeclarative and some of it's users
Nov 13, 2023
e554918
qt5.qttools: fix detection of lrelease and other tools in cross build…
Nov 13, 2023
aa7d017
qt5.wrapQtAppsHook: move libs to depsTargetTargetPropagated
Artturin Oct 25, 2023
e117691
Revert "qt5.qtwebchannel: omit "bin" output when cross compiling"
Nov 16, 2023
9b5279d
qt5.qtwebengine: update cross compilation support
Nov 16, 2023
b4abf62
python3Packages.pyqt5: update cross
Nov 21, 2023
1641abb
python3Packages.pyqtwebengine: update cross compilation support
Dec 2, 2023
3bff735
python3Packages.pyqtwebengine: nixfmt
Sep 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 52 additions & 80 deletions pkgs/development/libraries/qt-5/5.15/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,15 @@
generateSplicesForMkScope,
lib,
stdenv,
gcc14Stdenv,
fetchurl,
fetchgit,
fetchpatch,
fetchFromGitHub,
makeSetupHook,
makeWrapper,
bison,
cups ? null,
harfbuzz,
libGL,
perl,
python3,
gstreamer,
gst-plugins-base,
gtk3,
dconf,
llvmPackages_19,
darwin,
buildPackages,

# options
developerBuild ? false,
Expand Down Expand Up @@ -59,13 +49,20 @@ let
url = "https://gitlab.alpinelinux.org/alpine/aports/-/raw/81b14ae4eed038662b53cd20786fd5e0816279ec/community/qt5-qtbase/loongarch64.patch";
hash = "sha256-BnpejF6/L73kVVts0R0/OMbVN8G4DXVFwBMJPLU9QbE=";
})
(fetchpatch {
url = "https://salsa.debian.org/qt-kde-team/qt/qtbase/-/raw/6910758e1141f8ea65a8f2359ac30163d65bf6e2/debian/patches/cross_build_mysql.diff";
hash = "sha256-tzmmLmMXmeDwRVjdpWekDJvSkrIIlslC12HP7XPcm3E=";
})
./qtbase.patch.d/0015-qtbase-cross-build.patch
];
qtdeclarative = [
./qtdeclarative.patch
# prevent headaches from stale qmlcache data
./qtdeclarative-default-disable-qmlcache.patch
# add version specific QML import path
./qtdeclarative-qml-paths.patch
./qtdeclarative-gcc15.patch
./qtdeclarative-cross-build.patch
];
qtlocation = lib.optionals stdenv.cc.isClang [
# Fix build with Clang 16
Expand Down Expand Up @@ -201,6 +198,7 @@ let
# See: https://bugreports.qt.io/browse/QTBUG-124375
# Backport of: https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit/?id=a766045f65f934df3b5f1aa63bc86fbb3e003a09
./qtwebengine-ninja-1.12.patch
./qtwebengine-cross-build.patch
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
./qtwebengine-darwin-no-platform-check.patch
Expand Down Expand Up @@ -236,35 +234,48 @@ let
./qtwebkit.patch
./qtwebkit-icu68.patch
./qtwebkit-cstdint.patch
(fetchpatch {
url = "https://src.fedoraproject.org/rpms/qt5-qtwebkit/raw/84f3c61c46bce99bfbd70d8c202e022d62f2ea9a/f/qtwebkit-icu76.patch";
sha256 = "sha256-Z+ot7R5Dy+F08FbcXzN4MB2ttxLg0I0P8uVErpbFiu4=";
})
(fetchpatch {
url = "https://src.fedoraproject.org/rpms/qt5-qtwebkit/raw/84f3c61c46bce99bfbd70d8c202e022d62f2ea9a/f/webkit-offlineasm-warnings-ruby27.patch";
sha256 = "sha256-g+qkAJD78lPdZzZZ910SZqk0yJlJIBZh9ue4ClRD5L4=";
})
(fetchpatch {
url = "https://src.fedoraproject.org/rpms/qt5-qtwebkit/raw/84f3c61c46bce99bfbd70d8c202e022d62f2ea9a/f/qtwebkit-fix-build-gcc14.patch";
sha256 = "sha256-K7TgGux34dMN0Mnm4EsJhNKLdy1VdKTAE3HGRD8KARU=";
})
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
./qtwebkit-darwin-no-readline.patch
./qtwebkit-darwin-no-qos-classes.patch
];
qttools = [ ./qttools.patch ];
qttools = [
./qttools.patch
./qttools-cross-build.patch
];
};

addPackages =
self:
let
qtModuleWithStdenv =
stdenv:
callPackage ../qtModule.nix {
inherit patches;
# Use a variant of mkDerivation that does not include wrapQtApplications
# to avoid cyclic dependencies between Qt modules.
mkDerivation = (callPackage ../mkDerivation.nix { wrapQtAppsHook = null; }) stdenv.mkDerivation;
};
qtModule = qtModuleWithStdenv stdenv;
qtModule = callPackage ../qtModule.nix {
inherit patches;
# Use a variant of mkDerivation that does not include wrapQtApplications
# to avoid cyclic dependencies between Qt modules.
mkDerivation = (callPackage ../mkDerivation.nix { wrapQtAppsHook = null; }) stdenv.mkDerivation;
};

callPackage = self.newScope {
inherit
qtCompatVersion
qtModule
srcs
stdenv
;
qtbase-bootstrap = buildPackages.qt5.qtbase.override { bootstrapBuild = true; };
# qtbase won't be spliced here, but that's fine as it's only a buildInput
qttools-bootstrap = buildPackages.qt5.qttools.override {
qtbase = qtbase-bootstrap;
qtdeclarative = null;
};

# ↓Things available only to packages in the scope↓
callPackage = self.newScope { inherit qtbase-bootstrap qttools-bootstrap stdenv; };
in
{

Expand All @@ -282,14 +293,7 @@ let
qtbase = callPackage ../modules/qtbase.nix {
inherit (srcs.qtbase) src version;
patches = patches.qtbase;
inherit
bison
cups
harfbuzz
libGL
;
withGtk3 = !stdenv.hostPlatform.isDarwin;
inherit dconf gtk3;
inherit developerBuild decryptSslTraffic;
};

Expand All @@ -305,9 +309,7 @@ let
qtlocation = callPackage ../modules/qtlocation.nix { };
qtlottie = callPackage ../modules/qtlottie.nix { };
qtmacextras = callPackage ../modules/qtmacextras.nix { };
qtmultimedia = callPackage ../modules/qtmultimedia.nix {
inherit gstreamer gst-plugins-base;
};
qtmultimedia = callPackage ../modules/qtmultimedia.nix { };
qtnetworkauth = callPackage ../modules/qtnetworkauth.nix { };
qtpim = callPackage ../modules/qtpim.nix { };
qtpositioning = callPackage ../modules/qtpositioning.nix { };
Expand All @@ -330,22 +332,13 @@ let
qtvirtualkeyboard = callPackage ../modules/qtvirtualkeyboard.nix { };
qtwayland = callPackage ../modules/qtwayland.nix { };
qtwebchannel = callPackage ../modules/qtwebchannel.nix { };
qtwebengine =
# Actually propagating stdenv change
let
# Won’t build with Clang 20, as `-Wenum-constexpr-conversion`
# was made a hard error.
# qt5webengine no longer maintained, FTBFS with GCC 15
stdenv' = if stdenv.cc.isClang then llvmPackages_19.stdenv else gcc14Stdenv;
qtModule' = qtModuleWithStdenv stdenv';
in
callPackage ../modules/qtwebengine.nix {
inherit (srcs.qtwebengine) version;
inherit (darwin) bootstrap_cmds;
stdenv = stdenv';
qtModule = qtModule';
python = python3;
};
qtwebengine = callPackage ../modules/qtwebengine.nix {
# Won’t build with Clang 20, as `-Wenum-constexpr-conversion`
# was made a hard error.
stdenv = if stdenv.cc.isClang then llvmPackages_19.stdenv else stdenv;
inherit (srcs.qtwebengine) version;
inherit (darwin) bootstrap_cmds;
};
qtwebglplugin = callPackage ../modules/qtwebglplugin.nix { };
qtwebkit = callPackage ../modules/qtwebkit.nix { };
qtwebsockets = callPackage ../modules/qtwebsockets.nix { };
Expand All @@ -356,16 +349,10 @@ let
env = callPackage ../qt-env.nix { };

qmake = callPackage (
{ qtbase }:
{ qtbase-bootstrap }:
makeSetupHook {
name = "qmake-hook";
${
if stdenv.buildPlatform == stdenv.hostPlatform then
"propagatedBuildInputs"
else
"depsTargetTargetPropagated"
} =
[ qtbase.dev ];
propagatedBuildInputs = [ qtbase-bootstrap.qmake ];
substitutions = {
inherit debug;
fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
Expand All @@ -381,9 +368,9 @@ let
}:
makeSetupHook {
name = "wrap-qt5-apps-hook";
propagatedBuildInputs = [
propagatedBuildInputs = [ makeBinaryWrapper ];
depsTargetTargetPropagated = [
qtbase.dev
makeBinaryWrapper
]
++ lib.optional stdenv.hostPlatform.isLinux qtwayland.dev;
} ../hooks/wrap-qt-apps-hook.sh
Expand All @@ -393,25 +380,10 @@ let
full = throw "libsForQt5.full has been removed. Please use individual packages instead."; # Added 2025-10-18
};

baseScope = makeScopeWithSplicing' {
finalScope = makeScopeWithSplicing' {
otherSplices = generateSplicesForMkScope "qt5";
f = addPackages;
};

bootstrapScope = baseScope.overrideScope (
final: prev: {
qtbase = prev.qtbase.override { qttranslations = null; };
qtdeclarative = null;
}
);

finalScope = baseScope.overrideScope (
final: prev: {
# qttranslations causes eval-time infinite recursion when
# cross-compiling; disabled for now.
qttranslations =
if stdenv.buildPlatform == stdenv.hostPlatform then bootstrapScope.qttranslations else null;
}
);
in
finalScope
Loading
Loading