about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/qt-5
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-09-01 11:51:02 +0000
committerAlyssa Ross <hi@alyssa.is>2023-09-01 11:51:02 +0000
commitaa4353b499e6950b7333578f936455a628145c31 (patch)
treec6332cedece2327a18d08794755b3fc0f9f1905b /nixpkgs/pkgs/development/libraries/qt-5
parentac456d475f4e50818499b804359355c0f3b4bbf7 (diff)
parent52185f4d76c18d8348f963795dfed1de018e8dfe (diff)
downloadnixlib-aa4353b499e6950b7333578f936455a628145c31.tar
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.gz
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.bz2
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.lz
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.xz
nixlib-aa4353b499e6950b7333578f936455a628145c31.tar.zst
nixlib-aa4353b499e6950b7333578f936455a628145c31.zip
Merge https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/qt-5')
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/9999-backport-dbus-crash.patch79
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qttools.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qttranslations.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/qtModule.nix2
6 files changed, 101 insertions, 7 deletions
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix
index 04fdf5298257..e6e6b24360a4 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix
@@ -46,6 +46,7 @@ let
       ./qtbase.patch.d/0009-qtbase-qtpluginpath.patch
       ./qtbase.patch.d/0010-qtbase-assert.patch
       ./qtbase.patch.d/0011-fix-header_module.patch
+      ./qtbase.patch.d/9999-backport-dbus-crash.patch
     ];
     qtdeclarative = [
       ./qtdeclarative.patch
@@ -333,7 +334,17 @@ let
       } ../hooks/wrap-qt-apps-hook.sh;
     };
 
