1 |
commit: e35e4ff449e6652e55bc03dadbe6cb0629141175 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Feb 6 09:12:04 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Feb 6 09:12:36 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e35e4ff4 |
7 |
|
8 |
sci-libs/indilib: fix musl build |
9 |
|
10 |
Closes: https://bugs.gentoo.org/829487 |
11 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
12 |
|
13 |
.../indilib/files/indilib-1.9.4-musl-stdint.patch | 108 +++++++++++++++++++++ |
14 |
sci-libs/indilib/indilib-1.9.4.ebuild | 4 + |
15 |
2 files changed, 112 insertions(+) |
16 |
|
17 |
diff --git a/sci-libs/indilib/files/indilib-1.9.4-musl-stdint.patch b/sci-libs/indilib/files/indilib-1.9.4-musl-stdint.patch |
18 |
new file mode 100644 |
19 |
index 000000000000..9adfae6bac25 |
20 |
--- /dev/null |
21 |
+++ b/sci-libs/indilib/files/indilib-1.9.4-musl-stdint.patch |
22 |
@@ -0,0 +1,108 @@ |
23 |
+https://patch-diff.githubusercontent.com/raw/indilib/indi/pull/1618.patch |
24 |
+ |
25 |
+From: Sam James <sam@g.o> |
26 |
+Date: Sun, 6 Feb 2022 08:16:44 +0000 |
27 |
+Subject: [PATCH] Use <stdint.h> for uint* types (fix build on musl) |
28 |
+ |
29 |
+<stdint.h> is already being used in some places, as are its |
30 |
+types, e.g. uint8_t, but in some places, non-standard types |
31 |
+like u_int16_t were being mix-and-matched. |
32 |
+ |
33 |
+Consistently use the <stdint.h> types to fix build on e.g. |
34 |
+musl. |
35 |
+ |
36 |
+Bug: https://bugs.gentoo.org/829487 |
37 |
+Signed-off-by: Sam James <sam@g.o> |
38 |
+--- a/base64.c |
39 |
++++ b/base64.c |
40 |
+@@ -45,7 +45,7 @@ |
41 |
+ * Swap bytes in 16-bit value. |
42 |
+ */ |
43 |
+ //#define bswap_16(x) __builtin_bswap16 (x); |
44 |
+-#define bswap_16(x) ((__uint16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))) |
45 |
++#define bswap_16(x) ((uint16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))) |
46 |
+ |
47 |
+ #include <arpa/inet.h> |
48 |
+ #define IS_BIG_ENDIAN (1 == htons(1)) |
49 |
+--- a/drivers/focuser/focuslynxbase.cpp |
50 |
++++ b/drivers/focuser/focuslynxbase.cpp |
51 |
+@@ -2821,7 +2821,7 @@ bool FocusLynxBase::SyncFocuser(uint32_t ticks) |
52 |
+ /************************************************************************************ |
53 |
+ * |
54 |
+ * ***********************************************************************************/ |
55 |
+-//bool FocusLynxBase::setMaxTravel(u_int16_t travel) |
56 |
++//bool FocusLynxBase::setMaxTravel(uint16_t travel) |
57 |
+ bool FocusLynxBase::SetFocuserMaxPosition(uint32_t ticks) |
58 |
+ { |
59 |
+ char cmd[LYNX_MAX] = {0}; |
60 |
+@@ -2886,7 +2886,7 @@ bool FocusLynxBase::SetFocuserMaxPosition(uint32_t ticks) |
61 |
+ /************************************************************************************ |
62 |
+ * |
63 |
+ * ***********************************************************************************/ |
64 |
+-bool FocusLynxBase::setStepSize(u_int16_t stepsize) |
65 |
++bool FocusLynxBase::setStepSize(uint16_t stepsize) |
66 |
+ { |
67 |
+ char cmd[LYNX_MAX] = {0}; |
68 |
+ int errcode = 0; |
69 |
+--- a/drivers/focuser/focuslynxbase.h |
70 |
++++ b/drivers/focuser/focuslynxbase.h |
71 |
+@@ -28,6 +28,7 @@ |
72 |
+ #include "connectionplugins/connectiontcp.h" |
73 |
+ |
74 |
+ #include <map> |
75 |
++#include <stdint.h> |
76 |
+ #include <termios.h> |
77 |
+ #include <unistd.h> |
78 |
+ #include <memory> |
79 |
+@@ -154,7 +155,7 @@ class FocusLynxBase : public INDI::Focuser |
80 |
+ // Set functions |
81 |
+ |
82 |
+ // Position |
83 |
+- bool setStepSize(u_int16_t stepsize); |
84 |
++ bool setStepSize(uint16_t stepsize); |
85 |
+ |
86 |
+ // Temperature |
87 |
+ bool setTemperatureCompensation(bool enable); |
88 |
+--- a/drivers/rotator/gemini.h |
89 |
++++ b/drivers/rotator/gemini.h |
90 |
+@@ -23,6 +23,7 @@ |
91 |
+ #include "indifocuser.h" |
92 |
+ #include "indirotatorinterface.h" |
93 |
+ |
94 |
++#include <stdint.h> |
95 |
+ #include <map> |
96 |
+ |
97 |
+ class Gemini : public INDI::Focuser, public INDI::RotatorInterface |
98 |
+@@ -132,7 +133,7 @@ class Gemini : public INDI::Focuser, public INDI::RotatorInterface |
99 |
+ // Set functions |
100 |
+ |
101 |
+ // Position |
102 |
+- bool setFocusPosition(u_int16_t position); |
103 |
++ bool setFocusPosition(uint16_t position); |
104 |
+ |
105 |
+ // Temperature |
106 |
+ bool setTemperatureCompensation(bool enable); |
107 |
+--- a/drivers/telescope/celestrondriver.h |
108 |
++++ b/drivers/telescope/celestrondriver.h |
109 |
+@@ -28,10 +28,7 @@ |
110 |
+ #include <string> |
111 |
+ #include "indicom.h" |
112 |
+ |
113 |
+-#ifdef __FreeBSD__ |
114 |
+ #include <stdint.h> |
115 |
+-typedef uint8_t u_int8_t; |
116 |
+-#endif |
117 |
+ |
118 |
+ //#include <thread> |
119 |
+ //#include <condition_variable> |
120 |
+@@ -312,8 +309,8 @@ class CelestronDriver |
121 |
+ |
122 |
+ // get and set guide rate |
123 |
+ // 0 to 255 corresponding to 0 to 100% sidereal |
124 |
+- bool get_guide_rate(CELESTRON_AXIS axis, u_int8_t * rate); |
125 |
+- bool set_guide_rate(CELESTRON_AXIS axis, u_int8_t rate); |
126 |
++ bool get_guide_rate(CELESTRON_AXIS axis, uint8_t * rate); |
127 |
++ bool set_guide_rate(CELESTRON_AXIS axis, uint8_t rate); |
128 |
+ |
129 |
+ // Pointing state, pier side, returns 'E' or 'W' |
130 |
+ bool get_pier_side(char * sop); |
131 |
|
132 |
diff --git a/sci-libs/indilib/indilib-1.9.4.ebuild b/sci-libs/indilib/indilib-1.9.4.ebuild |
133 |
index b6d000763a3b..6180a9207d72 100644 |
134 |
--- a/sci-libs/indilib/indilib-1.9.4.ebuild |
135 |
+++ b/sci-libs/indilib/indilib-1.9.4.ebuild |
136 |
@@ -39,6 +39,10 @@ DEPEND="${RDEPEND} |
137 |
websocket? ( dev-cpp/websocketpp ) |
138 |
" |
139 |
|
140 |
+PATCHES=( |
141 |
+ "${FILESDIR}"/${PN}-1.9.4-musl-stdint.patch |
142 |
+) |
143 |
+ |
144 |
src_configure() { |
145 |
local mycmakeargs=( |
146 |
-DINDI_BUILD_QT5_CLIENT=OFF |