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,24 @@
{
lib,
stdenv,
qtModule,
qtbase,
qtdeclarative,
}:
qtModule {
pname = "qt3d";
propagatedBuildInputs = [
qtbase
qtdeclarative
];
outputs = [
"out"
"dev"
"bin"
];
# error: use of undeclared identifier 'stat64'
env.NIX_CFLAGS_COMPILE = lib.optionalString (
stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64
) "-Dstat64=stat";
}

View File

@@ -0,0 +1,586 @@
{
stdenv,
lib,
src,
patches,
version,
qtCompatVersion,
coreutils,
bison,
flex,
gdb,
gperf,
lndir,
perl,
pkg-config,
python3,
which,
# darwin support
apple-sdk_14,
xcbuild,
dbus,
fontconfig,
freetype,
glib,
harfbuzz,
icu,
libdrm,
libX11,
libXcomposite,
libXcursor,
libXext,
libXi,
libXrender,
libjpeg,
libpng,
libxcb,
libxkbcommon,
libxml2,
libxslt,
openssl,
pcre2,
sqlite,
udev,
xcbutil,
xcbutilimage,
xcbutilkeysyms,
xcbutilrenderutil,
xcbutilwm,
zlib,
at-spi2-core,
# optional dependencies
cups ? null,
libpq ? null,
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,
libmysqlclient,
buildExamples ? false,
buildTests ? false,
debug ? false,
developerBuild ? false,
decryptSslTraffic ? false,
testers,
buildPackages,
}:
let
debugSymbols = debug || developerBuild;
qtPlatformCross =
plat:
with plat;
if isLinux then
"linux-generic-g++"
else
throw "Please add a qtPlatformCross entry for ${plat.config}";
# Per https://doc.qt.io/qt-5/macos.html#supported-versions: build SDK = 13.x or 14.x.
darwinVersionInputs = [
apple-sdk_14
];
in
stdenv.mkDerivation (
finalAttrs:
(
{
pname = "qtbase";
inherit qtCompatVersion src version;
debug = debugSymbols;
propagatedBuildInputs = [
libxml2
libxslt
openssl
sqlite
zlib
# Text rendering
freetype
harfbuzz
icu
# Image formats
libjpeg
libpng
pcre2
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) (
[
dbus
glib
udev
# Text rendering
fontconfig
libdrm
# X11 libs
libX11
libXcomposite
libXext
libXi
libXrender
libxcb
libxkbcommon
xcbutil
xcbutilimage
xcbutilkeysyms
xcbutilrenderutil
xcbutilwm
]
++ lib.optional libGLSupported libGL
);
buildInputs = [
python3
at-spi2-core
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) (
lib.optional withLibinput libinput ++ lib.optional withGtk3 gtk3
)
++ lib.optional stdenv.hostPlatform.isDarwin darwinVersionInputs
++ lib.optional developerBuild gdb
++ lib.optional (cups != null) cups
++ lib.optional mysqlSupport libmysqlclient
++ lib.optional (libpq != null) libpq;
nativeBuildInputs = [
bison
flex
gperf
lndir
perl
pkg-config
which
]
++ lib.optionals mysqlSupport [ libmysqlclient ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ];
}
// lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) {
# `qtbase` expects to find `cc` (with no prefix) in the
# `$PATH`, so the following is needed even if
# `stdenv.buildPlatform.canExecute stdenv.hostPlatform`
depsBuildBuild = [ buildPackages.stdenv.cc ];
}
// {
propagatedNativeBuildInputs = [ lndir ];
strictDeps = true;
# libQt5Core links calls CoreFoundation APIs that call into the system ICU. Binaries linked
# against it will crash during build unless they can access `/usr/share/icu/icudtXXl.dat`.
propagatedSandboxProfile = lib.optionalString stdenv.hostPlatform.isDarwin ''
(allow file-read* (subpath "/usr/share/icu"))
'';
enableParallelBuilding = true;
outputs = [
"bin"
"dev"
"out"
];
inherit patches;
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"
. ${../hooks/move-qt-dev-tools.sh}
. ${../hooks/fix-qmake-libtool.sh}
'';
postPatch = ''
for prf in qml_plugin.prf qt_plugin.prf qt_docs.prf qml_module.prf create_cmake.prf; do
substituteInPlace "mkspecs/features/$prf" \
--subst-var qtPluginPrefix \
--subst-var qtQmlPrefix \
--subst-var qtDocPrefix
done
substituteInPlace configure --replace /bin/pwd pwd
substituteInPlace src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls
sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i mkspecs/*/*.conf
sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5Config.cmake.in
sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5CoreMacros.cmake
sed -i 's/NO_DEFAULT_PATH//' src/gui/Qt5GuiConfigExtras.cmake.in
sed -i '/PATHS.*NO_DEFAULT_PATH/ d' mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
# https://bugs.gentoo.org/803470
sed -i 's/-lpthread/-pthread/' mkspecs/common/linux.conf src/corelib/configure.json
patchShebangs ./bin
''
+ (
if stdenv.hostPlatform.isDarwin then
''
for file in \
configure \
mkspecs/features/mac/asset_catalogs.prf \
mkspecs/features/mac/default_pre.prf \
mkspecs/features/mac/sdk.mk \
mkspecs/features/mac/sdk.prf
do
substituteInPlace "$file" \
--replace-quiet /usr/bin/xcode-select '${lib.getExe' xcbuild "xcode-select"}' \
--replace-quiet /usr/bin/xcrun '${lib.getExe' xcbuild "xcrun"}' \
--replace-quiet /usr/libexec/PlistBuddy '${lib.getExe' xcbuild "PlistBuddy"}'
done
substituteInPlace configure \
--replace-fail /System/Library/Frameworks/Cocoa.framework "$SDKROOT/System/Library/Frameworks/Cocoa.framework"
substituteInPlace mkspecs/common/macx.conf \
--replace-fail 'CONFIG += ' 'CONFIG += no_default_rpath ' \
--replace-fail \
'QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13' \
"QMAKE_MACOSX_DEPLOYMENT_TARGET = $MACOSX_DEPLOYMENT_TARGET"
''
else
lib.optionalString libGLSupported ''
sed -i mkspecs/common/linux.conf \
-e "/^QMAKE_INCDIR_OPENGL/ s|$|${lib.getDev libGL}/include|" \
-e "/^QMAKE_LIBDIR_OPENGL/ s|$|${lib.getLib libGL}/lib|"
''
+ lib.optionalString (stdenv.hostPlatform.isx86_32 && stdenv.cc.isGNU) ''
sed -i mkspecs/common/gcc-base-unix.conf \
-e "/^QMAKE_LFLAGS_SHLIB/ s/-shared/-shared -static-libgcc/"
''
);
qtPluginPrefix = "lib/qt-${qtCompatVersion}/plugins";
qtQmlPrefix = "lib/qt-${qtCompatVersion}/qml";
qtDocPrefix = "share/doc/qt-${qtCompatVersion}";
setOutputFlags = false;
preConfigure = ''
export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PREFIX=\"$qtPluginPrefix\""
# paralellize compilation of qtmake, which happens within ./configure
export MAKEFLAGS+=" -j$NIX_BUILD_CORES"
./bin/syncqt.pl -version $version
''
+ lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
# QT's configure script will refuse to use pkg-config unless these two environment variables are set
export PKG_CONFIG_SYSROOT_DIR=/
export PKG_CONFIG_LIBDIR=${lib.getLib pkg-config}/lib
echo "QMAKE_LFLAGS=''${LDFLAGS}" >> mkspecs/devices/${qtPlatformCross stdenv.hostPlatform}/qmake.conf
echo "QMAKE_CFLAGS=''${CFLAGS}" >> mkspecs/devices/${qtPlatformCross stdenv.hostPlatform}/qmake.conf
echo "QMAKE_CXXFLAGS=''${CXXFLAGS}" >> mkspecs/devices/${qtPlatformCross stdenv.hostPlatform}/qmake.conf
'';
postConfigure = ''
qmakeCacheInjectNixOutputs() {
local cache="$1/.qmake.stash"
echo "qmakeCacheInjectNixOutputs: $cache"
if ! [ -f "$cache" ]; then
echo >&2 "qmakeCacheInjectNixOutputs: WARNING: $cache does not exist"
fi
cat >>"$cache" <<EOF
NIX_OUTPUT_BIN = $bin
NIX_OUTPUT_DEV = $dev
NIX_OUTPUT_OUT = $out
NIX_OUTPUT_DOC = $dev/$qtDocPrefix
NIX_OUTPUT_QML = $bin/$qtQmlPrefix
NIX_OUTPUT_PLUGIN = $bin/$qtPluginPrefix
EOF
}
find . -name '.qmake.conf' | while read conf; do
qmakeCacheInjectNixOutputs "$(dirname $conf)"
done
'';
env = {
NIX_CFLAGS_COMPILE = toString (
[
"-Wno-error=sign-compare" # freetype-2.5.4 changed signedness of some struct fields
]
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"-Wno-warn=free-nonheap-object"
"-Wno-free-nonheap-object"
"-w"
]
++ [
''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"''
''-DLIBRESOLV_SO="${stdenv.cc.libc.out}/lib/libresolv"''
''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"''
]
++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"''
++ lib.optional stdenv.hostPlatform.isLinux "-DUSE_X11"
++ lib.optionals withGtk3 [
''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"''
''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"''
]
++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC"
);
}
// lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) {
NIX_CFLAGS_COMPILE_FOR_BUILD = toString [
"-Wno-warn=free-nonheap-object"
"-Wno-free-nonheap-object"
"-w"
];
};
prefixKey = "-prefix ";
# PostgreSQL autodetection fails sporadically because Qt omits the "-lpq" flag
# if dependency paths contain the string "pq", which can occur in the hash.
# To prevent these failures, we need to override PostgreSQL detection.
PSQL_LIBS = lib.optionalString (libpq != null) "-L${libpq}/lib -lpq";
}
// lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) {
configurePlatforms = [ ];
}
// {
# TODO Remove obsolete and useless flags once the build will be totally mastered
configureFlags = [
"-plugindir $(out)/$(qtPluginPrefix)"
"-qmldir $(out)/$(qtQmlPrefix)"
"-docdir $(out)/$(qtDocPrefix)"
"-verbose"
"-confirm-license"
"-opensource"
"-release"
"-shared"
"-accessibility"
"-optimized-qmake"
# for separateDebugInfo
"-no-strip"
"-system-proxies"
"-pkg-config"
"-gui"
"-widgets"
"-opengl desktop"
"-icu"
"-L"
"${icu.out}/lib"
"-I"
"${icu.dev}/include"
"-pch"
]
++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"-device ${qtPlatformCross stdenv.hostPlatform}"
"-device-option CROSS_COMPILE=${stdenv.cc.targetPrefix}"
]
++ lib.optional debugSymbols "-debug"
++ lib.optionals developerBuild [
"-developer-build"
"-no-warnings-are-errors"
]
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"-no-warnings-are-errors"
]
++ (
if (!stdenv.hostPlatform.isx86_64) then
[
"-no-sse2"
]
else
[
"-sse2"
"${lib.optionalString (!stdenv.hostPlatform.sse3Support) "-no"}-sse3"
"${lib.optionalString (!stdenv.hostPlatform.ssse3Support) "-no"}-ssse3"
"${lib.optionalString (!stdenv.hostPlatform.sse4_1Support) "-no"}-sse4.1"
"${lib.optionalString (!stdenv.hostPlatform.sse4_2Support) "-no"}-sse4.2"
"${lib.optionalString (!stdenv.hostPlatform.avxSupport) "-no"}-avx"
"${lib.optionalString (!stdenv.hostPlatform.avx2Support) "-no"}-avx2"
]
)
++ [
"-no-mips_dsp"
"-no-mips_dspr2"
]
++ [
"-system-zlib"
"-L"
"${zlib.out}/lib"
"-I"
"${zlib.dev}/include"
"-system-libjpeg"
"-L"
"${libjpeg.out}/lib"
"-I"
"${libjpeg.dev}/include"
"-system-harfbuzz"
"-L"
"${harfbuzz.out}/lib"
"-I"
"${harfbuzz.dev}/include"
"-system-pcre"
"-openssl-linked"
"-L"
"${lib.getLib openssl}/lib"
"-I"
"${openssl.dev}/include"
"-system-sqlite"
''-${if mysqlSupport then "plugin" else "no"}-sql-mysql''
''-${if libpq != null then "plugin" else "no"}-sql-psql''
"-system-libpng"
"-make libs"
"-make tools"
''-${lib.optionalString (!buildExamples) "no"}make examples''
''-${lib.optionalString (!buildTests) "no"}make tests''
]
++ (
if stdenv.hostPlatform.isDarwin then
[
"-no-fontconfig"
"-no-framework"
"-no-rpath"
]
else
[
"-rpath"
]
++ [
"-xcb"
"-qpa xcb"
"-L"
"${libX11.out}/lib"
"-I"
"${libX11.out}/include"
"-L"
"${libXext.out}/lib"
"-I"
"${libXext.out}/include"
"-L"
"${libXrender.out}/lib"
"-I"
"${libXrender.out}/include"
''-${lib.optionalString (cups == null) "no-"}cups''
"-dbus-linked"
"-glib"
]
++ lib.optional withGtk3 "-gtk"
++ lib.optional withLibinput "-libinput"
++ [
"-inotify"
]
++ lib.optionals (cups != null) [
"-L"
"${cups.lib}/lib"
"-I"
"${cups.dev}/include"
]
++ lib.optionals mysqlSupport [
"-L"
"${libmysqlclient}/lib"
"-I"
"${libmysqlclient}/include"
]
++ lib.optional (withQttranslation && (qttranslations != null)) [
# depends on x11
"-translationdir"
"${qttranslations}/translations"
]
);
# Move selected outputs.
postInstall = ''
moveToOutput "mkspecs" "$dev"
'';
devTools = [
"bin/fixqt4headers.pl"
"bin/moc"
"bin/qdbuscpp2xml"
"bin/qdbusxml2cpp"
"bin/qlalr"
"bin/qmake"
"bin/rcc"
"bin/syncqt.pl"
"bin/uic"
];
postFixup = ''
# Don't retain build-time dependencies like gdb.
sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $dev/mkspecs/qconfig.pri
fixQtModulePaths "''${!outputDev}/mkspecs/modules"
fixQtBuiltinPaths "''${!outputDev}" '*.pr?'
# Move development tools to $dev
moveQtDevTools
moveToOutput bin "$dev"
# fixup .pc file (where to find 'moc' etc.)
sed -i "$dev/lib/pkgconfig/Qt5Core.pc" \
-e "/^host_bins=/ c host_bins=$dev/bin"
'';
dontStrip = debugSymbols;
setupHook = ../hooks/qtbase-setup-hook.sh;
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
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; [
qknight
ttuegel
periklis
bkchr
];
pkgConfigModules = [
"Qt5Concurrent"
"Qt5Core"
"Qt5DBus"
"Qt5Gui"
"Qt5Network"
"Qt5OpenGL"
"Qt5OpenGLExtensions"
"Qt5PrintSupport"
#"Qt5Qml"
#"Qt5QmlModels"
#"Qt5Quick"
#"Qt5QuickTest"
#"Qt5QuickWidgets"
"Qt5Sql"
"Qt5Test"
"Qt5Widgets"
"Qt5Xml"
];
platforms = platforms.unix;
};
}
)
)

View File

@@ -0,0 +1,18 @@
{
qtModule,
qtbase,
qtdeclarative,
}:
qtModule {
pname = "qtcharts";
propagatedBuildInputs = [
qtbase
qtdeclarative
];
outputs = [
"out"
"dev"
"bin"
];
}

View File

@@ -0,0 +1,22 @@
{
qtModule,
lib,
stdenv,
qtbase,
qtdeclarative,
bluez,
}:
qtModule {
pname = "qtconnectivity";
buildInputs = lib.optional stdenv.hostPlatform.isLinux bluez;
propagatedBuildInputs = [
qtbase
qtdeclarative
];
outputs = [
"out"
"dev"
"bin"
];
}

View File

@@ -0,0 +1,24 @@
{
lib,
stdenv,
qtModule,
qtbase,
qtdeclarative,
}:
qtModule {
pname = "qtdatavis3d";
propagatedBuildInputs = [
qtbase
qtdeclarative
];
outputs = [
"out"
"dev"
"bin"
];
# error: use of undeclared identifier 'stat64'
env.NIX_CFLAGS_COMPILE = lib.optionalString (
stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64
) "-Dstat64=stat";
}

View File

@@ -0,0 +1,36 @@
{
qtModule,
python3,
qtbase,
qtsvg,
}:
qtModule {
pname = "qtdeclarative";
propagatedBuildInputs = [
qtbase
qtsvg
];
nativeBuildInputs = [ python3 ];
outputs = [
"out"
"dev"
"bin"
];
preConfigure = ''
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QML2_IMPORT_PREFIX=\"$qtQmlPrefix\""
'';
configureFlags = [ "-qml-debug" ];
devTools = [
"bin/qml"
"bin/qmlcachegen"
"bin/qmleasing"
"bin/qmlimportscanner"
"bin/qmllint"
"bin/qmlmin"
"bin/qmlplugindump"
"bin/qmlprofiler"
"bin/qmlscene"
"bin/qmltestrunner"
];
}

View File

@@ -0,0 +1,7 @@
{ qtModule, qtdeclarative }:
qtModule {
pname = "qtdoc";
propagatedBuildInputs = [ qtdeclarative ];
outputs = [ "out" ];
}

View File

@@ -0,0 +1,20 @@
{
qtModule,
qtbase,
qtdeclarative,
pkg-config,
}:
qtModule {
pname = "qtgamepad";
propagatedBuildInputs = [
qtbase
qtdeclarative
];
nativeBuildInputs = [ pkg-config ];
outputs = [
"out"
"dev"
"bin"
];
}

View File

@@ -0,0 +1,10 @@
{ qtModule, qtdeclarative }:
qtModule {
pname = "qtgraphicaleffects";
propagatedBuildInputs = [ qtdeclarative ];
outputs = [
"out"
"dev"
];
}

View File

@@ -0,0 +1,24 @@
{
lib,
qtModule,
qtbase,
libwebp,
jasper,
libmng,
libtiff,
}:
qtModule {
pname = "qtimageformats";
propagatedBuildInputs = [
qtbase
libwebp
]
++ lib.optionals (!jasper.meta.broken) [
jasper
]
++ [
libmng
libtiff
];
}

View File

@@ -0,0 +1,34 @@
{
lib,
stdenv,
qtModule,
qtbase,
qtmultimedia,
}:
qtModule {
pname = "qtlocation";
propagatedBuildInputs = [
qtbase
qtmultimedia
];
outputs = [
"bin"
"out"
"dev"
];
# Clang 18 treats a non-const, narrowing conversion in an initializer list as an error,
# which results in a failure building a 3rd party dependency of qtlocation. Just suppress it.
env =
lib.optionalAttrs (stdenv.cc.isClang && (lib.versionAtLeast (lib.getVersion stdenv.cc) "18"))
{
NIX_CFLAGS_COMPILE = "-Wno-c++11-narrowing-const-reference";
};
qmakeFlags = lib.optionals stdenv.hostPlatform.isDarwin [
# boost uses std::auto_ptr which has been disabled in clang with libcxx
# This flag re-enables this feature
# https://libcxx.llvm.org/docs/UsingLibcxx.html#c-17-specific-configuration-macros
"QMAKE_CXXFLAGS+=-D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR"
"QMAKE_CXXFLAGS+=-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION"
];
}

View File

@@ -0,0 +1,13 @@
{
qtModule,
qtbase,
qtdeclarative,
}:
qtModule {
pname = "qtlottie";
propagatedBuildInputs = [
qtbase
qtdeclarative
];
}

View File

@@ -0,0 +1,14 @@
{
lib,
qtModule,
qtbase,
}:
qtModule {
pname = "qtmacextras";
propagatedBuildInputs = [ qtbase ];
meta = with lib; {
maintainers = with maintainers; [ periklis ];
platforms = platforms.darwin;
};
}

View File

@@ -0,0 +1,39 @@
{
qtModule,
lib,
stdenv,
qtbase,
qtdeclarative,
pkg-config,
alsa-lib,
gstreamer,
gst-plugins-base,
libpulseaudio,
wayland,
}:
qtModule {
pname = "qtmultimedia";
propagatedBuildInputs = [
qtbase
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
];
outputs = [
"bin"
"dev"
"out"
];
qmakeFlags = [ "GST_VERSION=1.0" ];
NIX_LDFLAGS = lib.optionalString (stdenv.hostPlatform.isDarwin) "-lobjc";
}

View File

@@ -0,0 +1,6 @@
{ qtModule, qtbase }:
qtModule {
pname = "qtnetworkauth";
propagatedBuildInputs = [ qtbase ];
}

View File

@@ -0,0 +1,28 @@
{
qtModule,
lib,
qtbase,
qtdeclarative,
}:
qtModule {
pname = "qtpim";
outputs = [
"out"
"dev"
];
propagatedBuildInputs = [
qtbase
qtdeclarative
];
qmakeFlags = [
"CONFIG+=git_build"
];
meta = {
maintainers = with lib.maintainers; [ OPNA2608 ];
};
}

View File

@@ -0,0 +1,19 @@
{
qtModule,
qtbase,
qtdeclarative,
qtserialport,
pkg-config,
openssl,
}:
qtModule {
pname = "qtpositioning";
propagatedBuildInputs = [
qtbase
qtdeclarative
qtserialport
];
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ];
}

View File

@@ -0,0 +1,13 @@
{
qtModule,
qtbase,
qtdeclarative,
}:
qtModule {
pname = "qtpurchasing";
propagatedBuildInputs = [
qtbase
qtdeclarative
];
}

View File

@@ -0,0 +1,15 @@
{
qtModule,
qtbase,
qtdeclarative,
openssl,
}:
qtModule {
pname = "qtquick3d";
propagatedBuildInputs = [
qtbase
qtdeclarative
];
buildInputs = [ openssl ];
}

View File

@@ -0,0 +1,6 @@
{ qtModule, qtdeclarative }:
qtModule {
pname = "qtquickcontrols";
propagatedBuildInputs = [ qtdeclarative ];
}

View File

@@ -0,0 +1,11 @@
{ qtModule, qtdeclarative }:
qtModule {
pname = "qtquickcontrols2";
propagatedBuildInputs = [ qtdeclarative ];
outputs = [
"out"
"dev"
"bin"
];
}

View File

@@ -0,0 +1,15 @@
{
qtModule,
qtbase,
qtdeclarative,
}:
qtModule {
pname = "qtremoteobjects";
propagatedBuildInputs = [
qtbase
qtdeclarative
];
# cycle is detected in build when adding "dev" "bin" too
outputs = [ "out" ];
}

View File

@@ -0,0 +1,13 @@
{
qtModule,
qtbase,
qttools,
}:
qtModule {
pname = "qtscript";
propagatedBuildInputs = [
qtbase
qttools
];
}

View File

@@ -0,0 +1,18 @@
{
qtModule,
qtbase,
qtdeclarative,
}:
qtModule {
pname = "qtscxml";
propagatedBuildInputs = [
qtbase
qtdeclarative
];
outputs = [
"out"
"dev"
"bin"
];
}

View File

@@ -0,0 +1,18 @@
{
qtModule,
qtbase,
qtdeclarative,
}:
qtModule {
pname = "qtsensors";
propagatedBuildInputs = [
qtbase
qtdeclarative
];
outputs = [
"out"
"dev"
"bin"
];
}

View File

@@ -0,0 +1,13 @@
{
qtModule,
qtbase,
qtserialport,
}:
qtModule {
pname = "qtserialbus";
propagatedBuildInputs = [
qtbase
qtserialport
];
}

View File

@@ -0,0 +1,13 @@
{
qtModule,
stdenv,
lib,
qtbase,
systemd,
}:
qtModule {
pname = "qtserialport";
propagatedBuildInputs = [ qtbase ];
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isLinux "-DNIXPKGS_LIBUDEV=\"${lib.getLib systemd}/lib/libudev\"";
}

View File

@@ -0,0 +1,18 @@
{
lib,
qtModule,
stdenv,
speechd-minimal,
pkg-config,
}:
qtModule {
pname = "qtspeech";
propagatedBuildInputs = [ ];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ speechd-minimal ];
nativeBuildInputs = [ pkg-config ];
outputs = [
"out"
"dev"
];
}

View File

@@ -0,0 +1,11 @@
{ qtModule, qtbase }:
qtModule {
pname = "qtsvg";
propagatedBuildInputs = [ qtbase ];
outputs = [
"out"
"dev"
"bin"
];
}

View File

@@ -0,0 +1,57 @@
{
qtModule,
stdenv,
lib,
bluez,
libevdev,
libX11,
pkg-config,
qtbase,
udev,
wrapQtAppsHook,
}:
qtModule {
pname = "qtsystems";
outputs = [
"out"
"dev"
]
++ lib.optionals stdenv.hostPlatform.isLinux [
"bin"
];
propagatedBuildInputs = [
qtbase
];
nativeBuildInputs = [
pkg-config
wrapQtAppsHook
];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
bluez
libevdev
libX11
udev
];
qmakeFlags = [
"CONFIG+=git_build"
]
++ lib.optionals stdenv.hostPlatform.isLinux [
"CONFIG+=ofono"
"CONFIG+=udisks"
"CONFIG+=upower"
];
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
wrapQtApp $bin/bin/servicefw
'';
meta = {
maintainers = with lib.maintainers; [ OPNA2608 ];
};
}

View File

@@ -0,0 +1,53 @@
From b54dd2923448f2ae7402cf2364f40337d6c3cb6d Mon Sep 17 00:00:00 2001
From: OPNA2608 <opna2608@protonmail.com>
Date: Wed, 7 Aug 2024 22:47:00 +0200
Subject: [PATCH] Patch QT_HOST_DATA references
---
src/linguist/linguist.pro | 2 +-
src/qdoc/qdoc.pro | 2 +-
src/qtattributionsscanner/qtattributionsscanner.pro | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/linguist/linguist.pro b/src/linguist/linguist.pro
index 7638c7710..bd8798818 100644
--- a/src/linguist/linguist.pro
+++ b/src/linguist/linguist.pro
@@ -47,7 +47,7 @@ contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
load(qt_build_paths)
cmake_linguist_config_file.input = $$PWD/Qt5LinguistToolsConfig.cmake.in
-cmake_linguist_config_version_file.input = $$[QT_HOST_DATA/src]/mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in
+cmake_linguist_config_version_file.input = @qtbaseDev@/mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in
cmake_linguist_macros_file.input = $$PWD/Qt5LinguistToolsMacros.cmake
CMAKE_PACKAGE_VERSION = $$MODULE_VERSION
cmake_linguist_config_file.output = $$MODULE_BASE_OUTDIR/lib/cmake/Qt5LinguistTools/Qt5LinguistToolsConfig.cmake
diff --git a/src/qdoc/qdoc.pro b/src/qdoc/qdoc.pro
index db4b25cf1..19592d50b 100644
--- a/src/qdoc/qdoc.pro
+++ b/src/qdoc/qdoc.pro
@@ -151,7 +151,7 @@ load(qt_build_paths)
equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe"
cmake_qdoc_config_file.input = $$PWD/Qt5DocToolsConfig.cmake.in
-cmake_qdoc_config_version_file.input = $$[QT_HOST_DATA/src]/mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in
+cmake_qdoc_config_version_file.input = @qtbaseDev@/mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in
CMAKE_PACKAGE_VERSION = $$MODULE_VERSION
cmake_qdoc_config_file.output = $$MODULE_BASE_OUTDIR/lib/cmake/Qt5DocTools/Qt5DocToolsConfig.cmake
cmake_qdoc_config_version_file.output = $$MODULE_BASE_OUTDIR/lib/cmake/Qt5DocTools/Qt5DocToolsConfigVersion.cmake
diff --git a/src/qtattributionsscanner/qtattributionsscanner.pro b/src/qtattributionsscanner/qtattributionsscanner.pro
index d645a22a9..5d4239f83 100644
--- a/src/qtattributionsscanner/qtattributionsscanner.pro
+++ b/src/qtattributionsscanner/qtattributionsscanner.pro
@@ -51,7 +51,7 @@ load(qt_build_paths)
equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe"
cmake_qattributionsscanner_config_file.input = $$PWD/Qt5AttributionsScannerTools.cmake.in
-cmake_qattributionsscanner_config_version_file.input = $$[QT_HOST_DATA/src]/mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in
+cmake_qattributionsscanner_config_version_file.input = @qtbaseDev@/mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in
CMAKE_PACKAGE_VERSION = $$MODULE_VERSION
cmake_qattributionsscanner_config_file.output = $$MODULE_BASE_OUTDIR/lib/cmake/Qt5AttributionsScannerTools/Qt5AttributionsScannerToolsConfig.cmake
cmake_qattributionsscanner_config_version_file.output = $$MODULE_BASE_OUTDIR/lib/cmake/Qt5AttributionsScannerTools/Qt5AttributionsScannerToolsConfigVersion.cmake
--
2.44.1

View File

@@ -0,0 +1,34 @@
From a1fb301a0b9b59f420454be1ebeb05ce0547da2c Mon Sep 17 00:00:00 2001
From: OPNA2608 <opna2608@protonmail.com>
Date: Fri, 6 Sep 2024 14:20:05 +0200
Subject: [PATCH] Patch includedir for libclang main header
---
src/qdoc/configure.pri | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qdoc/configure.pri b/src/qdoc/configure.pri
index 4f3d77603..8fe8bc439 100644
--- a/src/qdoc/configure.pri
+++ b/src/qdoc/configure.pri
@@ -71,7 +71,7 @@ defineTest(qtConfTest_libclang) {
LLVM_INSTALL_DIR = $$system("$$candidate --prefix 2>$$QMAKE_SYSTEM_NULL_DEVICE")
!isEmpty(LLVM_INSTALL_DIR) {
CLANG_INCLUDEPATH = $$system("$$candidate --includedir 2>/dev/null")
- LIBCLANG_MAIN_HEADER = $$CLANG_INCLUDEPATH/clang-c/Index.h
+ LIBCLANG_MAIN_HEADER = @libclangDev@/include/clang-c/Index.h
!exists($$LIBCLANG_MAIN_HEADER) {
!isEmpty(LLVM_INSTALL_DIR): \
qtLog("Cannot find libclang's main header file, candidate: $${LIBCLANG_MAIN_HEADER}.")
@@ -121,7 +121,7 @@ defineTest(qtConfTest_libclang) {
return(false)
}
- LIBCLANG_MAIN_HEADER = $$CLANG_INCLUDEPATH/clang-c/Index.h
+ LIBCLANG_MAIN_HEADER = @libclangDev@/include/clang-c/Index.h
!exists($$LIBCLANG_MAIN_HEADER) {
!isEmpty(LLVM_INSTALL_DIR): \
qtLog("Cannot find libclang's main header file, candidate: $${LIBCLANG_MAIN_HEADER}.")
--
2.44.1

View File

@@ -0,0 +1,68 @@
{
qtModule,
stdenv,
lib,
qtbase,
qtdeclarative,
replaceVars,
llvmPackages,
}:
qtModule {
pname = "qttools";
outputs = [
"out"
"dev"
"bin"
];
buildInputs = with llvmPackages; [
libclang
libllvm
];
propagatedBuildInputs = [
qtbase
qtdeclarative
];
patches = [
# fixQtBuiltinPaths overwrites builtin paths we should keep
(replaceVars ./qttools-QT_HOST_DATA-refs.patch {
qtbaseDev = lib.getDev qtbase;
})
(replaceVars ./qttools-libclang-main-header.patch {
libclangDev = lib.getDev llvmPackages.libclang;
})
];
devTools = [
"bin/qcollectiongenerator"
"bin/linguist"
"bin/assistant"
"bin/qdoc"
"bin/lconvert"
"bin/designer"
"bin/qtattributionsscanner"
"bin/lrelease"
"bin/lrelease-pro"
"bin/pixeltool"
"bin/lupdate"
"bin/lupdate-pro"
"bin/qtdiag"
"bin/qhelpgenerator"
"bin/qtplugininfo"
"bin/qthelpconverter"
"bin/lprodump"
"bin/qdistancefieldgenerator"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ "bin/macdeployqt" ];
env.NIX_CFLAGS_COMPILE = lib.optionalString (
stdenv.hostPlatform.isDarwin && qtdeclarative != null
) ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"'';
setupHook = ../hooks/qttools-setup-hook.sh;
}

View File

@@ -0,0 +1,7 @@
{ qtModule, qttools }:
qtModule {
pname = "qttranslations";
nativeBuildInputs = [ qttools ];
outputs = [ "out" ];
}

View File

@@ -0,0 +1,17 @@
{
qtModule,
qtbase,
qtdeclarative,
qtsvg,
hunspell,
}:
qtModule {
pname = "qtvirtualkeyboard";
propagatedBuildInputs = [
qtbase
qtdeclarative
qtsvg
hunspell
];
}

View File

@@ -0,0 +1,36 @@
Ensure that the correct `app_id` for Wayland is set. The upstream implementation
uses `QFileInfo::baseName()`[1] which strips everything away after the first dot.
This means that `.foo-wrapped` has an empty `app_id` because `baseName` returns
an empty string in this case.
The patch basically checks whether the program has the form `.foo-wrapped` (i.e. got
wrapped by `makeWrapper`) and if that's the case, `foo` will be the correct `app_id`.
[1] https://doc.qt.io/qt-5/qfileinfo.html#baseName
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index ba881cb..b3fd031 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -167,7 +167,20 @@ void QWaylandWindow::initWindow()
Qt::SkipEmptyParts);
if (domainName.isEmpty()) {
- mShellSurface->setAppId(fi.baseName());
+ auto baseName = fi.baseName();
+ if (baseName.isEmpty()) {
+ auto fileName = fi.fileName();
+ if (fileName.endsWith("-wrapped") && fileName.startsWith(".")) {
+ do {
+ auto len = fileName.length();
+ fileName = fileName.right(len - 1);
+ fileName = fileName.left(len - 9);
+ } while (fileName.endsWith("-wrapped") && fileName.startsWith("."));
+ mShellSurface->setAppId(fileName);
+ }
+ } else {
+ mShellSurface->setAppId(baseName);
+ }
} else {
QString appId;
for (int i = 0; i < domainName.count(); ++i)

View File

@@ -0,0 +1,34 @@
{
qtModule,
qtbase,
qtquickcontrols,
wayland,
wayland-scanner,
pkg-config,
lib,
}:
qtModule {
pname = "qtwayland";
propagatedBuildInputs = [
qtbase
qtquickcontrols
];
buildInputs = [ wayland ];
nativeBuildInputs = [
pkg-config
wayland-scanner
];
outputs = [
"out"
"dev"
"bin"
];
patches = [
# NixOS-specific, ensure that app_id is correctly determined for
# wrapped executables from `wrapQtAppsHook` (see comment in patch for further
# context).
./qtwayland-app_id.patch
];
meta.badPlatforms = lib.platforms.darwin;
}

View File

@@ -0,0 +1,20 @@
{
lib,
stdenv,
qtModule,
qtbase,
qtdeclarative,
}:
qtModule {
pname = "qtwebchannel";
propagatedBuildInputs = [
qtbase
qtdeclarative
];
outputs = [
"out"
"dev"
]
++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "bin" ];
}

View File

@@ -0,0 +1,11 @@
# From https://933368.bugs.gentoo.org/attachment.cgi?id=896907
--- ./src/3rdparty/chromium/qtwebengine/browser/pdf/BUILD.gn.orig 2024-07-03 13:49:13.812285886 +0100
+++ ./src/3rdparty/chromium/qtwebengine/browser/pdf/BUILD.gn 2024-07-03 13:51:45.789966941 +0100
@@ -6,6 +6,7 @@ source_set("pdf") {
]
deps = [
+ "//chrome/app:generated_resources",
"//content/public/browser",
]
}

View File

@@ -0,0 +1,25 @@
Backported from: <https://github.com/chromium/chromium/commit/f8f21fb4aa01f75acbb12abf5ea8c263c6817141.patch>
Original author: Daniel Richard G <iskunk@gmail.com>
diff --git a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py
index 5ee4905..6c500a0 100644
--- a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py
+++ b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py
@@ -36,10 +36,13 @@ def generate_gperf(gperf_path, gperf_input, gperf_args):
# https://savannah.gnu.org/bugs/index.php?53028
gperf_output = re.sub(r'\bregister ', '', gperf_output)
# -Wimplicit-fallthrough needs an explicit fallthrough statement,
- # so replace gperf's /*FALLTHROUGH*/ comment with the statement.
- # https://savannah.gnu.org/bugs/index.php?53029
- gperf_output = gperf_output.replace('/*FALLTHROUGH*/',
- ' FALLTHROUGH;')
+ # so replace gperf 3.1's /*FALLTHROUGH*/ comment with the statement.
+ # https://savannah.gnu.org/bugs/index.php?53029 (fixed in 3.2)
+ if re.search(
+ r'/\* C\+\+ code produced by gperf version 3\.[01](\.\d+)? \*/',
+ gperf_output):
+ gperf_output = gperf_output.replace('/*FALLTHROUGH*/',
+ ' [[fallthrough]];')
# -Wpointer-to-int-cast warns about casting pointers to smaller ints
# Replace {(int)(long)&(foo), bar} with
# {static_cast<int>(reinterpret_cast<uintptr_t>(&(foo)), bar}

View File

@@ -0,0 +1,519 @@
{
qtModule,
qtdeclarative,
qtquickcontrols,
qtlocation,
qtwebchannel,
fetchpatch,
fetchpatch2,
bison,
flex,
gperf,
ninja,
pkg-config,
python,
which,
nodejs,
perl,
buildPackages,
pkgsBuildTarget,
pkgsBuildBuild,
xorg,
libXcursor,
libXScrnSaver,
libXrandr,
libXtst,
fontconfig,
freetype,
harfbuzz,
icu,
dbus,
libdrm,
zlib,
minizip,
libjpeg,
libpng,
libtiff,
libwebp,
libopus,
jsoncpp,
protobuf,
libvpx,
srtp,
snappy,
nss,
libevent,
alsa-lib,
pulseaudio,
libcap,
pciutils,
systemd,
enableProprietaryCodecs ? true,
gn,
cctools,
cups,
bootstrap_cmds,
xcbuild,
writeScriptBin,
ffmpeg ? null,
lib,
stdenv,
version ? null,
qtCompatVersion,
pipewireSupport ? stdenv.hostPlatform.isLinux,
pipewire,
postPatch ? "",
nspr,
lndir,
}:
let
# qtwebengine expects to find an executable in $PATH which runs on
# the build platform yet knows about the host `.pc` files. Most
# configury allows setting $PKG_CONFIG to point to an
# arbitrarily-named script which serves this purpose; however QT
# insists that it is named `pkg-config` with no target prefix. So
# we re-wrap the host platform's pkg-config.
pkg-config-wrapped-without-prefix = stdenv.mkDerivation {
name = "pkg-config-wrapper-without-target-prefix";
dontUnpack = true;
dontBuild = true;
installPhase = ''
mkdir -p $out/bin
ln -s '${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config' $out/bin/pkg-config
'';
};
in
qtModule (
{
pname = "qtwebengine";
nativeBuildInputs = [
bison
flex
gperf
ninja
pkg-config
(python.withPackages (ps: [ ps.html5lib ]))
which
gn
nodejs
]
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
perl
lndir
(lib.getDev pkgsBuildTarget.targetPackages.qt5.qtbase)
pkgsBuildBuild.pkg-config
(lib.getDev pkgsBuildTarget.targetPackages.qt5.qtquickcontrols)
pkg-config-wrapped-without-prefix
]
++ lib.optional stdenv.hostPlatform.isDarwin [
bootstrap_cmds
xcbuild
];
doCheck = true;
outputs = [
"bin"
"dev"
"out"
];
enableParallelBuilding = true;
# Dont use the gn setup hook
dontUseGnConfigure = true;
# ninja builds some components with -Wno-format,
# which cannot be set at the same time as -Wformat-security
hardeningDisable = [ "format" ];
patches = [
# Support FFmpeg 5
(fetchpatch2 {
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/qt5-webengine/-/raw/14074e4d789167bd776939037fe6df8d4d7dc0b3/qt5-webengine-ffmpeg5.patch";
hash = "sha256-jTbJFXBPwRMzr8IeTxrv9dtS+/xDS/zR4dysV/bRg3I=";
stripLen = 1;
extraPrefix = "src/3rdparty/";
})
# Support FFmpeg 7
(fetchpatch2 {
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/qt5-webengine/-/raw/e8fb4f86104243b90966b69cdfaa967273d834b6/qt5-webengine-ffmpeg7.patch";
hash = "sha256-YNeHmOVp0M5HB+b91AOxxJxl+ktBtLYVdHlq13F7xtY=";
stripLen = 1;
extraPrefix = "src/3rdparty/chromium/";
})
# Support PipeWire ≥ 0.3
(fetchpatch2 {
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/qt5-webengine/-/raw/c9db2cd9e144bd7a5e9246f5f7a01fe52fd089ba/qt5-webengine-pipewire-0.3.patch";
hash = "sha256-mGexRfVDF3yjNzSi9BjavhzPtsXI0BooSr/rZ1z/BDo=";
stripLen = 1;
extraPrefix = "src/3rdparty/";
})
# Fix race condition exposed by missing dependency
# https://bugs.gentoo.org/933368
./qtwebengine-fix_build_pdf_extension_util.patch
# The latest version of Clang changed what macros it predefines on Apple
# targets, causing errors about predefined macros in zlib.
(fetchpatch2 {
url = "https://github.com/chromium/chromium/commit/2f39ac8d0a414dd65c0e1d5aae38c8f97aa06ae9.patch";
hash = "sha256-3kA2os0IntxIiJwzS5nPd7QWYlOWOpoLKYsOQFYv0Sk=";
stripLen = 1;
extraPrefix = "src/3rdparty/chromium/";
})
# The latest version of Clang changed what macros it predefines on Apple
# targets, causing errors about predefined macros in libpng.
(fetchpatch2 {
url = "https://github.com/chromium/chromium/commit/66defc14abe47c0494da9faebebfa0a5b6efcf38.patch";
hash = "sha256-ErS5Eycls5+xQLGYKz1r/tQC6IcRJWb/WoGsUyzO9WY=";
stripLen = 1;
extraPrefix = "src/3rdparty/chromium/";
})
# https://trac.macports.org/ticket/71563
# src/3rdparty/chromium/third_party/freetype/src/src/gzip/ftzconf.h:228:12: error: unknown type name 'Byte'
(fetchpatch2 {
url = "https://github.com/macports/macports-ports/raw/f9a4136c48020b01ecc6dffa99b88333c360f056/aqua/qt5/files/patch-qtwebengine-chromium-freetype-gzip.diff";
hash = "sha256-NeLmMfYMo80u3h+5GTenMANWfWLPeS35cKg+h3vzW4g=";
extraPrefix = "";
})
# src/3rdparty/chromium/base/process/process_metrics_mac.cc:303:17: error: static assertion expression is not an integral constant expression
(fetchpatch2 {
url = "https://github.com/macports/macports-ports/raw/f9a4136c48020b01ecc6dffa99b88333c360f056/aqua/qt5/files/patch-qtwebengine_chromium_static_page_size.diff";
hash = "sha256-8TFN5XU0SUvPJCFU6wvcKP5a8HCd0ygUnLT8BF4MZ/E=";
extraPrefix = "";
})
# Add "-target-feature +aes" to the arm crc32c build flags
(fetchpatch2 {
url = "https://github.com/chromium/chromium/commit/9f43d823b6b4cdea62f0cc7563ff01f9239b8970.patch";
hash = "sha256-2WCx+ZOWA8ZyV2yiSQLx9uFZOoeWQHxLqwLEZsV41QU=";
stripLen = 1;
extraPrefix = "src/3rdparty/chromium/";
})
# Fix build with clang and libc++ 19
# https://github.com/freebsd/freebsd-ports/commit/0ddd6468fb3cb9ba390973520517cb1ca2cd690d
(fetchpatch2 {
url = "https://github.com/freebsd/freebsd-ports/raw/0ddd6468fb3cb9ba390973520517cb1ca2cd690d/www/qt5-webengine/files/patch-libc++19";
hash = "sha256-pSVPnuEpjFHW60dbId5sZ3zHP709EWG4LSWoS+TkgcQ=";
extraPrefix = "";
})
(fetchpatch2 {
url = "https://github.com/freebsd/freebsd-ports/raw/0ddd6468fb3cb9ba390973520517cb1ca2cd690d/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_platform_wtf_hash__table.h";
hash = "sha256-+vyWC7Indd1oBhvL5fMTlIH4mM4INgISZFAbHsq32Lg=";
extraPrefix = "";
})
(fetchpatch2 {
url = "https://github.com/freebsd/freebsd-ports/raw/0ddd6468fb3cb9ba390973520517cb1ca2cd690d/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_tracing_internal_track__event__data__source.h";
hash = "sha256-DcAYOV9b30ogPCiedvQimEmiZpUJquk5j6WLjJxR54U=";
extraPrefix = "";
})
# Fix the build with gperf ≥ 3.2 and Clang 19.
./qtwebengine-gperf-3.2.patch
];
postPatch = ''
# Patch Chromium build tools
(
cd src/3rdparty/chromium;
patch -p1 < ${
(fetchpatch {
# support for building with python 3.12
name = "python312-six.patch";
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/qt5-webengine/-/raw/6b0c0e76e0934db2f84be40cb5978cee47266e78/python3.12-six.patch";
hash = "sha256-YgP9Sq5+zTC+U7+0hQjZokwb+fytk0UEIJztUXFhTkI=";
})
}
# Manually fix unsupported shebangs
substituteInPlace third_party/harfbuzz-ng/src/src/update-unicode-tables.make \
--replace "/usr/bin/env -S make -f" "/usr/bin/make -f" || true
# TODO: be more precise
patchShebangs .
)
''
# Prevent Chromium build script from making the path to `clang` relative to
# the build directory. `clang_base_path` is the value of `QMAKE_CLANG_DIR`
# from `src/core/config/mac_osx.pri`.
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace ./src/3rdparty/chromium/build/toolchain/mac/BUILD.gn \
--replace 'prefix = rebase_path("$clang_base_path/bin/", root_build_dir)' 'prefix = "$clang_base_path/bin/"'
''
# Patch library paths in Qt sources
+ ''
sed -i \
-e "s,QLibraryInfo::location(QLibraryInfo::DataPath),QLatin1String(\"$out\"),g" \
-e "s,QLibraryInfo::location(QLibraryInfo::TranslationsPath),QLatin1String(\"$out/translations\"),g" \
-e "s,QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath),QLatin1String(\"$out/libexec\"),g" \
src/core/web_engine_library_info.cpp
''
# Patch library paths in Chromium sources
+ lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${lib.getLib systemd}/lib/\1!' \
src/3rdparty/chromium/device/udev_linux/udev?_loader.cc
sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \
src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace src/buildtools/config/mac_osx.pri \
--replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"'
# Use system ffmpeg
echo "gn_args += use_system_ffmpeg=true" >> src/core/config/mac_osx.pri
echo "LIBS += -lavformat -lavcodec -lavutil" >> src/core/core_common.pri
''
+ postPatch;
env = {
NIX_CFLAGS_COMPILE = toString (
lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"-w "
]
++ lib.optionals stdenv.cc.isGNU [
# with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit
"-Wno-class-memaccess"
]
++ lib.optionals (stdenv.hostPlatform.gcc.arch or "" == "sandybridge") [
# it fails when compiled with -march=sandybridge https://github.com/NixOS/nixpkgs/pull/59148#discussion_r276696940
# TODO: investigate and fix properly
"-march=westmere"
]
++ lib.optionals stdenv.cc.isClang [
"-Wno-elaborated-enum-base"
# 5.15.17: need to silence these two warnings
# https://trac.macports.org/ticket/70850
"-Wno-enum-constexpr-conversion"
"-Wno-unused-but-set-variable"
# Clang 19
"-Wno-error=missing-template-arg-list-after-template-kw"
]
);
}
// lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) {
NIX_CFLAGS_LINK = "-Wl,--no-warn-search-mismatch";
"NIX_CFLAGS_LINK_${buildPackages.stdenv.cc.suffixSalt}" = "-Wl,--no-warn-search-mismatch";
};
preConfigure = ''
export NINJAFLAGS=-j$NIX_BUILD_CORES
if [ -d "$PWD/tools/qmake" ]; then
QMAKEPATH="$PWD/tools/qmake''${QMAKEPATH:+:}$QMAKEPATH"
fi
''
+ lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
export QMAKE_CC=$CC
export QMAKE_CXX=$CXX
export QMAKE_LINK=$CXX
export QMAKE_AR=$AR
'';
qmakeFlags = [
"--"
"-system-ffmpeg"
]
++ lib.optional (
pipewireSupport && stdenv.buildPlatform == stdenv.hostPlatform
) "-webengine-webrtc-pipewire"
++ lib.optional enableProprietaryCodecs "-proprietary-codecs";
propagatedBuildInputs = [
qtdeclarative
qtquickcontrols
qtlocation
qtwebchannel
# Image formats
libjpeg
libpng
libtiff
libwebp
# Video formats
srtp
libvpx
# Audio formats
libopus
# Text rendering
harfbuzz
icu
libevent
ffmpeg
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
dbus
zlib
minizip
snappy
nss
protobuf
jsoncpp
# Audio formats
alsa-lib
pulseaudio
# Text rendering
fontconfig
freetype
libcap
pciutils
# X11 libs
xorg.xrandr
libXScrnSaver
libXcursor
libXrandr
xorg.libpciaccess
libXtst
xorg.libXcomposite
xorg.libXdamage
libdrm
xorg.libxkbfile
]
++ lib.optionals pipewireSupport [
# Pipewire
pipewire
]
# FIXME These dependencies shouldn't be needed but can't find a way
# around it. Chromium pulls this in while bootstrapping GN.
++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools.libtool ];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
cups
# `sw_vers` is used by `src/3rdparty/chromium/build/config/mac/sdk_info.py`
# to get some information about the host platform.
(writeScriptBin "sw_vers" ''
#!${stdenv.shell}
while [ $# -gt 0 ]; do
case "$1" in
-buildVersion) echo "17E199";;
*) break ;;
esac
shift
done
'')
];
dontUseNinjaBuild = true;
dontUseNinjaInstall = true;
postInstall =
lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
mkdir -p $out/libexec
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
cat > $out/libexec/qt.conf <<EOF
[Paths]
Prefix = ..
EOF
''
+ ''
# Fix for out-of-sync QtWebEngine and Qt releases (since 5.15.3)
sed 's/${lib.head (lib.splitString "-" version)} /${qtCompatVersion} /' -i "$out"/lib/cmake/*/*Config.cmake
'';
requiredSystemFeatures = [ "big-parallel" ];
meta = with lib; {
description = "Web engine based on the Chromium web browser";
mainProgram = "qwebengine_convert_dict";
maintainers = with maintainers; [ matthewbauer ];
# qtwebengine-5.15.8: "QtWebEngine can only be built for x86,
# x86-64, ARM, Aarch64, and MIPSel architectures."
platforms =
with lib.systems.inspect.patterns;
let
inherit (lib.systems.inspect) patternLogicalAnd;
in
concatMap (patternLogicalAnd isUnix) (
lib.concatMap lib.toList [
isx86_32
isx86_64
isAarch32
isAarch64
(patternLogicalAnd isMips isLittleEndian)
]
);
# This build takes a long time; particularly on slow architectures
timeout = 24 * 3600;
knownVulnerabilities = [
''
qt5 qtwebengine is unmaintained upstream since april 2025.
It is based on chromium 87.0.4280.144, and supposedly patched up to 135.0.7049.95 which is outdated.
Security issues are frequently discovered in chromium.
The following list of CVEs was fixed in the life cycle of chromium 138 and likely also affects qtwebengine:
- CVE-2025-8879
- CVE-2025-8880
- CVE-2025-8901
- CVE-2025-8881
- CVE-2025-8882
- CVE-2025-8576
- CVE-2025-8577
- CVE-2025-8578
- CVE-2025-8579
- CVE-2025-8580
- CVE-2025-8581
- CVE-2025-8582
- CVE-2025-8583
- CVE-2025-8292
- CVE-2025-8010
- CVE-2025-8011
- CVE-2025-7656
- CVE-2025-6558 (known to be exploited in the wild)
- CVE-2025-7657
- CVE-2025-6554
- CVE-2025-6555
- CVE-2025-6556
- CVE-2025-6557
The actual list of CVEs affecting qtwebengine is likely much longer,
as this list is missing issues fixed in chromium 136/137 and even more
issues are continuously discovered and lack upstream fixes in qtwebengine.
''
];
};
}
// lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) {
configurePlatforms = [ ];
# to get progress output in `nix-build` and `nix build -L`
preBuild = ''
export TERM=dumb
'';
depsBuildBuild = [
pkgsBuildBuild.stdenv
zlib
nss
nspr
];
}
)

View File

@@ -0,0 +1,13 @@
{
qtModule,
qtbase,
qtwebsockets,
}:
qtModule {
pname = "qtwebglplugin";
propagatedBuildInputs = [
qtbase
qtwebsockets
];
}

View File

@@ -0,0 +1,118 @@
{
qtModule,
stdenv,
lib,
fetchurl,
qtbase,
qtdeclarative,
qtlocation,
qtmultimedia,
qtsensors,
qtwebchannel,
fontconfig,
libwebp,
libxml2,
libxslt,
sqlite,
systemd,
glib,
gst_all_1,
cmake,
bison,
flex,
gdb,
gperf,
perl,
pkg-config,
python3,
ruby,
}:
let
hyphen = stdenv.mkDerivation rec {
pname = "hyphen";
version = "2.8.8";
src = fetchurl {
url = "http://dev-www.libreoffice.org/src/5ade6ae2a99bc1e9e57031ca88d36dad-hyphen-${version}.tar.gz";
sha256 = "304636d4eccd81a14b6914d07b84c79ebb815288c76fe027b9ebff6ff24d5705";
};
postPatch = ''
patchShebangs tests
'';
buildInputs = [ perl ];
};
in
qtModule {
pname = "qtwebkit";
propagatedBuildInputs = [
qtbase
qtdeclarative
qtlocation
qtsensors
qtwebchannel
]
++ lib.optional stdenv.hostPlatform.isDarwin qtmultimedia;
buildInputs = [
fontconfig
libwebp
libxml2
libxslt
sqlite
glib
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
hyphen
];
nativeBuildInputs = [
bison
flex
gdb
gperf
perl
pkg-config
python3
ruby
cmake
];
cmakeFlags = [
"-DPORT=Qt"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
"-DQt5Multimedia_DIR=${lib.getDev qtmultimedia}/lib/cmake/Qt5Multimedia"
"-DQt5MultimediaWidgets_DIR=${lib.getDev qtmultimedia}/lib/cmake/Qt5MultimediaWidgets"
"-DMACOS_FORCE_SYSTEM_XML_LIBRARIES=OFF"
];
env.NIX_CFLAGS_COMPILE = toString (
[
# with gcc7 this warning blows the log over Hydra's limit
"-Wno-expansion-to-defined"
]
# with gcc8, -Wclass-memaccess became part of -Wall and this too exceeds the logging limit
++ lib.optional stdenv.cc.isGNU "-Wno-class-memaccess"
# with clang this warning blows the log over Hydra's limit
++ lib.optional stdenv.hostPlatform.isDarwin "-Wno-inconsistent-missing-override"
++ lib.optional (
!stdenv.hostPlatform.isDarwin
) ''-DNIXPKGS_LIBUDEV="${lib.getLib systemd}/lib/libudev"''
);
doCheck = false; # fails 13 out of 13 tests (ctest)
# remove forbidden references to $TMPDIR
preFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$out"/libexec/*
'';
enableParallelBuilding = true;
meta = {
maintainers = with lib.maintainers; [
periklis
];
knownVulnerabilities = [
"QtWebkit upstream is unmaintained and receives no security updates, see https://blogs.gnome.org/mcatanzaro/2022/11/04/stop-using-qtwebkit/"
];
};
}

View File

@@ -0,0 +1,18 @@
{
qtModule,
qtbase,
qtdeclarative,
}:
qtModule {
pname = "qtwebsockets";
propagatedBuildInputs = [
qtbase
qtdeclarative
];
outputs = [
"out"
"dev"
"bin"
];
}

View File

@@ -0,0 +1,21 @@
{
lib,
stdenv,
qtModule,
qtdeclarative,
qtwebengine,
}:
qtModule {
pname = "qtwebview";
propagatedBuildInputs = [
qtdeclarative
qtwebengine
];
outputs = [
"out"
"dev"
"bin"
];
NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-framework CoreFoundation -framework WebKit";
}

View File

@@ -0,0 +1,6 @@
{ qtModule, qtbase }:
qtModule {
pname = "qtx11extras";
propagatedBuildInputs = [ qtbase ];
}

View File

@@ -0,0 +1,17 @@
{
qtModule,
qtbase,
qtdeclarative,
}:
qtModule {
pname = "qtxmlpatterns";
propagatedBuildInputs = [
qtbase
qtdeclarative
];
devTools = [
"bin/xmlpatterns"
"bin/xmlpatternsvalidator"
];
}