diff options
author | Alyssa Ross <hi@alyssa.is> | 2024-03-01 11:40:12 +0100 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-03-01 11:40:12 +0100 |
commit | bf6d657e5dbcb5e39fda280ef7e86b2a7794ca86 (patch) | |
tree | 8eb035cbab19794f6415cc460fac7226f7a58afc /nixpkgs/pkgs/development/libraries/qt-6 | |
parent | 66f707d69f1e423db5a35c2fe43b32781125a9af (diff) | |
parent | 09c1497ce5d4ed4a0edfdd44450d3048074cb300 (diff) | |
download | nixlib-bf6d657e5dbcb5e39fda280ef7e86b2a7794ca86.tar nixlib-bf6d657e5dbcb5e39fda280ef7e86b2a7794ca86.tar.gz nixlib-bf6d657e5dbcb5e39fda280ef7e86b2a7794ca86.tar.bz2 nixlib-bf6d657e5dbcb5e39fda280ef7e86b2a7794ca86.tar.lz nixlib-bf6d657e5dbcb5e39fda280ef7e86b2a7794ca86.tar.xz nixlib-bf6d657e5dbcb5e39fda280ef7e86b2a7794ca86.tar.zst nixlib-bf6d657e5dbcb5e39fda280ef7e86b2a7794ca86.zip |
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/qt-6')
3 files changed, 113 insertions, 88 deletions
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/default.nix b/nixpkgs/pkgs/development/libraries/qt-6/default.nix index 8acc044894bc..ea65e5f3ae82 100644 --- a/nixpkgs/pkgs/development/libraries/qt-6/default.nix +++ b/nixpkgs/pkgs/development/libraries/qt-6/default.nix @@ -42,7 +42,7 @@ let qtModule = callPackage ./qtModule.nix { }; qtbase = callPackage ./modules/qtbase.nix { - withGtk3 = true; + withGtk3 = !stdenv.hostPlatform.isMinGW; inherit (srcs.qtbase) src version; inherit developerBuild; inherit (darwin.apple_sdk_11_0.frameworks) @@ -69,47 +69,49 @@ let ]; }; env = callPackage ./qt-env.nix { }; - full = callPackage ({ env, qtbase }: env "qt-full-${qtbase.version}" - # `with self` is ok to use here because having these spliced is unnecessary - ( with self;[ - qt3d - qt5compat - qtcharts - qtconnectivity - qtdatavis3d - qtdeclarative - qtdoc - qtgraphs - qtgrpc - qthttpserver - qtimageformats - qtlanguageserver - qtlocation - qtlottie - qtmultimedia - qtmqtt - qtnetworkauth - qtpositioning - qtsensors - qtserialbus - qtserialport - qtshadertools - qtspeech - qtquick3d - qtquick3dphysics - qtquickeffectmaker - qtquicktimeline - qtremoteobjects - qtsvg - qtscxml - qttools - qttranslations - qtvirtualkeyboard - qtwebchannel - qtwebengine - qtwebsockets - qtwebview - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ qtwayland libglvnd ])) { }; + full = callPackage + ({ env, qtbase }: env "qt-full-${qtbase.version}" + # `with self` is ok to use here because having these spliced is unnecessary + (with self;[ + qt3d + qt5compat + qtcharts + qtconnectivity + qtdatavis3d + qtdeclarative + qtdoc + qtgraphs + qtgrpc + qthttpserver + qtimageformats + qtlanguageserver + qtlocation + qtlottie + qtmultimedia + qtmqtt + qtnetworkauth + qtpositioning + qtsensors + qtserialbus + qtserialport + qtshadertools + qtspeech + qtquick3d + qtquick3dphysics + qtquickeffectmaker + qtquicktimeline + qtremoteobjects + qtsvg + qtscxml + qttools + qttranslations + qtvirtualkeyboard + qtwebchannel + qtwebengine + qtwebsockets + qtwebview + ] ++ lib.optionals (!stdenv.isDarwin) [ qtwayland libglvnd ])) + { }; qt3d = callPackage ./modules/qt3d.nix { }; qt5compat = callPackage ./modules/qt5compat.nix { }; @@ -162,11 +164,14 @@ let GameController ImageCaptureCore LocalAuthentication MediaAccessibility MediaPlayer MetalKit Network OpenDirectory Quartz ReplayKit SecurityInterface Vision; - qtModule = callPackage ({ qtModule }: qtModule.override { - stdenv = if stdenv.hostPlatform.isDarwin - then overrideSDK stdenv { darwinMinVersion = "10.13"; darwinSdkVersion = "11.0"; } - else stdenv; - }) { }; + qtModule = callPackage + ({ qtModule }: qtModule.override { + stdenv = + if stdenv.isDarwin + then overrideSDK stdenv { darwinMinVersion = "10.13"; darwinSdkVersion = "11.0"; } + else stdenv; + }) + { }; xcbuild = buildPackages.xcbuild.override { productBuildVer = "20A2408"; }; @@ -176,21 +181,25 @@ let inherit (darwin.apple_sdk_11_0.frameworks) WebKit; }; - wrapQtAppsHook = callPackage ({ makeBinaryWrapper }: makeSetupHook - { - name = "wrap-qt6-apps-hook"; - propagatedBuildInputs = [ makeBinaryWrapper ]; - } ./hooks/wrap-qt-apps-hook.sh) { }; + wrapQtAppsHook = callPackage + ({ makeBinaryWrapper }: makeSetupHook + { + name = "wrap-qt6-apps-hook"; + propagatedBuildInputs = [ makeBinaryWrapper ]; + } ./hooks/wrap-qt-apps-hook.sh) + { }; - qmake = callPackage ({ qtbase }: makeSetupHook - { - name = "qmake6-hook"; - propagatedBuildInputs = [ qtbase.dev ]; - substitutions = { - inherit debug; - fix_qmake_libtool = ./hooks/fix-qmake-libtool.sh; - }; - } ./hooks/qmake-hook.sh) { }; + qmake = callPackage + ({ qtbase }: makeSetupHook + { + name = "qmake6-hook"; + propagatedBuildInputs = [ qtbase.dev ]; + substitutions = { + inherit debug; + fix_qmake_libtool = ./hooks/fix-qmake-libtool.sh; + }; + } ./hooks/qmake-hook.sh) + { }; } // lib.optionalAttrs config.allowAliases { # Convert to a throw on 03-01-2023 and backport the change. # Warnings show up in various cli tool outputs, throws do not. @@ -203,12 +212,13 @@ let f = addPackages; }; - bootstrapScope = baseScope.overrideScope(final: prev: { + bootstrapScope = baseScope.overrideScope (final: prev: { qtbase = prev.qtbase.override { qttranslations = null; }; qtdeclarative = null; }); - finalScope = baseScope.overrideScope(final: prev: { + finalScope = baseScope.overrideScope (final: prev: { qttranslations = bootstrapScope.qttranslations; }); -in finalScope +in +finalScope diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtbase.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtbase.nix index 26fdeceda61f..0a16f725c477 100644 --- a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtbase.nix +++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtbase.nix @@ -4,6 +4,7 @@ , patches ? [ ] , version , coreutils +, buildPackages , bison , flex , gdb @@ -79,6 +80,8 @@ , EventKit , GSS , MetalKit + # mingw +, pkgsBuildBuild # optional dependencies , cups , libmysqlclient @@ -96,6 +99,7 @@ let debugSymbols = debug || developerBuild; + isCrossBuild = !stdenv.buildPlatform.canExecute stdenv.hostPlatform; in stdenv.mkDerivation rec { pname = "qtbase"; @@ -110,7 +114,6 @@ stdenv.mkDerivation rec { openssl sqlite zlib - unixODBC # Text rendering harfbuzz icu @@ -119,14 +122,16 @@ stdenv.mkDerivation rec { libpng pcre2 pcre - libproxy zstd - double-conversion libb2 md4c + double-conversion + ] ++ lib.optionals (!stdenv.hostPlatform.isMinGW) [ + libproxy dbus glib # unixODBC drivers + unixODBC unixODBCDrivers.psql unixODBCDrivers.sqlite unixODBCDrivers.mariadb @@ -174,11 +179,16 @@ stdenv.mkDerivation rec { EventKit GSS MetalKit - ] ++ lib.optional libGLSupported libGL; + ] ++ lib.optionals libGLSupported [ + libGL + ] ++ lib.optionals stdenv.hostPlatform.isMinGW [ + vulkan-headers + vulkan-loader + ]; - buildInputs = [ + buildInputs = lib.optionals (lib.meta.availableOn stdenv.hostPlatform at-spi2-core) [ at-spi2-core - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + ] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform libinput) [ libinput ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ AppKit @@ -186,9 +196,9 @@ stdenv.mkDerivation rec { ] ++ lib.optional withGtk3 gtk3 ++ lib.optional developerBuild gdb - ++ lib.optional (cups != null) cups - ++ lib.optional (libmysqlclient != null) libmysqlclient - ++ lib.optional (postgresql != null) postgresql; + ++ lib.optional (cups != null && lib.meta.availableOn stdenv.hostPlatform cups) cups + ++ lib.optional (libmysqlclient != null && !stdenv.hostPlatform.isMinGW) libmysqlclient + ++ lib.optional (postgresql != null && lib.meta.availableOn stdenv.hostPlatform postgresql) postgresql; nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which cmake xmlstarlet ninja ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ moveBuildTree ]; @@ -203,7 +213,7 @@ stdenv.mkDerivation rec { # https://bugreports.qt.io/browse/QTBUG-97568 postPatch = '' - substituteInPlace src/corelib/CMakeLists.txt --replace-fail "/bin/ls" "${coreutils}/bin/ls" + substituteInPlace src/corelib/CMakeLists.txt --replace-fail "/bin/ls" "${buildPackages.coreutils}/bin/ls" '' + lib.optionalString stdenv.hostPlatform.isDarwin '' substituteInPlace cmake/QtPublicAppleHelpers.cmake --replace-fail "/usr/bin/xcrun" "${xcbuild}/bin/xcrun" ''; @@ -232,7 +242,11 @@ stdenv.mkDerivation rec { ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ # error: 'path' is unavailable: introduced in macOS 10.15 "-DQT_FEATURE_cxx17_filesystem=OFF" - ] ++ lib.optional (qttranslations != null) "-DINSTALL_TRANSLATIONSDIR=${qttranslations}/translations"; + ] ++ lib.optionals isCrossBuild [ + "-DQT_HOST_PATH=${pkgsBuildBuild.qt6.qtbase}" + "-DQt6HostInfo_DIR=${pkgsBuildBuild.qt6.qtbase}/lib/cmake/Qt6HostInfo" + ] + ++ lib.optional (qttranslations != null && !isCrossBuild) "-DINSTALL_TRANSLATIONSDIR=${qttranslations}/translations"; env.NIX_LDFLAGS = toString (lib.optionals stdenv.hostPlatform.isDarwin [ # Undefined symbols for architecture arm64: "___gss_c_nt_hostbased_service_oid_desc" @@ -253,6 +267,8 @@ stdenv.mkDerivation rec { dontStrip = debugSymbols; + dontWrapQtApps = true; + setupHook = ../hooks/qtbase-setup-hook.sh; meta = with lib; { @@ -260,6 +276,6 @@ stdenv.mkDerivation rec { description = "A cross-platform application framework for C++"; license = with licenses; [ fdl13Plus gpl2Plus lgpl21Plus lgpl3Plus ]; maintainers = with maintainers; [ milahu nickcao LunNova ]; - platforms = platforms.unix; + platforms = platforms.unix ++ platforms.windows; }; } diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/0011-qtbase-derive-plugin-load-path-from-PATH.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/0011-qtbase-derive-plugin-load-path-from-PATH.patch index 22530f453536..cae39e879120 100644 --- a/nixpkgs/pkgs/development/libraries/qt-6/patches/0011-qtbase-derive-plugin-load-path-from-PATH.patch +++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/0011-qtbase-derive-plugin-load-path-from-PATH.patch @@ -1,19 +1,19 @@ -From f0c4d3860b75cb064d066045907622d536044096 Mon Sep 17 00:00:00 2001 +From 6f0e6fe1e13ca5844a93d3b97111b7ece7e60f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20P=C3=A4ssler?= <me@pbb.lc> Date: Sun, 10 May 2020 12:47:28 +0200 Subject: [PATCH 11/11] qtbase: derive plugin load path from PATH --- - src/corelib/kernel/qcoreapplication.cpp | 10 ++++++++++ - 1 file changed, 10 insertions(+) + src/corelib/kernel/qcoreapplication.cpp | 9 +++++++++ + 1 file changed, 9 insertions(+) diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp -index a80efbb5622..8cf9e85da43 100644 +index a80efbb5622..0d41dabeed3 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp -@@ -2991,6 +2991,16 @@ QStringList QCoreApplication::libraryPathsLocked() - QStringList *app_libpaths = new QStringList; - coreappdata()->app_libpaths.reset(app_libpaths); +@@ -3032,6 +3032,15 @@ QStringList QCoreApplication::libraryPathsLocked() + app_libpaths->append(installPathPlugins); + } + // Add library paths derived from PATH + const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(QStringLiteral(":")); @@ -24,10 +24,9 @@ index a80efbb5622..8cf9e85da43 100644 + } + } + -+ - auto setPathsFromEnv = [&](QString libPathEnv) { - if (!libPathEnv.isEmpty()) { - QStringList paths = libPathEnv.split(QDir::listSeparator(), Qt::SkipEmptyParts); + // If QCoreApplication is not yet instantiated, + // make sure we add the application path when we construct the QCoreApplication + if (self) self->d_func()->appendApplicationPathToLibraryPaths(); -- -2.42.0 +2.43.1 |