push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
--- a/cmake/QtBuildPathsHelpers.cmake
+++ b/cmake/QtBuildPathsHelpers.cmake
@@ -140,7 +140,7 @@ function(qt_configure_process_path name default docstring)
set(new_value ".")
elseif(rel_path MATCHES "^\.\./")
# INSTALL_SYSCONFDIR is allowed to be outside the prefix.
- if(NOT name STREQUAL "INSTALL_SYSCONFDIR")
+ if(NOT (name STREQUAL "INSTALL_SYSCONFDIR" OR name STREQUAL "INSTALL_TRANSLATIONSDIR"))
message(FATAL_ERROR
"Path component '${name}' is outside computed install prefix: ${rel_path} ")
endif()

View File

@@ -0,0 +1,325 @@
{
stdenv,
lib,
src,
version,
bison,
flex,
gperf,
lndir,
perl,
pkg-config,
which,
cmake,
ninja,
libproxy,
xorg,
zstd,
double-conversion,
util-linux,
systemd,
systemdSupport ? stdenv.hostPlatform.isLinux,
libb2,
md4c,
mtdev,
lksctp-tools,
libselinux,
libsepol,
vulkan-headers,
vulkan-loader,
libthai,
libdrm,
libdatrie,
lttng-ust,
libepoxy,
dbus,
fontconfig,
freetype,
glib,
harfbuzz,
icu,
libX11,
libXcomposite,
libXext,
libXi,
libXrender,
libjpeg,
libpng,
libxcb,
libxkbcommon,
libxml2,
libxslt,
openssl,
pcre2,
sqlite,
udev,
xcbutil,
xcbutilimage,
xcbutilkeysyms,
xcbutilrenderutil,
xcbutilwm,
zlib,
at-spi2-core,
unixODBC,
unixODBCDrivers,
libGL,
# darwin
moltenvk,
moveBuildTree,
darwinVersionInputs,
xcbuild,
# mingw
pkgsBuildBuild,
# optional dependencies
cups,
libmysqlclient,
libpq,
withGtk3 ? false,
gtk3,
withLibinput ? false,
libinput,
# options
qttranslations ? null,
}:
let
isCrossBuild = !stdenv.buildPlatform.canExecute stdenv.hostPlatform;
in
stdenv.mkDerivation rec {
pname = "qtbase";
inherit src version;
propagatedBuildInputs = [
libxml2
libxslt
openssl
sqlite
zlib
libGL
vulkan-headers
vulkan-loader
# Text rendering
harfbuzz
icu
# Image formats
libjpeg
libpng
pcre2
zstd
libb2
md4c
double-conversion
]
++ lib.optionals (!stdenv.hostPlatform.isMinGW) [
libproxy
dbus
glib
# unixODBC drivers
unixODBC
unixODBCDrivers.psql
unixODBCDrivers.sqlite
unixODBCDrivers.mariadb
]
++ lib.optionals systemdSupport [
systemd
]
++ lib.optionals stdenv.hostPlatform.isLinux [
util-linux
mtdev
lksctp-tools
libselinux
libsepol
lttng-ust
libthai
libdrm
libdatrie
udev
# Text rendering
fontconfig
freetype
# X11 libs
libX11
libXcomposite
libXext
libXi
libXrender
libxcb
libxkbcommon
xcbutil
xcbutilimage
xcbutilkeysyms
xcbutilrenderutil
xcbutilwm
xorg.libXdmcp
xorg.libXtst
xorg.xcbutilcursor
libepoxy
]
++ lib.optional (cups != null && lib.meta.availableOn stdenv.hostPlatform cups) cups;
buildInputs =
lib.optionals (lib.meta.availableOn stdenv.hostPlatform at-spi2-core) [
at-spi2-core
]
++ lib.optionals stdenv.hostPlatform.isDarwin (darwinVersionInputs ++ [ moltenvk ])
++ lib.optional withGtk3 gtk3
++ lib.optional withLibinput libinput
++ lib.optional (libmysqlclient != null && !stdenv.hostPlatform.isMinGW) libmysqlclient
++ lib.optional (libpq != null && lib.meta.availableOn stdenv.hostPlatform libpq) libpq;
nativeBuildInputs = [
bison
flex
gperf
lndir
perl
pkg-config
which
cmake
ninja
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ moveBuildTree ];
propagatedNativeBuildInputs = [
lndir
]
# Im not sure if this is necessary, but the macOS mkspecs stuff
# tries to call `xcrun xcodebuild`, so better safe than sorry.
++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ];
strictDeps = true;
enableParallelBuilding = true;
patches = [
# look for Qt plugins in directories on PATH
./derive-plugin-load-path-from-PATH.patch
# allow translations to be found outside of install prefix, as is the case in our split builds
./allow-translations-outside-prefix.patch
# always link to libraries by name in qmake-generated build scripts
./qmake-always-use-libname.patch
# always explicitly list includedir in qmake-generated pkg-config files
./qmake-fix-includedir.patch
# don't generate SBOM files by default, they don't work with our split installs anyway
./no-sbom.patch
# use cmake from PATH in qt-cmake wrapper, to avoid qtbase runtime-depending on cmake
./use-cmake-from-path.patch
# macdeployqt fixes
# get qmlimportscanner location from environment variable
./find-qmlimportscanner.patch
# pass QML2_IMPORT_PATH from environment to qmlimportscanner
./qmlimportscanner-import-path.patch
# don't pass qtbase's QML directory to qmlimportscanner if it's empty
./skip-missing-qml-directory.patch
];
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
# TODO: Verify that this catches all the occurrences?
for file in \
cmake/QtPublicAppleHelpers.cmake \
mkspecs/features/mac/asset_catalogs.prf \
mkspecs/features/mac/default_pre.prf \
mkspecs/features/mac/sdk.mk \
mkspecs/features/mac/sdk.prf \
mkspecs/features/permissions.prf \
src/corelib/Qt6CoreMacros.cmake
do
substituteInPlace "$file" \
--replace-quiet /usr/bin/xcrun '${lib.getExe' xcbuild "xcrun"}' \
--replace-quiet /usr/bin/xcode-select '${lib.getExe' xcbuild "xcode-select"}' \
--replace-quiet /usr/libexec/PlistBuddy '${lib.getExe' xcbuild "PlistBuddy"}'
done
substituteInPlace mkspecs/common/macx.conf \
--replace-fail 'CONFIG += ' 'CONFIG += no_default_rpath '
'';
fix_qt_builtin_paths = ../../hooks/fix-qt-builtin-paths.sh;
fix_qt_module_paths = ../../hooks/fix-qt-module-paths.sh;
preHook = ''
. "$fix_qt_builtin_paths"
. "$fix_qt_module_paths"
'';
qtPluginPrefix = "lib/qt-6/plugins";
qtQmlPrefix = "lib/qt-6/qml";
cmakeFlags = [
"-DQT_EMBED_TOOLCHAIN_COMPILER=OFF"
"-DINSTALL_PLUGINSDIR=${qtPluginPrefix}"
"-DINSTALL_QMLDIR=${qtQmlPrefix}"
"-DQT_FEATURE_libproxy=ON"
"-DQT_FEATURE_system_sqlite=ON"
"-DQT_FEATURE_openssl_linked=ON"
"-DQT_FEATURE_vulkan=ON"
# don't leak OS version into the final output
# https://bugreports.qt.io/browse/QTBUG-136060
"-DCMAKE_SYSTEM_VERSION="
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
"-DQT_FEATURE_sctp=ON"
"-DQT_FEATURE_journald=${if systemdSupport then "ON" else "OFF"}"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
"-DQT_FEATURE_rpath=OFF"
"-DQT_NO_XCODE_MIN_VERSION_CHECK=ON"
# This is only used for the min version check, which we disabled above.
# When this variable is not set, cmake tries to execute xcodebuild
# to query the version.
"-DQT_INTERNAL_XCODE_VERSION=0.1"
]
++ lib.optionals isCrossBuild [
"-DQT_HOST_PATH=${pkgsBuildBuild.qt6.qtbase}"
"-DQt6HostInfo_DIR=${pkgsBuildBuild.qt6.qtbase}/lib/cmake/Qt6HostInfo"
]
++ lib.optional (
qttranslations != null && !isCrossBuild
) "-DINSTALL_TRANSLATIONSDIR=${qttranslations}/translations";
env.NIX_CFLAGS_COMPILE = "-DNIXPKGS_QT_PLUGIN_PREFIX=\"${qtPluginPrefix}\"";
outputs = [
"out"
"dev"
];
separateDebugInfo = true;
moveToDev = false;
postFixup = ''
moveToOutput "mkspecs/modules" "$dev"
fixQtModulePaths "$dev/mkspecs/modules"
fixQtBuiltinPaths "$out" '*.pr?'
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
# FIXME: not sure why this isn't added automatically?
patchelf --add-rpath "${libmysqlclient}/lib/mariadb" $out/${qtPluginPrefix}/sqldrivers/libqsqlmysql.so
patchelf --add-rpath "${vulkan-loader}/lib" --add-needed "libvulkan.so" $out/lib/libQt6Gui.so
'';
dontWrapQtApps = true;
setupHook = ../../hooks/qtbase-setup-hook.sh;
meta = with lib; {
homepage = "https://www.qt.io/";
description = "Cross-platform application framework for C++";
license = with licenses; [
fdl13Plus
gpl2Plus
lgpl21Plus
lgpl3Plus
];
maintainers = with maintainers; [
nickcao
LunNova
];
platforms = platforms.unix ++ platforms.windows;
};
}

