]> git.pld-linux.org Git - packages/domoticz.git/blame - domoticz-python.patch
up to 2021.1
[packages/domoticz.git] / domoticz-python.patch
CommitLineData
10f7a92e
AM
1From f7b229ce873ff71e2b48e855075153dc1026750d Mon Sep 17 00:00:00 2001
2From: Michael Cronenworth <mike@cchtml.com>
3Date: Mon, 7 Aug 2017 14:37:28 -0500
4Subject: [PATCH] Follow PEP-384 when finding and opening python3 library
5
6Instead of maintaining a list of all Python versions the Python 3
7standard defines that there MUST be a stable ABI and we can always
8rely on a "python3.dll" or a "libpython3.so" existing.
9
10This also fixes library loading on Linux distributions that use
11SO versioned libraries.
12---
13 hardware/plugins/DelayedLink.h | 28 ++--------------------------
14 1 file changed, 2 insertions(+), 26 deletions(-)
15
16diff --git a/hardware/plugins/DelayedLink.h b/hardware/plugins/DelayedLink.h
17index 25c83f034..ecf19da09 100644
18--- a/hardware/plugins/DelayedLink.h
19+++ b/hardware/plugins/DelayedLink.h
9a71e0cb 20@@ -150,20 +150,10 @@
9dda6696
AM
21 if (!shared_lib_) shared_lib_ = LoadLibrary("python35_d.dll");
22 if (!shared_lib_) shared_lib_ = LoadLibrary("python34_d.dll");
23 # else
9a71e0cb 24- if (!shared_lib_) shared_lib_ = LoadLibrary("python39.dll");
86ad2462 25- if (!shared_lib_) shared_lib_ = LoadLibrary("python38.dll");
9dda6696
AM
26- if (!shared_lib_) shared_lib_ = LoadLibrary("python37.dll");
27- if (!shared_lib_) shared_lib_ = LoadLibrary("python36.dll");
28- if (!shared_lib_) shared_lib_ = LoadLibrary("python35.dll");
29- if (!shared_lib_) shared_lib_ = LoadLibrary("python34.dll");
86ad2462 30+ if (!shared_lib_) shared_lib_ = LoadLibrary("python.dll");
9dda6696
AM
31 # endif
32 #else
9a71e0cb 33- if (!shared_lib_) FindLibrary("python3.9", true);
86ad2462 34- if (!shared_lib_) FindLibrary("python3.8", true);
9dda6696
AM
35- if (!shared_lib_) FindLibrary("python3.7", true);
36- if (!shared_lib_) FindLibrary("python3.6", true);
37- if (!shared_lib_) FindLibrary("python3.5", true);
38- if (!shared_lib_) FindLibrary("python3.4", true);
39+ if (!shared_lib_) FindLibrary("python3", true);
10f7a92e
AM
40 #ifdef __FreeBSD__
41 if (!shared_lib_) FindLibrary("python3.7m", true);
42 if (!shared_lib_) FindLibrary("python3.6m", true);
86ad2462 43@@ -271,24 +263,12 @@
9dda6696
AM
44 library = "lib" + sLibrary + ".so";
45 shared_lib_ = dlopen(library.c_str(), RTLD_LAZY | RTLD_GLOBAL);
46 }
47- // look in directories covered by ldconfig but 'm' variant
48- if (!shared_lib_)
49- {
50- library = "lib" + sLibrary + "m.so";
51- shared_lib_ = dlopen(library.c_str(), RTLD_LAZY | RTLD_GLOBAL);
52- }
53 // look in /usr/lib directories
54 if (!shared_lib_)
55 {
56 library = "/usr/lib/" + sLibrary + "/";
57 FindLibrary(library, false);
58 }
59- // look in /usr/lib directories but 'm' variant
60- if (!shared_lib_)
61- {
62- library = "/usr/lib/" + sLibrary + "m/";
63- FindLibrary(library, false);
64- }
65 // look in /usr/local/lib directory (handles build from source)
66 if (!shared_lib_)
67 {
86ad2462 68@@ -296,12 +276,6 @@
9dda6696
AM
69 shared_lib_ = dlopen(library.c_str(), RTLD_LAZY | RTLD_GLOBAL);
70
71 }
72- // look in /usr/local/lib directory (handles build from source) but 'm' variant
73- if (!shared_lib_)
74- {
75- library = "/usr/local/lib/lib" + sLibrary + "m.so";
76- shared_lib_ = dlopen(library.c_str(), RTLD_LAZY | RTLD_GLOBAL);
77- }
86ad2462
JK
78 // MacOS
79 // look for .dylib in /usr/local/lib
80 if (!shared_lib_)
This page took 0.084159 seconds and 4 git commands to generate.