diff --git a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix index b5b30b083486..df86ccd062bb 100644 --- a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix @@ -1,5 +1,4 @@ -{ mkDerivation -, lib +{ lib , fetchFromGitHub , callPackage , pkg-config @@ -10,9 +9,10 @@ , wrapQtAppsHook , extra-cmake-modules , qtbase +, qtsvg , qtimageformats +, qt5compat , gtk3 -, kwayland , libdbusmenu , lz4 , xxHash @@ -70,7 +70,7 @@ let in env.mkDerivation rec { pname = "telegram-desktop"; - version = "3.6.0"; + version = "3.7.3"; # Note: Update via pkgs/applications/networking/instant-messengers/telegram/tdesktop/update.py # Telegram-Desktop with submodules @@ -79,17 +79,9 @@ env.mkDerivation rec { repo = "tdesktop"; rev = "v${version}"; fetchSubmodules = true; - sha256 = "0zcjm08nfdlxrsv0fi6dqg3lk52bcvsxnsf6jm5fv6gf5v9ia3hq"; + sha256 = "01b3nrhfbxhq4w63nsjnrhyfsdq3fm4l7sfkasbh8ib4qk3c9vwz"; }; - patches = [ - # fix build with KWayland 5.94+ - # cf. https://invent.kde.org/frameworks/kwayland/-/commit/de442e4a94e249a29cf2e005db8e0a5e4a6a13ed - # upstream bug: https://github.com/telegramdesktop/tdesktop/issues/24375 - # FIXME remove when no longer necessary - ./kf594.diff - ]; - postPatch = '' substituteInPlace Telegram/CMakeLists.txt \ --replace '"''${TDESKTOP_LAUNCHER_BASENAME}.appdata.xml"' '"''${TDESKTOP_LAUNCHER_BASENAME}.metainfo.xml"' @@ -120,9 +112,10 @@ env.mkDerivation rec { buildInputs = [ qtbase + qtsvg qtimageformats + qt5compat gtk3 - kwayland libdbusmenu lz4 xxHash @@ -166,8 +159,6 @@ env.mkDerivation rec { "-DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c" # See: https://github.com/NixOS/nixpkgs/pull/130827#issuecomment-885212649 "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF" - # TODO: Remove once QT6 is available in nixpkgs - "-DDESKTOP_APP_QT6=OFF" ]; postFixup = '' diff --git a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/kf594.diff b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/kf594.diff deleted file mode 100644 index 0fa2d8bc8f6e..000000000000 --- a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/kf594.diff +++ /dev/null @@ -1,57 +0,0 @@ -diff --git a/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp b/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp -index 7641579aa..3c195e397 100644 ---- a/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp -+++ b/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp -@@ -9,10 +9,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - - #include "base/platform/base_platform_info.h" - --#include --#include --#include --#include -+#include -+#include -+#include -+#include - - using namespace KWayland::Client; - -Submodule Telegram/lib_base contains modified content -diff --git a/Telegram/lib_base/base/platform/linux/base_linux_wayland_integration.cpp b/Telegram/lib_base/base/platform/linux/base_linux_wayland_integration.cpp -index 32f0de6..30a087f 100644 ---- a/Telegram/lib_base/base/platform/linux/base_linux_wayland_integration.cpp -+++ b/Telegram/lib_base/base/platform/linux/base_linux_wayland_integration.cpp -@@ -13,11 +13,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - #include - #include - --#include --#include --#include --#include --#include -+#include -+#include -+#include -+#include -+#include - - using namespace KWayland::Client; - -Submodule Telegram/lib_ui contains modified content -diff --git a/Telegram/lib_ui/ui/platform/linux/ui_linux_wayland_integration.cpp b/Telegram/lib_ui/ui/platform/linux/ui_linux_wayland_integration.cpp -index 01f1e80..163cb6a 100644 ---- a/Telegram/lib_ui/ui/platform/linux/ui_linux_wayland_integration.cpp -+++ b/Telegram/lib_ui/ui/platform/linux/ui_linux_wayland_integration.cpp -@@ -24,8 +24,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - #include - #include - --#include --#include -+#include -+#include - - Q_DECLARE_METATYPE(QMargins); - diff --git a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/tg_owt.nix b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/tg_owt.nix index 200e0e887e3e..bb0798953146 100644 --- a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/tg_owt.nix +++ b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/tg_owt.nix @@ -9,13 +9,13 @@ stdenv.mkDerivation { pname = "tg_owt"; - version = "unstable-2022-02-25"; + version = "unstable-2022-04-14"; src = fetchFromGitHub { owner = "desktop-app"; repo = "tg_owt"; - rev = "a264028ec71d9096e0aa629113c49c25db89d260"; - sha256 = "10p3x8z3ps8s1ivi9y8px2gsg4pvsvz6g9wbgh5w8hilikxqq7r5"; + rev = "63a934db1ed212ebf8aaaa20f0010dd7b0d7b396"; + sha256 = "sha256-WddSsQ9KW1zYyYckzdUOvfFZArYAbyvXmABQNMtK6cM="; fetchSubmodules = true; }; diff --git a/pkgs/build-support/fetchurl/mirrors.nix b/pkgs/build-support/fetchurl/mirrors.nix index 2c6ba2b02448..d69468958276 100644 --- a/pkgs/build-support/fetchurl/mirrors.nix +++ b/pkgs/build-support/fetchurl/mirrors.nix @@ -165,6 +165,11 @@ "https://ftp.postgresql.org/pub/" ]; + # Qt + qt = [ + "https://download.qt.io/" + ]; + # Roy marples mirrors roy = [ "https://roy.marples.name/downloads/" diff --git a/pkgs/development/libraries/qt-6/cmake.patch b/pkgs/development/libraries/qt-6/cmake.patch new file mode 100644 index 000000000000..1fb2ea26c35d --- /dev/null +++ b/pkgs/development/libraries/qt-6/cmake.patch @@ -0,0 +1,129 @@ +commit 4f497c358e0386b65df1c1d636aadf72f8647134 +Author: Nick Cao +Date: Tue Apr 19 13:49:59 2022 +0800 + + patch cmake file generation for nixpkgs packaging + + As of qt 6.3.0, installing components into different prefixes is not + supported. To workaround that, we move files to their designated in the + postInstall hook. However the generated cmake files still have + references to the original prefix, and would cause issues when using + said components as the dependency of other packages. The purpose of this + patch is to closely match the output layout of qt, and rewrite the + generated cmake files to point to the corrected pathes. + +diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx +index 8b0f64e23b..03291e2ee2 100644 +--- a/Source/cmExportFileGenerator.cxx ++++ b/Source/cmExportFileGenerator.cxx +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + + #include + +@@ -325,9 +326,23 @@ static void prefixItems(std::string& exportDirs) + for (std::string const& e : entries) { + exportDirs += sep; + sep = ";"; +- if (!cmSystemTools::FileIsFullPath(e) && +- e.find("${_IMPORT_PREFIX}") == std::string::npos) { +- exportDirs += "${_IMPORT_PREFIX}/"; ++ if (!cmSystemTools::FileIsFullPath(e)) { ++ if (std::getenv("dev")) { ++ if (cmHasLiteralPrefix(e, "include") || cmHasLiteralPrefix(e, "./include")) { ++ exportDirs += std::getenv("dev"); ++ } else if (cmHasLiteralPrefix(e, "bin") || cmHasLiteralPrefix(e, "./bin")) { ++ exportDirs += std::getenv("dev"); ++ } else if (cmHasLiteralPrefix(e, "mkspecs") || cmHasLiteralPrefix(e, "./mkspecs")) { ++ exportDirs += std::getenv("dev"); ++ } else if (cmHasLiteralPrefix(e, "libexec") || cmHasLiteralPrefix(e, "./libexec")) { ++ exportDirs += std::getenv("dev"); ++ } else { ++ exportDirs += std::getenv("out"); ++ } ++ } else { ++ exportDirs += std::getenv("out"); ++ } ++ exportDirs += "/"; + } + exportDirs += e; + } +diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx +index 4a3c565bce..5afa9e5e50 100644 +--- a/Source/cmExportInstallFileGenerator.cxx ++++ b/Source/cmExportInstallFileGenerator.cxx +@@ -5,6 +5,7 @@ + #include + #include + #include ++#include + + #include "cmExportSet.h" + #include "cmGeneratedFileStream.h" +@@ -263,7 +264,7 @@ void cmExportInstallFileGenerator::LoadConfigFiles(std::ostream& os) + + void cmExportInstallFileGenerator::ReplaceInstallPrefix(std::string& input) + { +- cmGeneratorExpression::ReplaceInstallPrefix(input, "${_IMPORT_PREFIX}"); ++ cmGeneratorExpression::ReplaceInstallPrefix(input, std::getenv("out")); + } + + bool cmExportInstallFileGenerator::GenerateImportFileConfig( +@@ -381,9 +382,24 @@ void cmExportInstallFileGenerator::SetImportLocationProperty( + // Construct the installed location of the target. + std::string dest = itgen->GetDestination(config); + std::string value; ++ + if (!cmSystemTools::FileIsFullPath(dest)) { +- // The target is installed relative to the installation prefix. +- value = "${_IMPORT_PREFIX}/"; ++ if (std::getenv("dev")) { ++ if (cmHasLiteralPrefix(dest, "include") || cmHasLiteralPrefix(dest, "./include")) { ++ value = std::getenv("dev"); ++ } else if (cmHasLiteralPrefix(dest, "bin") || cmHasLiteralPrefix(dest, "./bin")) { ++ value = std::getenv("dev"); ++ } else if (cmHasLiteralPrefix(dest, "mkspecs") || cmHasLiteralPrefix(dest, "./mkspecs")) { ++ value = std::getenv("dev"); ++ } else if (cmHasLiteralPrefix(dest, "libexec") || cmHasLiteralPrefix(dest, "./libexec")) { ++ value = std::getenv("dev"); ++ } else { ++ value = std::getenv("out"); ++ } ++ } else { ++ value = std::getenv("out"); ++ } ++ value += "/"; + } + value += dest; + value += "/"; +diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx +index 840f5112d6..7bb4ab41aa 100644 +--- a/Source/cmGeneratorExpression.cxx ++++ b/Source/cmGeneratorExpression.cxx +@@ -197,7 +197,22 @@ static void prefixItems(const std::string& content, std::string& result, + sep = ";"; + if (!cmSystemTools::FileIsFullPath(e) && + cmGeneratorExpression::Find(e) != 0) { +- result += prefix; ++ if (std::getenv("dev")) { ++ if (cmHasLiteralPrefix(e, "include") || cmHasLiteralPrefix(e, "./include")) { ++ result += std::getenv("dev"); ++ } else if (cmHasLiteralPrefix(e, "bin") || cmHasLiteralPrefix(e, "./bin")) { ++ result += std::getenv("dev"); ++ } else if (cmHasLiteralPrefix(e, "mkspecs") || cmHasLiteralPrefix(e, "./mkspecs")) { ++ result += std::getenv("dev"); ++ } else if (cmHasLiteralPrefix(e, "libexec") || cmHasLiteralPrefix(e, "./libexec")) { ++ result += std::getenv("dev"); ++ } else { ++ result += std::getenv("out"); ++ } ++ } else { ++ result += std::getenv("out"); ++ } ++ result += "/"; + } + result += e; + } diff --git a/pkgs/development/libraries/qt-6/default.nix b/pkgs/development/libraries/qt-6/default.nix new file mode 100644 index 000000000000..231c82cf6e76 --- /dev/null +++ b/pkgs/development/libraries/qt-6/default.nix @@ -0,0 +1,94 @@ +{ newScope +, lib +, stdenv +, fetchurl +, fetchgit +, fetchpatch +, fetchFromGitHub +, makeSetupHook +, makeWrapper +, bison +, cups +, harfbuzz +, libGL +, perl +, cmake +, ninja +, writeText +, gstreamer +, gst-plugins-base +, gtk3 +, dconf + + # options +, developerBuild ? false +, debug ? false +}: + +let + srcs = import ./srcs.nix { + inherit fetchurl; + mirror = "mirror://qt"; + }; + + qtModule = + import ./qtModule.nix + { inherit stdenv lib perl cmake ninja writeText; } + { inherit self srcs; }; + + addPackages = self: with self; + let + callPackage = self.newScope { inherit qtModule srcs; }; + in + { + + inherit callPackage qtModule srcs; + + qtbase = callPackage ./modules/qtbase.nix { + withGtk3 = true; + inherit (srcs.qtbase) src version; + inherit bison cups harfbuzz libGL dconf gtk3 developerBuild cmake; + }; + + qt3d = callPackage ./modules/qt3d.nix { }; + qt5compat = callPackage ./modules/qt5compat.nix { }; + qtcharts = callPackage ./modules/qtcharts.nix { }; + qtconnectivity = callPackage ./modules/qtconnectivity.nix { }; + qtdatavis3d = callPackage ./modules/qtdatavis3d.nix { }; + qtdeclarative = callPackage ./modules/qtdeclarative.nix { }; + qtdoc = callPackage ./modules/qtdoc.nix { }; + qtimageformats = callPackage ./modules/qtimageformats.nix { }; + qtlanguageserver = callPackage ./modules/qtlanguageserver.nix { }; + qtlottie = callPackage ./modules/qtlottie.nix { }; + qtmultimedia = callPackage ./modules/qtmultimedia.nix { + inherit gstreamer gst-plugins-base; + }; + qtnetworkauth = callPackage ./modules/qtnetworkauth.nix { }; + qtpositioning = callPackage ./modules/qtpositioning.nix { }; + qtsensors = callPackage ./modules/qtsensors.nix { }; + qtserialbus = callPackage ./modules/qtserialbus.nix { }; + qtserialport = callPackage ./modules/qtserialport.nix { }; + qtshadertools = callPackage ./modules/qtshadertools.nix { }; + qtquick3d = callPackage ./modules/qtquick3d.nix { }; + qtquicktimeline = callPackage ./modules/qtquicktimeline.nix { }; + qtremoteobjects = callPackage ./modules/qtremoteobjects.nix { }; + qtsvg = callPackage ./modules/qtsvg.nix { }; + qtscxml = callPackage ./modules/qtscxml.nix { }; + qttools = callPackage ./modules/qttools.nix { }; + qttranslations = callPackage ./modules/qttranslations.nix { }; + qtvirtualkeyboard = callPackage ./modules/qtvirtualkeyboard.nix { }; + qtwayland = callPackage ./modules/qtwayland.nix { }; + qtwebchannel = callPackage ./modules/qtwebchannel.nix { }; + qtwebengine = callPackage ./modules/qtwebengine.nix { }; + qtwebsockets = callPackage ./modules/qtwebsockets.nix { }; + qtwebview = callPackage ./modules/qtwebview.nix { }; + + wrapQtAppsHook = makeSetupHook + { + deps = [ self.qtbase.dev self.qtwayland.dev makeWrapper ]; + } ./hooks/wrap-qt-apps-hook.sh; + }; + + self = lib.makeScope newScope addPackages; +in +self diff --git a/pkgs/development/libraries/qt-6/fetch.sh b/pkgs/development/libraries/qt-6/fetch.sh new file mode 100644 index 000000000000..19cfebaa28b6 --- /dev/null +++ b/pkgs/development/libraries/qt-6/fetch.sh @@ -0,0 +1 @@ +WGET_ARGS=( http://download.qt.io/official_releases/qt/6.3/6.3.0/submodules/ -A '*.tar.xz' ) diff --git a/pkgs/development/libraries/qt-6/hooks/qtbase-setup-hook.sh b/pkgs/development/libraries/qt-6/hooks/qtbase-setup-hook.sh new file mode 100644 index 000000000000..0ae969e8f8fc --- /dev/null +++ b/pkgs/development/libraries/qt-6/hooks/qtbase-setup-hook.sh @@ -0,0 +1,43 @@ +if [[ -n "${__nix_qtbase-}" ]]; then + # Throw an error if a different version of Qt was already set up. + if [[ "$__nix_qtbase" != "@dev@" ]]; then + echo >&2 "Error: detected mismatched Qt dependencies:" + echo >&2 " @dev@" + echo >&2 " $__nix_qtbase" + exit 1 + fi +else # Only set up Qt once. +__nix_qtbase="@dev@" + +qtPluginPrefix=@qtPluginPrefix@ +qtQmlPrefix=@qtQmlPrefix@ + +# Disable debug symbols if qtbase was built without debugging. +# This stops -dev paths from leaking into other outputs. +if [ -z "@debug@" ]; then + NIX_CFLAGS_COMPILE="${NIX_CFLAGS_COMPILE-}${NIX_CFLAGS_COMPILE:+ }-DQT_NO_DEBUG" +fi + +# Integration with CMake: +# Set the CMake build type corresponding to how qtbase was built. +if [ -n "@debug@" ]; then + cmakeBuildType="Debug" +else + cmakeBuildType="Release" +fi + +qtPreHook() { + # Check that wrapQtAppsHook is used, or it is explicitly disabled. + if [[ -z "$__nix_wrapQtAppsHook" && -z "$dontWrapQtApps" ]]; then + echo >&2 "Error: wrapQtAppsHook is not used, and dontWrapQtApps is not set." + exit 1 + fi +} +prePhases+=" qtPreHook" + +addQtModulePrefix () { + addToSearchPath QT_ADDITIONAL_PACKAGES_PREFIX_PATH $1 +} +addEnvHooks "$hostOffset" addQtModulePrefix + +fi diff --git a/pkgs/development/libraries/qt-6/hooks/wrap-qt-apps-hook.sh b/pkgs/development/libraries/qt-6/hooks/wrap-qt-apps-hook.sh new file mode 100644 index 000000000000..c085cdaca52e --- /dev/null +++ b/pkgs/development/libraries/qt-6/hooks/wrap-qt-apps-hook.sh @@ -0,0 +1,107 @@ +if [[ -z "${__nix_wrapQtAppsHook-}" ]]; then +__nix_wrapQtAppsHook=1 # Don't run this hook more than once. + +# Inherit arguments given in mkDerivation +qtWrapperArgs=( ${qtWrapperArgs-} ) + +qtHostPathSeen=() + +qtUnseenHostPath() { + for pkg in "${qtHostPathSeen[@]}" + do + if [ "${pkg:?}" == "$1" ] + then + return 1 + fi + done + + qtHostPathSeen+=("$1") + return 0 +} + +qtHostPathHook() { + qtUnseenHostPath "$1" || return 0 + + local pluginDir="$1/${qtPluginPrefix:?}" + if [ -d "$pluginDir" ] + then + qtWrapperArgs+=(--prefix QT_PLUGIN_PATH : "$pluginDir") + fi + + local qmlDir="$1/${qtQmlPrefix:?}" + if [ -d "$qmlDir" ] + then + qtWrapperArgs+=(--prefix QML2_IMPORT_PATH : "$qmlDir") + fi +} +addEnvHooks "$hostOffset" qtHostPathHook + +makeQtWrapper() { + local original="$1" + local wrapper="$2" + shift 2 + makeWrapper "$original" "$wrapper" "${qtWrapperArgs[@]}" "$@" +} + +wrapQtApp() { + local program="$1" + shift 1 + wrapProgram "$program" "${qtWrapperArgs[@]}" "$@" +} + +qtOwnPathsHook() { + local xdgDataDir="${!outputBin}/share" + if [ -d "$xdgDataDir" ] + then + qtWrapperArgs+=(--prefix XDG_DATA_DIRS : "$xdgDataDir") + fi + + local xdgConfigDir="${!outputBin}/etc/xdg" + if [ -d "$xdgConfigDir" ] + then + qtWrapperArgs+=(--prefix XDG_CONFIG_DIRS : "$xdgConfigDir") + fi + + qtHostPathHook "${!outputBin}" +} + +preFixupPhases+=" qtOwnPathsHook" + +# Note: $qtWrapperArgs still gets defined even if ${dontWrapQtApps-} is set. +wrapQtAppsHook() { + # skip this hook when requested + [ -z "${dontWrapQtApps-}" ] || return 0 + + # guard against running multiple times (e.g. due to propagation) + [ -z "$wrapQtAppsHookHasRun" ] || return 0 + wrapQtAppsHookHasRun=1 + + local targetDirs=( "$prefix/bin" "$prefix/sbin" "$prefix/libexec" "$prefix/Applications" "$prefix/"*.app ) + echo "wrapping Qt applications in ${targetDirs[@]}" + + for targetDir in "${targetDirs[@]}" + do + [ -d "$targetDir" ] || continue + + find "$targetDir" ! -type d -executable -print0 | while IFS= read -r -d '' file + do + isELF "$file" || isMachO "$file" || continue + + if [ -f "$file" ] + then + echo "wrapping $file" + wrapQtApp "$file" + elif [ -h "$file" ] + then + target="$(readlink -e "$file")" + echo "wrapping $file -> $target" + rm "$file" + makeQtWrapper "$target" "$file" + fi + done + done +} + +fixupOutputHooks+=(wrapQtAppsHook) + +fi diff --git a/pkgs/development/libraries/qt-6/modules/qt3d.nix b/pkgs/development/libraries/qt-6/modules/qt3d.nix new file mode 100644 index 000000000000..2f3a45f67d85 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qt3d.nix @@ -0,0 +1,12 @@ +{ qtModule +, qtbase +, qtdeclarative +, qtmultimedia +, assimp +}: + +qtModule { + pname = "qt3d"; + qtInputs = [ qtbase qtdeclarative qtmultimedia ]; + propagatedBuildInputs = [ assimp ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qt5compat.nix b/pkgs/development/libraries/qt-6/modules/qt5compat.nix new file mode 100644 index 000000000000..cba0651a2c46 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qt5compat.nix @@ -0,0 +1,13 @@ +{ qtModule +, qtbase +, qtdeclarative +, libiconv +, icu +, openssl +}: + +qtModule { + pname = "qt5compat"; + qtInputs = [ qtbase qtdeclarative ]; + buildInputs = [ libiconv icu openssl openssl ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtbase.nix b/pkgs/development/libraries/qt-6/modules/qtbase.nix new file mode 100644 index 000000000000..f5ca3497a242 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtbase.nix @@ -0,0 +1,222 @@ +{ stdenv +, lib +, src +, patches ? [ ] +, version +, coreutils +, bison +, flex +, gdb +, gperf +, lndir +, perl +, pkg-config +, python3 +, which +, cmake +, ninja +, ccache +, xmlstarlet +, libproxy +, xlibsWrapper +, xorg +, zstd +, double-conversion +, util-linux +, systemd +, libb2 +, md4c +, mtdev +, lksctp-tools +, libselinux +, libsepol +, vulkan-headers +, vulkan-loader +, valgrind +, libthai +, libdrm +, libdatrie +, lttng-ust +, epoxy +, libiconv +, dbus +, fontconfig +, freetype +, glib +, harfbuzz +, icu +, libX11 +, libXcomposite +, libXcursor +, libXext +, libXi +, libXrender +, libinput +, libjpeg +, libpng +, libxcb +, libxkbcommon +, libxml2 +, libxslt +, openssl +, pcre +, pcre2 +, sqlite +, udev +, xcbutil +, xcbutilimage +, xcbutilkeysyms +, xcbutilrenderutil +, xcbutilwm +, zlib +, at-spi2-core +, unixODBC +, unixODBCDrivers + # optional dependencies +, cups +, libmysqlclient +, postgresql +, withGtk3 ? false +, dconf +, gtk3 + # options +, libGLSupported ? true +, libGL +, debug ? false +, developerBuild ? false +}: + +let + debugSymbols = debug || developerBuild; +in +stdenv.mkDerivation rec { + pname = "qtbase"; + + inherit src version; + + debug = debugSymbols; + + propagatedBuildInputs = [ + libxml2 + libxslt + openssl + sqlite + zlib + unixODBC + # Text rendering + harfbuzz + icu + # Image formats + libjpeg + libpng + pcre2 + pcre + libproxy + xlibsWrapper + zstd + double-conversion + util-linux + systemd + libb2 + md4c + mtdev + lksctp-tools + libselinux + libsepol + lttng-ust + vulkan-headers + vulkan-loader + libthai + libdrm + libdatrie + valgrind + dbus + glib + 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 + epoxy + ] ++ (with unixODBCDrivers; [ + psql + sqlite + mariadb + ]) ++ lib.optional libGLSupported libGL; + + buildInputs = [ + python3 + at-spi2-core + libinput + ] + ++ lib.optional withGtk3 gtk3 + ++ lib.optional developerBuild gdb + ++ lib.optional (cups != null) cups + ++ lib.optional (libmysqlclient != null) libmysqlclient + ++ lib.optional (postgresql != null) postgresql; + + nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which cmake xmlstarlet ninja ]; + + propagatedNativeBuildInputs = [ lndir ]; + + enableParallelBuilding = true; + + inherit patches; + + # https://bugreports.qt.io/browse/QTBUG-97568 + postPatch = '' + substituteInPlace src/corelib/CMakeLists.txt --replace /bin/ls ${coreutils}/bin/ls + ''; + + preConfigure = '' + export LD_LIBRARY_PATH="$PWD/build/lib:$PWD/build/plugins/platforms''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" + ''; + + qtPluginPrefix = "lib/qt-6/plugins"; + qtQmlPrefix = "lib/qt-6/qml"; + + cmakeFlags = [ + "-DINSTALL_PLUGINSDIR=${qtPluginPrefix}" + "-DINSTALL_QMLDIR=${qtQmlPrefix}" + "-DQT_FEATURE_journald=ON" + "-DQT_FEATURE_sctp=ON" + "-DQT_FEATURE_libproxy=ON" + "-DQT_FEATURE_system_sqlite=ON" + "-DQT_FEATURE_vulkan=ON" + "-DQT_FEATURE_openssl_linked=ON" + ]; + + outputs = [ "out" "dev" ]; + + postInstall = '' + mkdir -p $dev + mv $out/mkspecs $out/bin $out/libexec $dev/ + ''; + + dontStrip = debugSymbols; + + setupHook = ../hooks/qtbase-setup-hook.sh; + + meta = with lib; { + homepage = "https://www.qt.io/"; + description = "A cross-platform application framework for C++"; + license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ]; + maintainers = with maintainers; [ milahu nickcao ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtcharts.nix b/pkgs/development/libraries/qt-6/modules/qtcharts.nix new file mode 100644 index 000000000000..917697c38623 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtcharts.nix @@ -0,0 +1,9 @@ +{ qtModule +, qtbase +, qtdeclarative +}: + +qtModule { + pname = "qtcharts"; + qtInputs = [ qtbase qtdeclarative ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtconnectivity.nix b/pkgs/development/libraries/qt-6/modules/qtconnectivity.nix new file mode 100644 index 000000000000..33fbd7231548 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtconnectivity.nix @@ -0,0 +1,15 @@ +{ qtModule +, lib +, stdenv +, qtbase +, qtdeclarative +, bluez +, pkg-config +}: + +qtModule { + pname = "qtconnectivity"; + qtInputs = [ qtbase qtdeclarative ]; + buildInputs = [ bluez ]; + nativeBuildInputs = [ pkg-config ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtdatavis3d.nix b/pkgs/development/libraries/qt-6/modules/qtdatavis3d.nix new file mode 100644 index 000000000000..1d0f9711e588 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtdatavis3d.nix @@ -0,0 +1,9 @@ +{ qtModule +, qtbase +, qtdeclarative +}: + +qtModule { + pname = "qtdatavis3d"; + qtInputs = [ qtbase qtdeclarative ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix b/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix new file mode 100644 index 000000000000..3f691894ff86 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix @@ -0,0 +1,19 @@ +{ qtModule +, qtbase +, qtshadertools +, openssl +, python3 +}: + +qtModule { + pname = "qtdeclarative"; + qtInputs = [ qtbase qtshadertools ]; + propagatedBuildInputs = [ openssl python3 ]; + preConfigure = '' + export LD_LIBRARY_PATH="$PWD/build/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" + ''; + postInstall = '' + substituteInPlace "$out/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake" \ + --replace ''\'''${QT6_INSTALL_PREFIX}' "$out" + ''; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtdoc.nix b/pkgs/development/libraries/qt-6/modules/qtdoc.nix new file mode 100644 index 000000000000..cde9af30ab93 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtdoc.nix @@ -0,0 +1,9 @@ +{ qtModule +, qtdeclarative +}: + +qtModule { + pname = "qtdoc"; + qtInputs = [ qtdeclarative ]; + outputs = [ "out" ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtimageformats.nix b/pkgs/development/libraries/qt-6/modules/qtimageformats.nix new file mode 100644 index 000000000000..b28adbc7295b --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtimageformats.nix @@ -0,0 +1,13 @@ +{ qtModule +, qtbase +, libwebp +, jasper +, libmng +, libtiff +}: + +qtModule { + pname = "qtimageformats"; + qtInputs = [ qtbase ]; + buildInputs = [ libwebp jasper libmng libtiff ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtlanguageserver.nix b/pkgs/development/libraries/qt-6/modules/qtlanguageserver.nix new file mode 100644 index 000000000000..b2e6e450d5f7 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtlanguageserver.nix @@ -0,0 +1,8 @@ +{ qtModule +, qtbase +}: + +qtModule { + pname = "qtlanguageserver"; + qtInputs = [ qtbase ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtlottie.nix b/pkgs/development/libraries/qt-6/modules/qtlottie.nix new file mode 100644 index 000000000000..d94c289953d0 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtlottie.nix @@ -0,0 +1,9 @@ +{ qtModule +, qtbase +, qtdeclarative +}: + +qtModule { + pname = "qtlottie"; + qtInputs = [ qtbase qtdeclarative ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix b/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix new file mode 100644 index 000000000000..5e6dace906dc --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix @@ -0,0 +1,24 @@ +{ qtModule +, lib +, stdenv +, qtbase +, qtdeclarative +, qtshadertools +, qtsvg +, pkg-config +, alsa-lib +, gstreamer +, gst-plugins-base +, libpulseaudio +, wayland +, elfutils +, libunwind +, orc +}: + +qtModule { + pname = "qtmultimedia"; + qtInputs = [ qtbase qtdeclarative qtsvg qtshadertools ]; + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ gstreamer gst-plugins-base libpulseaudio elfutils libunwind alsa-lib wayland orc ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtnetworkauth.nix b/pkgs/development/libraries/qt-6/modules/qtnetworkauth.nix new file mode 100644 index 000000000000..148ed890fc9e --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtnetworkauth.nix @@ -0,0 +1,6 @@ +{ qtModule, qtbase }: + +qtModule { + pname = "qtnetworkauth"; + qtInputs = [ qtbase ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtpositioning.nix b/pkgs/development/libraries/qt-6/modules/qtpositioning.nix new file mode 100644 index 000000000000..99b06bbf2536 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtpositioning.nix @@ -0,0 +1,14 @@ +{ qtModule +, qtbase +, qtdeclarative +, qtserialport +, pkg-config +, openssl +}: + +qtModule { + pname = "qtpositioning"; + qtInputs = [ qtbase qtdeclarative qtserialport ]; + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ openssl ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtquick3d.nix b/pkgs/development/libraries/qt-6/modules/qtquick3d.nix new file mode 100644 index 000000000000..d19a8e725a16 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtquick3d.nix @@ -0,0 +1,11 @@ +{ qtModule +, qtbase +, qtdeclarative +, openssl +}: + +qtModule { + pname = "qtquick3d"; + qtInputs = [ qtbase qtdeclarative ]; + buildInputs = [ openssl ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtquicktimeline.nix b/pkgs/development/libraries/qt-6/modules/qtquicktimeline.nix new file mode 100644 index 000000000000..7458515dba26 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtquicktimeline.nix @@ -0,0 +1,9 @@ +{ qtModule +, qtbase +, qtdeclarative +}: + +qtModule { + pname = "qtquicktimeline"; + qtInputs = [ qtbase qtdeclarative ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtremoteobjects.nix b/pkgs/development/libraries/qt-6/modules/qtremoteobjects.nix new file mode 100644 index 000000000000..888ec33b461a --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtremoteobjects.nix @@ -0,0 +1,9 @@ +{ qtModule +, qtbase +, qtdeclarative +}: + +qtModule { + pname = "qtremoteobjects"; + qtInputs = [ qtbase qtdeclarative ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtscxml.nix b/pkgs/development/libraries/qt-6/modules/qtscxml.nix new file mode 100644 index 000000000000..c49064c5e579 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtscxml.nix @@ -0,0 +1,6 @@ +{ qtModule, qtbase, qtdeclarative }: + +qtModule { + pname = "qtscxml"; + qtInputs = [ qtbase qtdeclarative ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtsensors.nix b/pkgs/development/libraries/qt-6/modules/qtsensors.nix new file mode 100644 index 000000000000..73ddc394cc46 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtsensors.nix @@ -0,0 +1,10 @@ +{ qtModule +, qtbase +, qtdeclarative +, qtsvg +}: + +qtModule { + pname = "qtsensors"; + qtInputs = [ qtbase qtdeclarative qtsvg ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtserialbus.nix b/pkgs/development/libraries/qt-6/modules/qtserialbus.nix new file mode 100644 index 000000000000..4fd6d7cb83c3 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtserialbus.nix @@ -0,0 +1,6 @@ +{ qtModule, qtbase, qtserialport }: + +qtModule { + pname = "qtserialbus"; + qtInputs = [ qtbase qtserialport ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtserialport.nix b/pkgs/development/libraries/qt-6/modules/qtserialport.nix new file mode 100644 index 000000000000..96b7a25bb3b4 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtserialport.nix @@ -0,0 +1,14 @@ +{ qtModule +, stdenv +, lib +, qtbase +, udev +, pkg-config +}: + +qtModule { + pname = "qtserialport"; + qtInputs = [ qtbase ]; + nativeBuildInputs = [ pkg-config ]; + propagatedBuildInputs = [ udev ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtshadertools.nix b/pkgs/development/libraries/qt-6/modules/qtshadertools.nix new file mode 100644 index 000000000000..47102896f7e6 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtshadertools.nix @@ -0,0 +1,8 @@ +{ qtModule +, qtbase +}: + +qtModule { + pname = "qtshadertools"; + qtInputs = [ qtbase ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtsvg.nix b/pkgs/development/libraries/qt-6/modules/qtsvg.nix new file mode 100644 index 000000000000..9031f8805ac9 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtsvg.nix @@ -0,0 +1,15 @@ +{ qtModule +, qtbase +, libwebp +, jasper +, libmng +, zlib +, pkg-config +}: + +qtModule { + pname = "qtsvg"; + qtInputs = [ qtbase ]; + buildInputs = [ libwebp jasper libmng zlib ]; + nativeBuildInputs = [ pkg-config ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qttools.nix b/pkgs/development/libraries/qt-6/modules/qttools.nix new file mode 100644 index 000000000000..b1cf5dd2c146 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qttools.nix @@ -0,0 +1,11 @@ +{ qtModule +, stdenv +, lib +, qtbase +, qtdeclarative +}: + +qtModule { + pname = "qttools"; + qtInputs = [ qtbase qtdeclarative ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qttranslations.nix b/pkgs/development/libraries/qt-6/modules/qttranslations.nix new file mode 100644 index 000000000000..4795cd9e1bfe --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qttranslations.nix @@ -0,0 +1,8 @@ +{ qtModule +, qttools +}: + +qtModule { + pname = "qttranslations"; + qtInputs = [ qttools ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtvirtualkeyboard.nix b/pkgs/development/libraries/qt-6/modules/qtvirtualkeyboard.nix new file mode 100644 index 000000000000..bb868dc61829 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtvirtualkeyboard.nix @@ -0,0 +1,15 @@ +{ qtModule +, qtbase +, qtdeclarative +, qtsvg +, hunspell +, pkg-config +}: + +qtModule { + pname = "qtvirtualkeyboard"; + qtInputs = [ qtbase qtdeclarative qtsvg ]; + propagatedBuildInputs = [ hunspell ]; + nativeBuildInputs = [ pkg-config ]; + outputs = [ "out" ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtwayland.nix b/pkgs/development/libraries/qt-6/modules/qtwayland.nix new file mode 100644 index 000000000000..3ac23d28a798 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtwayland.nix @@ -0,0 +1,16 @@ +{ qtModule +, qtbase +, qtquick3d +, qtdeclarative +, wayland +, pkg-config +, xlibsWrapper +, libdrm +}: + +qtModule { + pname = "qtwayland"; + qtInputs = [ qtbase qtdeclarative ]; + buildInputs = [ wayland xlibsWrapper libdrm ]; + nativeBuildInputs = [ pkg-config ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtwebchannel.nix b/pkgs/development/libraries/qt-6/modules/qtwebchannel.nix new file mode 100644 index 000000000000..49b959c5dea7 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtwebchannel.nix @@ -0,0 +1,12 @@ +{ qtModule +, qtbase +, qtdeclarative +, qtwebsockets +, openssl +}: + +qtModule { + pname = "qtwebchannel"; + qtInputs = [ qtbase qtdeclarative qtwebsockets ]; + buildInputs = [ openssl ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtwebengine.nix b/pkgs/development/libraries/qt-6/modules/qtwebengine.nix new file mode 100644 index 000000000000..88254ab15890 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtwebengine.nix @@ -0,0 +1,234 @@ +{ qtModule +, qtdeclarative +, qtwebchannel +, qtpositioning +, qtwebsockets +, bison +, coreutils +, flex +, git +, gperf +, ninja +, pkg-config +, python3 +, which +, nodejs +, qtbase +, perl +, xorg +, libXcursor +, libXScrnSaver +, libXrandr +, libXtst +, libxshmfence +, libXi +, fontconfig +, freetype +, harfbuzz +, icu +, dbus +, libdrm +, zlib +, minizip +, libjpeg +, libpng +, libtiff +, libwebp +, libopus +, jsoncpp +, protobuf +, libvpx +, srtp +, snappy +, nss +, libevent +, openssl +, alsa-lib +, pulseaudio +, libcap +, pciutils +, systemd +, pipewire +, gn +, cups +, openbsm +, runCommand +, writeScriptBin +, ffmpeg +, lib +, stdenv +, fetchpatch +, glib +, libxml2 +, libxslt +, lcms2 +, re2 +, kerberos +, enableProprietaryCodecs ? true +}: + +qtModule rec { + pname = "qtwebengine"; + qtInputs = [ qtdeclarative qtwebchannel qtwebsockets qtpositioning ]; + nativeBuildInputs = [ + bison + coreutils + flex + git + gperf + ninja + pkg-config + (python3.withPackages (ps: with ps; [ html5lib ])) + which + gn + nodejs + ]; + doCheck = true; + outputs = [ "out" "dev" ]; + + dontUseGnConfigure = true; + + # ninja builds some components with -Wno-format, + # which cannot be set at the same time as -Wformat-security + hardeningDisable = [ "format" ]; + + patches = [ + # drop UCHAR_TYPE override to fix build with system ICU + (fetchpatch { + url = "https://code.qt.io/cgit/qt/qtwebengine-chromium.git/patch/?id=75f0f4eb"; + stripLen = 1; + extraPrefix = "src/3rdparty/"; + sha256 = "sha256-3aMcVXJg+v+UbsSO27g6MA6/uVkWUxyQsMD1EzlzXDs="; + }) + ]; + + postPatch = '' + # Patch Chromium build tools + ( + cd src/3rdparty/chromium; + + # 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 + substituteInPlace third_party/webgpu-cts/src/tools/deno \ + --replace "/usr/bin/env -S deno" "/usr/bin/deno" || true + patchShebangs . + ) + + # Patch library paths in 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 + + 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 + ''; + + cmakeFlags = [ + "-DQT_FEATURE_qtpdf_build=ON" + "-DQT_FEATURE_qtpdf_widgets_build=ON" + "-DQT_FEATURE_qtpdf_quick_build=ON" + "-DQT_FEATURE_pdf_v8=ON" + "-DQT_FEATURE_pdf_xfa=ON" + "-DQT_FEATURE_pdf_xfa_bmp=ON" + "-DQT_FEATURE_pdf_xfa_gif=ON" + "-DQT_FEATURE_pdf_xfa_png=ON" + "-DQT_FEATURE_pdf_xfa_tiff=ON" + "-DQT_FEATURE_webengine_system_icu=ON" + "-DQT_FEATURE_webengine_system_libevent=ON" + "-DQT_FEATURE_webengine_system_libxml=ON" + "-DQT_FEATURE_webengine_system_ffmpeg=ON" + # android only. https://bugreports.qt.io/browse/QTBUG-100293 + # "-DQT_FEATURE_webengine_native_spellchecker=ON" + "-DQT_FEATURE_webengine_sanitizer=ON" + "-DQT_FEATURE_webengine_webrtc_pipewire=ON" + "-DQT_FEATURE_webengine_kerberos=ON" + ] ++ lib.optional enableProprietaryCodecs "-DQT_FEATURE_webengine_proprietary_codecs=ON"; + + propagatedBuildInputs = [ + # Image formats + libjpeg + libpng + libtiff + libwebp + + # Video formats + srtp + libvpx + + # Audio formats + libopus + + # Text rendering + harfbuzz + icu + + openssl + glib + libxml2 + libxslt + lcms2 + re2 + + libevent + ffmpeg + + 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 + libxshmfence + libXi + xorg.libXext + + # Pipewire + pipewire + + kerberos + ]; + + buildInputs = [ + cups + ]; + + requiredSystemFeatures = [ "big-parallel" ]; + + meta = with lib; { + description = "A web engine based on the Chromium web browser"; + platforms = platforms.linux; + # This build takes a long time; particularly on slow architectures + # 1 hour on 32x3.6GHz -> maybe 12 hours on 4x2.4GHz + timeout = 24 * 3600; + }; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtwebsockets.nix b/pkgs/development/libraries/qt-6/modules/qtwebsockets.nix new file mode 100644 index 000000000000..f81cd64596eb --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtwebsockets.nix @@ -0,0 +1,11 @@ +{ qtModule +, qtbase +, qtdeclarative +, openssl +}: + +qtModule { + pname = "qtwebsockets"; + qtInputs = [ qtbase qtdeclarative ]; + buildInputs = [ openssl ]; +} diff --git a/pkgs/development/libraries/qt-6/modules/qtwebview.nix b/pkgs/development/libraries/qt-6/modules/qtwebview.nix new file mode 100644 index 000000000000..ba784f73ad45 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtwebview.nix @@ -0,0 +1,11 @@ +{ lib +, stdenv +, qtModule +, qtdeclarative +, qtwebengine +}: + +qtModule { + pname = "qtwebview"; + qtInputs = [ qtdeclarative qtwebengine ]; +} diff --git a/pkgs/development/libraries/qt-6/qtModule.nix b/pkgs/development/libraries/qt-6/qtModule.nix new file mode 100644 index 000000000000..04349ed68ad2 --- /dev/null +++ b/pkgs/development/libraries/qt-6/qtModule.nix @@ -0,0 +1,45 @@ +{ stdenv, lib, perl, cmake, ninja, writeText }: + +{ self, srcs, patches ? [ ] }: + +args: + +let + inherit (args) pname; + version = args.version or srcs.${pname}.version; + src = args.src or srcs.${pname}.src; +in +stdenv.mkDerivation (args // { + inherit pname version src; + patches = args.patches or patches.${pname} or [ ]; + + buildInputs = args.buildInputs or [ ]; + nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ + perl + cmake + ninja + ]; + propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or [ ]); + + outputs = args.outputs or [ "out" "dev" ]; + + dontWrapQtApps = args.dontWrapQtApps or true; + postInstall = '' + if [ ! -z "$dev" ]; then + mkdir "$dev" + for dir in bin libexec mkspecs + do + moveToOutput "$dir" "$dev" + done + fi + ${args.postInstall or ""} + ''; + + meta = with lib; { + homepage = "https://www.qt.io/"; + description = "A cross-platform application framework for C++"; + license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ]; + maintainers = with maintainers; [ milahu nickcao ]; + platforms = platforms.linux; + } // (args.meta or { }); +}) diff --git a/pkgs/development/libraries/qt-6/srcs.nix b/pkgs/development/libraries/qt-6/srcs.nix new file mode 100644 index 000000000000..0846f4403cd2 --- /dev/null +++ b/pkgs/development/libraries/qt-6/srcs.nix @@ -0,0 +1,262 @@ +# DO NOT EDIT! This file is generated automatically. +# Command: ./maintainers/scripts/fetch-kde-qt.sh pkgs/development/libraries/qt-6/6.3 +{ fetchurl, mirror }: + +{ + qt3d = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qt3d-everywhere-src-6.3.0.tar.xz"; + sha256 = "1qadnm2i2cgzigzq2wl0id5wzmc1p6zls4mrg1w8hd5d1lw65rvl"; + name = "qt3d-everywhere-src-6.3.0.tar.xz"; + }; + }; + qt5compat = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qt5compat-everywhere-src-6.3.0.tar.xz"; + sha256 = "0gkis7504qdpavimkx33zl9082r4rfa2v4iba4a943f5h3krn69b"; + name = "qt5compat-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtactiveqt = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtactiveqt-everywhere-src-6.3.0.tar.xz"; + sha256 = "01sziyhzmvqn1flw6y73aszqll1yijxxc7hyzkd269zbmpm42l4c"; + name = "qtactiveqt-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtbase = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtbase-everywhere-src-6.3.0.tar.xz"; + sha256 = "168g39xiasriwpny9rf4alx3k8gnkffqjqm1n2rr5xsp6gjalrdq"; + name = "qtbase-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtcharts = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtcharts-everywhere-src-6.3.0.tar.xz"; + sha256 = "1k9ngvl94xd5xr34ycwvchvzih037yvfzvdf625cik21yv2n49v7"; + name = "qtcharts-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtconnectivity = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtconnectivity-everywhere-src-6.3.0.tar.xz"; + sha256 = "06p6n23y2a6nca0rzdli6zl7m2i42h2pm28092zb4vd578p17xwq"; + name = "qtconnectivity-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtdatavis3d = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtdatavis3d-everywhere-src-6.3.0.tar.xz"; + sha256 = "138dkvarvh45j4524y1piw0dm2j16s3lk5pazbggi3xjnbrjwl89"; + name = "qtdatavis3d-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtdeclarative = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtdeclarative-everywhere-src-6.3.0.tar.xz"; + sha256 = "0dxa9j8cxfd86nqpvxvzxd1jdlw8h0xxqvsiv9jlyb9bvhlv156j"; + name = "qtdeclarative-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtdoc = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtdoc-everywhere-src-6.3.0.tar.xz"; + sha256 = "0r9giv6xpg6zhghrrv4chlk1cimmiw93cj6rdf4rkf2g3qmgv6d8"; + name = "qtdoc-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtimageformats = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtimageformats-everywhere-src-6.3.0.tar.xz"; + sha256 = "1vxbjdfy1zya4pgcl4483912aw7ip0d768xmnrz2md3mxlbhsp82"; + name = "qtimageformats-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtlanguageserver = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtlanguageserver-everywhere-src-6.3.0.tar.xz"; + sha256 = "1apfkq5grxkx69d8x7gmj19klr3jypsz1csw6r00q7hf0vvxiakh"; + name = "qtlanguageserver-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtlottie = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtlottie-everywhere-src-6.3.0.tar.xz"; + sha256 = "1svxz5ndljhrn52vyyr1yziar63ksjz78mvaxfhjgdd5pc5mgnrr"; + name = "qtlottie-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtmultimedia = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtmultimedia-everywhere-src-6.3.0.tar.xz"; + sha256 = "0gpylyrjkks27y5bfaxqs7idj0wyscpn1kh51i4ahx19z1zj8l6h"; + name = "qtmultimedia-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtnetworkauth = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtnetworkauth-everywhere-src-6.3.0.tar.xz"; + sha256 = "17q6v4d2qglw88gd2i9m4cvvacpfsw6a544g0ch8a0hr56a9hfi0"; + name = "qtnetworkauth-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtpositioning = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtpositioning-everywhere-src-6.3.0.tar.xz"; + sha256 = "0vi3123pa9pc4xqh6rgxwz40xvvl4w0x09fn6kdld8s5nbv51vg9"; + name = "qtpositioning-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtquick3d = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtquick3d-everywhere-src-6.3.0.tar.xz"; + sha256 = "0zijxf33v5b2hrwppp4gr1i1dscdxqjjcb8a48c4ny0zxv8mpl0a"; + name = "qtquick3d-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtquicktimeline = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtquicktimeline-everywhere-src-6.3.0.tar.xz"; + sha256 = "06hwygywqc6kqs2ss8ng6ymjs3m72r51x2lzppjnpz4y2lqskw4z"; + name = "qtquicktimeline-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtremoteobjects = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtremoteobjects-everywhere-src-6.3.0.tar.xz"; + sha256 = "0v2ax6xynv13z1dqnklnvfxxdhh9fallrjdmqpkmkydgy163zckm"; + name = "qtremoteobjects-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtscxml = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtscxml-everywhere-src-6.3.0.tar.xz"; + sha256 = "1w3hi9c5v0lji59pkk0dhaq3xly9skf3jsm93gxj0y9nmkbdpc09"; + name = "qtscxml-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtsensors = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtsensors-everywhere-src-6.3.0.tar.xz"; + sha256 = "0j4ppqn8m04hfqrzrmp80fmwpr474arcycf58jypm17fnlrwfmy7"; + name = "qtsensors-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtserialbus = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtserialbus-everywhere-src-6.3.0.tar.xz"; + sha256 = "1mi76sxh21wj1b1myqrzaaspf1iwa4bxr342p1b6krrnrf4ckxnj"; + name = "qtserialbus-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtserialport = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtserialport-everywhere-src-6.3.0.tar.xz"; + sha256 = "0kxnblyk8bw02bdjsnjbblczg0dvj7ys95bpr2w49h4cshs6kggf"; + name = "qtserialport-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtshadertools = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtshadertools-everywhere-src-6.3.0.tar.xz"; + sha256 = "0v5xmyc9d3vacvdm2zpancqqmsvaz0635cba2aym9hipkndrb62l"; + name = "qtshadertools-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtsvg = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtsvg-everywhere-src-6.3.0.tar.xz"; + sha256 = "1qxhilxbk7wgnah7qlfcr5gsn19626dp6dc260wh8r1zgr6m0r1i"; + name = "qtsvg-everywhere-src-6.3.0.tar.xz"; + }; + }; + qttools = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qttools-everywhere-src-6.3.0.tar.xz"; + sha256 = "175is0yf74vdxlmcb9nvm86n6m7qj54mhiwkhyi84mwjxa44dsgw"; + name = "qttools-everywhere-src-6.3.0.tar.xz"; + }; + }; + qttranslations = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qttranslations-everywhere-src-6.3.0.tar.xz"; + sha256 = "1cs06kiv34zdkicxdjhxydv5rn1ylf4z2f4jl4a9ajm3jbw4xpg4"; + name = "qttranslations-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtvirtualkeyboard = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtvirtualkeyboard-everywhere-src-6.3.0.tar.xz"; + sha256 = "0wv54zmr9chwx1bds5b2j1436ynq6b5lbv7lbj7sycjlrxdg3al9"; + name = "qtvirtualkeyboard-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtwayland = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtwayland-everywhere-src-6.3.0.tar.xz"; + sha256 = "1411l2rc399bj6r36wd8n06a0rpdxkhmr0mashc5kz1zwkv6gdg7"; + name = "qtwayland-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtwebchannel = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtwebchannel-everywhere-src-6.3.0.tar.xz"; + sha256 = "03p4ggi9dk11q3zqw29awwxvddgfb3nsrrm58q053y0zlclc9i7b"; + name = "qtwebchannel-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtwebengine = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtwebengine-everywhere-src-6.3.0.tar.xz"; + sha256 = "0g899mn6fx9w0mb9dm7y25x3d9gcy8ramwbcpk8pmjqxv1fv8090"; + name = "qtwebengine-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtwebsockets = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtwebsockets-everywhere-src-6.3.0.tar.xz"; + sha256 = "0qb39qnli5wshrnzr9kbdrbddzi2l0y9vg3b1mbdkdv0x6gs0670"; + name = "qtwebsockets-everywhere-src-6.3.0.tar.xz"; + }; + }; + qtwebview = { + version = "6.3.0"; + src = fetchurl { + url = "${mirror}/official_releases/qt/6.3/6.3.0/submodules/qtwebview-everywhere-src-6.3.0.tar.xz"; + sha256 = "0mi1fkxz4mags32ld8km4svsnvbai0i81398f435sd1n9ach3gfy"; + name = "qtwebview-everywhere-src-6.3.0.tar.xz"; + }; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8d59013e7419..dc5b53ab2925 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20235,6 +20235,23 @@ with pkgs; qtEnv = qt5.env; qt5Full = qt5.full; + qt6 = recurseIntoAttrs (makeOverridable + (import ../development/libraries/qt-6) { + inherit newScope; + inherit lib stdenv fetchurl fetchpatch fetchgit fetchFromGitHub makeSetupHook makeWrapper writeText; + inherit bison cups dconf harfbuzz libGL perl gtk3 ninja; + inherit (gst_all_1) gstreamer gst-plugins-base; + cmake = cmake.overrideAttrs (attrs: { + patches = attrs.patches ++ [ + ../development/libraries/qt-6/cmake.patch + ]; + }); + }); + + qt6Packages = recurseIntoAttrs (import ./qt6-packages.nix { + inherit lib pkgs qt6; + }); + qtscriptgenerator = callPackage ../development/libraries/qtscriptgenerator { }; quark-engine = callPackage ../tools/security/quark-engine { }; @@ -29840,7 +29857,7 @@ with pkgs; taskopen = callPackage ../applications/misc/taskopen { }; - tdesktop = libsForQt5.callPackage ../applications/networking/instant-messengers/telegram/tdesktop { + tdesktop = qt6Packages.callPackage ../applications/networking/instant-messengers/telegram/tdesktop { abseil-cpp = abseil-cpp_202111; }; diff --git a/pkgs/top-level/qt6-packages.nix b/pkgs/top-level/qt6-packages.nix new file mode 100644 index 000000000000..9ef47c873ba5 --- /dev/null +++ b/pkgs/top-level/qt6-packages.nix @@ -0,0 +1,20 @@ +# Qt packages set. +# +# Attributes in this file are packages requiring Qt and will be made available +# for every Qt version. Qt applications are called from `all-packages.nix` via +# this file. + +{ lib +, pkgs +, qt6 +}: + +(lib.makeScope pkgs.newScope ( self: + +let + libsForQt6 = self; + callPackage = self.callPackage; +in + +(qt6 // { +})))