Skip to content
78 changes: 32 additions & 46 deletions pkgs/development/libraries/qt-5/5.15/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,12 @@
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,

Expand Down Expand Up @@ -59,13 +48,18 @@ 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=";
})
];
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
];
qtlocation = lib.optionals stdenv.cc.isClang [
# Fix build with Clang 16
Expand Down Expand Up @@ -236,6 +230,18 @@ 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=";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sha256 = "sha256-Z+ot7R5Dy+F08FbcXzN4MB2ttxLg0I0P8uVErpbFiu4=";
hash = "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
Expand All @@ -247,15 +253,12 @@ let
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
Expand All @@ -282,14 +285,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 +301,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 +324,14 @@ 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;
python = python3;
};
qtwebglplugin = callPackage ../modules/qtwebglplugin.nix { };
qtwebkit = callPackage ../modules/qtwebkit.nix { };
qtwebsockets = callPackage ../modules/qtwebsockets.nix { };
Expand Down
12 changes: 12 additions & 0 deletions pkgs/development/libraries/qt-5/5.15/qtdeclarative-gcc15.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp
index 18e19cf01c..13934eebb5 100644
--- a/src/qml/compiler/qv4compiler.cpp
+++ b/src/qml/compiler/qv4compiler.cpp
@@ -47,6 +47,7 @@
#include <private/qml_compile_hash_p.h>
#include <private/qqmlirbuilder_p.h>
#include <QCryptographicHash>
+#include <cstdint>

// Efficient implementation that takes advantage of powers of two.
static inline size_t roundUpToMultipleOf(size_t divisor, size_t x)
10 changes: 10 additions & 0 deletions pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
. @fix_qmake_libtool@

# Split qmakeFlags if it's not an array already (i.e. comes from a derivation
# with __structuredAttrs disabled). This will be important later when we pass
# it to qmake: qmakeFlags can contain file names and other options that must
# be separate words in the command.
local type=$(declare -p qmakeFlags)
local typeArray='declare -a'
if [[ "${type:0:${#typeArray}}" == "$typeArray" ]]; then
qmakeFlags=( ${qmakeFlags-} )
fi

qmakePrePhase() {
# These flags must be added _before_ the flags specified in the derivation.
prependToVar qmakeFlags \
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ export QMAKE
QMAKEPATH=
export QMAKEPATH

QMAKEMODULES=
export QMAKEMODULES

declare -Ag qmakePathSeen=()
qmakePathHook() {
# Skip this path if we have seen it before.
Expand All @@ -52,7 +49,6 @@ qmakePathHook() {
qmakePathSeen[$1]=1
if [ -d "$1/mkspecs" ]
then
QMAKEMODULES="${QMAKEMODULES}${QMAKEMODULES:+:}/mkspecs"
QMAKEPATH="${QMAKEPATH}${QMAKEPATH:+:}$1"
fi
}
Expand Down
12 changes: 4 additions & 8 deletions pkgs/development/libraries/qt-5/modules/qtbase.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,14 @@
withGtk3 ? false,
dconf,
gtk3,
withQttranslation ? true,
qttranslations ? null,
withLibinput ? false,
libinput,

# options
libGLSupported ? !stdenv.hostPlatform.isDarwin,
libGL,
# qmake detection for libmysqlclient does not seem to work when cross compiling
mysqlSupport ? stdenv.hostPlatform == stdenv.buildPlatform,
mysqlSupport ? true,
libmysqlclient,
buildExamples ? false,
buildTests ? false,
Expand Down Expand Up @@ -161,7 +159,6 @@ stdenv.mkDerivation (
pkg-config
which
]
++ lib.optionals mysqlSupport [ libmysqlclient ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ];

}
Expand Down Expand Up @@ -488,12 +485,11 @@ stdenv.mkDerivation (
]
++ lib.optionals mysqlSupport [
"-L"
"${libmysqlclient}/lib"
"${libmysqlclient}/lib/mysql"
"-I"
"${libmysqlclient}/include"
"${libmysqlclient}/include/mysql"
]
++ lib.optional (withQttranslation && (qttranslations != null)) [
# depends on x11
++ lib.optional (qttranslations != null) [
"-translationdir"
"${qttranslations}/translations"
]
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/libraries/qt-5/modules/qtdeclarative.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
qtModule,
python3,
qtbase,
qtsvg,
}:

qtModule {
pname = "qtdeclarative";
propagatedBuildInputs = [
qtbase
qtsvg
];
nativeBuildInputs = [ python3 ];
outputs = [
Expand Down
25 changes: 13 additions & 12 deletions pkgs/development/libraries/qt-5/modules/qtmultimedia.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
qtdeclarative,
pkg-config,
alsa-lib,
gstreamer,
gst-plugins-base,
gst_all_1,
libpulseaudio,
wayland,
}:
Expand All @@ -19,16 +18,18 @@ qtModule {
qtdeclarative
];
nativeBuildInputs = [ pkg-config ];
buildInputs = [
gstreamer
gst-plugins-base
]
# https://github.com/NixOS/nixpkgs/pull/169336 regarding libpulseaudio
++ lib.optionals stdenv.hostPlatform.isLinux [
libpulseaudio
alsa-lib
wayland
];
buildInputs =
with gst_all_1;
[
gstreamer
gst-plugins-base
]
# https://github.com/NixOS/nixpkgs/pull/169336 regarding libpulseaudio
++ lib.optionals stdenv.hostPlatform.isLinux [
libpulseaudio
alsa-lib
wayland
];
outputs = [
"bin"
"dev"
Expand Down
Loading
Loading