-in makeScopeWithSplicing' {
-  otherSplices = generateSplicesForMkScope "qt5";
-  f = addPackages;
-}
+  baseScope = makeScopeWithSplicing' {
+    otherSplices = generateSplicesForMkScope "qt5";
+    f = addPackages;
+  };
+
+  bootstrapScope = baseScope.overrideScope(final: prev: {
+    qtbase = prev.qtbase.override { qttranslations = null; };
+    qtdeclarative = null;
+  });
+
+  finalScope = baseScope.overrideScope(final: prev: {
+    qttranslations = bootstrapScope.qttranslations;
+  });
+in finalScope
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/9999-backport-dbus-crash.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/9999-backport-dbus-crash.patch
new file mode 100644
index 000000000000..e1aa0119aa2f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/9999-backport-dbus-crash.patch
@@ -0,0 +1,79 @@
+commit eb0c6846a5d05d686f0686f0f1ddddcad762ad26 (HEAD -> kde/5.15)
+Author: K900 <me@0upti.me>
+Date:   Mon Aug 14 22:44:02 2023 +0300
+
+    QLibraryPrivate: Actually merge load hints
+
+    Or old and new load hints in mergeLoadHints() instead of just storing
+    new ones. Andjust QLibraryPrivate::setLoadHints() to handle objects
+    with no file name differently and just set load hints directly.
+
+    Mention that load hints are merged once the file name is set
+    in the documentation for QLibrary::setLoadHints().
+
+    Add a regression test into tst_qfactoryloader.
+
+    Update and extend tst_QPluginLoader::loadHints() to take into account
+    load hints merging.
+
+    Fixes: QTBUG-114480
+    Change-Id: I3b9afaec7acde1f5ff992d913f8d7217392c7e00
+    Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
+    Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
+
+diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
+index 5d2f024267..45b5a3fe27 100644
+--- a/src/corelib/plugin/qlibrary.cpp
++++ b/src/corelib/plugin/qlibrary.cpp
+@@ -526,7 +526,7 @@ void QLibraryPrivate::mergeLoadHints(QLibrary::LoadHints lh)
+     if (pHnd.loadRelaxed())
+         return;
+
+-    loadHintsInt.storeRelaxed(lh);
++    loadHintsInt.fetchAndOrRelaxed(lh);
+ }
+
+ QFunctionPointer QLibraryPrivate::resolve(const char *symbol)
+@@ -538,6 +538,13 @@ QFunctionPointer QLibraryPrivate::resolve(const char *symbol)
+
+ void QLibraryPrivate::setLoadHints(QLibrary::LoadHints lh)
+ {
++    // Set the load hints directly for a dummy if this object is not associated
++    // with a file. Such object is not shared between multiple instances.
++    if (fileName.isEmpty()) {
++        loadHintsInt.storeRelaxed(lh);
++        return;
++    }
++
+     // this locks a global mutex
+     QMutexLocker lock(&qt_library_mutex);
+     mergeLoadHints(lh);
+@@ -1166,6 +1173,10 @@ QString QLibrary::errorString() const
+     lazy symbol resolution, and will not export external symbols for resolution
+     in other dynamically-loaded libraries.
+
++    \note Hints can only be cleared when this object is not associated with a
++    file. Hints can only be added once the file name is set (\a hints will
++    be or'ed with the old hints).
++
+     \note Setting this property after the library has been loaded has no effect
+     and loadHints() will not reflect those changes.
+
+diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
+index 0a63b93762..ceee5d6385 100644
+--- a/src/corelib/plugin/qpluginloader.cpp
++++ b/src/corelib/plugin/qpluginloader.cpp
+@@ -414,10 +414,11 @@ QString QPluginLoader::errorString() const
+ void QPluginLoader::setLoadHints(QLibrary::LoadHints loadHints)
+ {
+     if (!d) {
+-        d = QLibraryPrivate::findOrCreate(QString());   // ugly, but we need a d-ptr
++        d = QLibraryPrivate::findOrCreate({}, {}, loadHints); // ugly, but we need a d-ptr
+         d->errorString.clear();
++    } else {
++        d->setLoadHints(loadHints);
+     }
+-    d->setLoadHints(loadHints);
+ }
+
+ QLibrary::LoadHints QPluginLoader::loadHints() const
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix
index de73bcbe2772..9f0feaf94e58 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix
@@ -15,6 +15,7 @@
   # optional dependencies
 , cups ? null, postgresql ? null
 , withGtk3 ? false, dconf, gtk3
+, qttranslations ? null
 
   # options
 , libGLSupported ? !stdenv.isDarwin
@@ -310,6 +311,8 @@ stdenv.mkDerivation (finalAttrs: {
     ] ++ lib.optionals (mysqlSupport) [
       "-L" "${libmysqlclient}/lib"
       "-I" "${libmysqlclient}/include"
+    ] ++ lib.optional (qttranslations != null) [
+      "-translationdir" "${qttranslations}/translations"
     ]
   );
 
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qttools.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qttools.nix
index be96236d7285..bac70d146bf9 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qttools.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qttools.nix
@@ -36,7 +36,7 @@ qtModule {
     "bin/macdeployqt"
   ];
 
-  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"'';
+  env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && qtdeclarative != null) ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"'';
 
   setupHook = ../hooks/qttools-setup-hook.sh;
 }
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qttranslations.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qttranslations.nix
index f49a4eb9a85d..bcd52cdc4a8f 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qttranslations.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qttranslations.nix
@@ -2,5 +2,6 @@
 
 qtModule {
   pname = "qttranslations";
-  qtInputs = [ qttools ];
+  nativeBuildInputs = [ qttools ];
+  outputs = [ "out" ];
 }
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/qtModule.nix b/nixpkgs/pkgs/development/libraries/qt-5/qtModule.nix
index 9abd9fabc957..bddbf254c5f7 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/qtModule.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/qtModule.nix
@@ -17,7 +17,7 @@ mkDerivation (args // {
   patches = (args.patches or []) ++ (patches.${pname} or []);
 
   nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ perl self.qmake ];
-  propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or []);
+  propagatedBuildInputs = (args.qtInputs or []) ++ (args.propagatedBuildInputs or []);
 
   outputs = args.outputs or [ "out" "dev" ];
   setOutputFlags = args.setOutputFlags or false;