View File

@@ -0,0 +1,18 @@
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -3038,6 +3038,15 @@ QStringList QCoreApplication::libraryPathsLocked()
app_libpaths->append(installPathPlugins);
}
+ // Add library paths derived from PATH
+ const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(QStringLiteral(":"));
+ const QString plugindir = QStringLiteral("../" NIXPKGS_QT_PLUGIN_PREFIX);
+ for (const QString &path: paths) {
+ if (!path.isEmpty()) {
+ app_libpaths->append(QDir::cleanPath(path + QDir::separator() + plugindir));
+ }
+ }
+
// If QCoreApplication is not yet instantiated,
// make sure we add the application path when we construct the QCoreApplication
if (self) self->d_func()->appendApplicationPathToLibraryPaths();

View File

@@ -0,0 +1,13 @@
--- a/src/tools/macdeployqt/shared/shared.cpp
+++ b/src/tools/macdeployqt/shared/shared.cpp
@@ -1280,6 +1280,10 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
if (!QFile::exists(qmlImportScannerPath))
qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner";
+ // Fallback: Pass qml import scanner via environment variable
+ if (!QFile::exists(qmlImportScannerPath))
+ qmlImportScannerPath = ::qgetenv("NIX_QMLIMPORTSCANNER");
+
// Verify that we found a qmlimportscanner binary
if (!QFile::exists(qmlImportScannerPath)) {
LogError() << "qmlimportscanner not found at" << qmlImportScannerPath;

View File

@@ -0,0 +1,13 @@
diff --git a/cmake/QtPublicSbomHelpers.cmake b/cmake/QtPublicSbomHelpers.cmake
index 3767fb4ff26..b642ea3e4b6 100644
--- a/cmake/QtPublicSbomHelpers.cmake
+++ b/cmake/QtPublicSbomHelpers.cmake
@@ -369,7 +369,7 @@ function(_qt_internal_setup_sbom)
endif()
option(QT_GENERATE_SBOM "Generate SBOM documents in SPDX v2.3 tag:value format."
- "${default_value}")
+ OFF)
string(CONCAT help_string
"Generate SBOM documents in SPDX v2.3 JSON format if required python dependency "

View File

@@ -0,0 +1,28 @@
--- a/cmake/QtFinishPrlFile.cmake
+++ b/cmake/QtFinishPrlFile.cmake
@@ -69,9 +69,10 @@ foreach(line ${lines})
endif()
list(APPEND adjusted_libs "-framework" "${CMAKE_MATCH_1}")
else()
- # Not a framework, transform the Qt module into relocatable relative path.
- qt_strip_library_version_suffix(relative_lib "${relative_lib}")
- list(APPEND adjusted_libs "$$[QT_INSTALL_LIBS]/${relative_lib}")
+ # Not a framework, extract the library name and prepend an -l to make
+ # it relocatable.
+ qt_transform_absolute_library_paths_to_link_flags(lib_with_link_flag "${lib}")
+ list(APPEND adjusted_libs "${lib_with_link_flag}")
endif()
endif()
else()
--- a/cmake/QtGenerateLibHelpers.cmake
+++ b/cmake/QtGenerateLibHelpers.cmake
@@ -82,9 +82,6 @@ function(qt_transform_absolute_library_paths_to_link_flags out_var library_path_
# If library_path isn't in default link directories, we should add it to link flags.
# But we shouldn't add it duplicately.
list(FIND IMPLICIT_LINK_DIRECTORIES_LOWER "${dir_lower}" index)
- if(index EQUAL -1 AND NOT "-L\"${dir}\"" IN_LIST out_list)
- list(APPEND out_list "-L\"${dir}\"")
- endif()
endif()
list(APPEND out_list "${lib_name_with_link_flag}")
else()

View File

@@ -0,0 +1,12 @@
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3412,8 +3412,7 @@ MakefileGenerator::writePkgConfigFile()
<< varGlue("QMAKE_PKGCONFIG_CFLAGS", "", " ", " ")
// << varGlue("DEFINES","-D"," -D"," ")
;
- if (!project->values("QMAKE_DEFAULT_INCDIRS").contains(includeDir))
- t << "-I${includedir}";
+ t << "-I${includedir}";
if (target_mode == TARG_MAC_MODE && project->isActiveConfig("lib_bundle")
&& libDir != QLatin1String("/Library/Frameworks")) {
t << " -F${libdir}";

View File

@@ -0,0 +1,16 @@
--- a/src/tools/macdeployqt/shared/shared.cpp
+++ b/src/tools/macdeployqt/shared/shared.cpp
@@ -1300,6 +1300,13 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
argumentList.append( "-importPath");
argumentList.append(qmlImportsPath);
+ // In a modularized installation of qt as we have in Nix, instead, we will
+ // read the paths from the environment, as they are spread in multiple
+ // locations and normally set in the environment like this
+ auto envQmlImportPaths = ::qgetenv("QML2_IMPORT_PATH").split(':');
+ for (const QString &importPath : envQmlImportPaths)
+ argumentList << "-importPath" << importPath;
+
// run qmlimportscanner
QProcess qmlImportScanner;
qmlImportScanner.start(qmlImportScannerPath, argumentList);

View File

@@ -0,0 +1,17 @@
--- a/src/tools/macdeployqt/shared/shared.cpp
+++ b/src/tools/macdeployqt/shared/shared.cpp
@@ -1300,9 +1300,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
}
for (const QString &importPath : qmlImportPaths)
argumentList << "-importPath" << importPath;
+
QString qmlImportsPath = QLibraryInfo::path(QLibraryInfo::QmlImportsPath);
- argumentList.append( "-importPath");
- argumentList.append(qmlImportsPath);
+ if (QFile::exists(qmlImportsPath)) {
+ argumentList.append( "-importPath");
+ argumentList.append(qmlImportsPath);
+ }
// In a modularized installation of qt as we have in Nix, instead, we will
// read the paths from the environment, as they are spread in multiple

View File

@@ -0,0 +1,34 @@
--- a/bin/qt-cmake-create.in
+++ b/bin/qt-cmake-create.in
@@ -7,12 +7,7 @@ HELP_MESSAGE="Usage
script_dir_path=`dirname $0`
script_dir_path=`(cd "$script_dir_path"; /bin/pwd)`
-# Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH.
-original_cmake_path="@CMAKE_COMMAND@"
-cmake_path=$original_cmake_path
-if ! test -f "$cmake_path"; then
- cmake_path="cmake"
-fi
+cmake_path="cmake"
if [ "$#" -gt 1 ]; then
echo "Invalid number of arguments"
diff --git a/bin/qt-cmake.in b/bin/qt-cmake.in
index f719257f602..571ffe788fa 100755
--- a/bin/qt-cmake.in
+++ b/bin/qt-cmake.in
@@ -4,12 +4,7 @@
script_dir_path=`dirname $0`
script_dir_path=`(cd "$script_dir_path"; /bin/pwd)`
-# Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH.
-original_cmake_path="@CMAKE_COMMAND@"
-cmake_path=$original_cmake_path
-if ! test -f "$cmake_path"; then
- cmake_path="cmake"
-fi
+cmake_path="cmake"
toolchain_path="$script_dir_path/@__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir@/qt.toolchain.cmake"