]> git.pld-linux.org Git - packages/domoticz.git/blame - domoticz-python.patch
- initial; from FC
[packages/domoticz.git] / domoticz-python.patch
CommitLineData
9dda6696
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
20@@ -126,16 +126,10 @@ namespace Plugins {
21 if (!shared_lib_) shared_lib_ = LoadLibrary("python35_d.dll");
22 if (!shared_lib_) shared_lib_ = LoadLibrary("python34_d.dll");
23 # else
24- if (!shared_lib_) shared_lib_ = LoadLibrary("python37.dll");
25- if (!shared_lib_) shared_lib_ = LoadLibrary("python36.dll");
26- if (!shared_lib_) shared_lib_ = LoadLibrary("python35.dll");
27- if (!shared_lib_) shared_lib_ = LoadLibrary("python34.dll");
28+ if (!shared_lib_) shared_lib_ = LoadLibrary("python3.dll");
29 # endif
30 #else
31- if (!shared_lib_) FindLibrary("python3.7", true);
32- if (!shared_lib_) FindLibrary("python3.6", true);
33- if (!shared_lib_) FindLibrary("python3.5", true);
34- if (!shared_lib_) FindLibrary("python3.4", true);
35+ if (!shared_lib_) FindLibrary("python3", true);
36 #endif
37 if (shared_lib_)
38 {
39@@ -232,24 +226,12 @@ namespace Plugins {
40 library = "lib" + sLibrary + ".so";
41 shared_lib_ = dlopen(library.c_str(), RTLD_LAZY | RTLD_GLOBAL);
42 }
43- // look in directories covered by ldconfig but 'm' variant
44- if (!shared_lib_)
45- {
46- library = "lib" + sLibrary + "m.so";
47- shared_lib_ = dlopen(library.c_str(), RTLD_LAZY | RTLD_GLOBAL);
48- }
49 // look in /usr/lib directories
50 if (!shared_lib_)
51 {
52 library = "/usr/lib/" + sLibrary + "/";
53 FindLibrary(library, false);
54 }
55- // look in /usr/lib directories but 'm' variant
56- if (!shared_lib_)
57- {
58- library = "/usr/lib/" + sLibrary + "m/";
59- FindLibrary(library, false);
60- }
61 // look in /usr/local/lib directory (handles build from source)
62 if (!shared_lib_)
63 {
64@@ -257,12 +239,6 @@ namespace Plugins {
65 shared_lib_ = dlopen(library.c_str(), RTLD_LAZY | RTLD_GLOBAL);
66
67 }
68- // look in /usr/local/lib directory (handles build from source) but 'm' variant
69- if (!shared_lib_)
70- {
71- library = "/usr/local/lib/lib" + sLibrary + "m.so";
72- shared_lib_ = dlopen(library.c_str(), RTLD_LAZY | RTLD_GLOBAL);
73- }
74 }
75 else
76 {
This page took 0.07599 seconds and 4 git commands to generate.