forked from mirrors/nixpkgs
qt58.qtserialport: use QLatin1String instead of QStringLiteral
This commit is contained in:
parent
f392614251
commit
b1dcd271d1
|
@ -1,28 +0,0 @@
|
||||||
From d81c2c870b9bea8fb8e6b85baefb06542f568338 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Thomas Tuegel <ttuegel@gmail.com>
|
|
||||||
Date: Sun, 23 Aug 2015 09:16:02 -0500
|
|
||||||
Subject: [PATCH] dlopen serialport udev
|
|
||||||
|
|
||||||
---
|
|
||||||
src/serialport/qtudev_p.h | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/serialport/qtudev_p.h b/src/serialport/qtudev_p.h
|
|
||||||
index 6f2cabd..81b9849 100644
|
|
||||||
--- a/src/serialport/qtudev_p.h
|
|
||||||
+++ b/src/serialport/qtudev_p.h
|
|
||||||
@@ -105,9 +105,9 @@ inline QFunctionPointer resolveSymbol(QLibrary *udevLibrary, const char *symbolN
|
|
||||||
inline bool resolveSymbols(QLibrary *udevLibrary)
|
|
||||||
{
|
|
||||||
if (!udevLibrary->isLoaded()) {
|
|
||||||
- udevLibrary->setFileNameAndVersion(QStringLiteral("udev"), 1);
|
|
||||||
+ udevLibrary->setFileNameAndVersion(QStringLiteral("@libudev@/lib/libudev"), 1);
|
|
||||||
if (!udevLibrary->load()) {
|
|
||||||
- udevLibrary->setFileNameAndVersion(QStringLiteral("udev"), 0);
|
|
||||||
+ udevLibrary->setFileNameAndVersion(QStringLiteral("@libudev@/lib/libudev"), 0);
|
|
||||||
if (!udevLibrary->load()) {
|
|
||||||
qWarning("Failed to load the library: %s, supported version(s): %i and %i", qPrintable(udevLibrary->fileName()), 1, 0);
|
|
||||||
return false;
|
|
||||||
--
|
|
||||||
2.5.0
|
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
{ stdenv, qtSubmodule, qtbase, substituteAll, systemd }:
|
{ stdenv, qtSubmodule, lib, copyPathsToStore, qtbase, substituteAll, systemd }:
|
||||||
|
|
||||||
with stdenv.lib;
|
let inherit (lib) getLib optional; in
|
||||||
|
|
||||||
qtSubmodule {
|
qtSubmodule {
|
||||||
name = "qtserialport";
|
name = "qtserialport";
|
||||||
qtInputs = [ qtbase ];
|
qtInputs = [ qtbase ];
|
||||||
patches = optionals (stdenv.isLinux) [
|
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
|
||||||
(substituteAll {
|
NIX_CFLAGS_COMPILE =
|
||||||
src = ./0001-dlopen-serialport-udev.patch;
|
optional stdenv.isLinux
|
||||||
libudev = systemd.lib;
|
''-DNIXPKGS_LIBUDEV="${getLib systemd}/lib/libudev"'';
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
Index: qtserialport-opensource-src-5.8.0/src/serialport/qtudev_p.h
|
||||||
|
===================================================================
|
||||||
|
--- qtserialport-opensource-src-5.8.0.orig/src/serialport/qtudev_p.h
|
||||||
|
+++ qtserialport-opensource-src-5.8.0/src/serialport/qtudev_p.h
|
||||||
|
@@ -111,9 +111,17 @@ inline QFunctionPointer resolveSymbol(QL
|
||||||
|
inline bool resolveSymbols(QLibrary *udevLibrary)
|
||||||
|
{
|
||||||
|
if (!udevLibrary->isLoaded()) {
|
||||||
|
+#ifdef NIXPKGS_LIBUDEV
|
||||||
|
+ udevLibrary->setFileNameAndVersion(QLatin1String(NIXPKGS_LIBUDEV), 1);
|
||||||
|
+#else
|
||||||
|
udevLibrary->setFileNameAndVersion(QStringLiteral("udev"), 1);
|
||||||
|
+#endif
|
||||||
|
if (!udevLibrary->load()) {
|
||||||
|
+#ifdef NIXPKGS_LIBUDEV
|
||||||
|
+ udevLibrary->setFileNameAndVersion(QLatin1String(NIXPKGS_LIBUDEV), 0);
|
||||||
|
+#else
|
||||||
|
udevLibrary->setFileNameAndVersion(QStringLiteral("udev"), 0);
|
||||||
|
+#endif
|
||||||
|
if (!udevLibrary->load()) {
|
||||||
|
qWarning("Failed to load the library: %s, supported version(s): %i and %i", qPrintable(udevLibrary->fileName()), 1, 0);
|
||||||
|
return false;
|
1
pkgs/development/libraries/qt-5/5.8/qtserialport/series
Normal file
1
pkgs/development/libraries/qt-5/5.8/qtserialport/series
Normal file
|
@ -0,0 +1 @@
|
||||||
|
qtserialport-dlopen-udev.patch
|
Loading…
Reference in a new issue