about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/qt-5/5.6/qtserialport.patch
blob: b2cffbe4f39b2f5b56891a1e4ac6ad7132f4899d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/src/serialport/qtudev_p.h b/src/serialport/qtudev_p.h
index 6f2cabd..cd3c0ed 100644
--- a/src/serialport/qtudev_p.h
+++ b/src/serialport/qtudev_p.h
@@ -105,9 +105,17 @@ inline QFunctionPointer resolveSymbol(QLibrary *udevLibrary, const char *symbolN
 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;