1 |
commit: 53106843b6fec1b6a390bf6f3953ae49452407dc |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Aug 30 20:30:09 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Aug 30 20:30:09 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53106843 |
7 |
|
8 |
net-libs/libssh: fix build with musl |
9 |
|
10 |
Revbump as GNU_SOURCE can change runtime behaviour |
11 |
(and indeed that was partly the issue in contention here, |
12 |
although a build failure prevented it getting that far |
13 |
usually.) |
14 |
|
15 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
16 |
|
17 |
.../files/libssh-0.10.0-fix-musl-gnu-source.patch | 58 ++++++++++++++++++++++ |
18 |
...ibssh-0.10.0.ebuild => libssh-0.10.0-r1.ebuild} | 4 ++ |
19 |
2 files changed, 62 insertions(+) |
20 |
|
21 |
diff --git a/net-libs/libssh/files/libssh-0.10.0-fix-musl-gnu-source.patch b/net-libs/libssh/files/libssh-0.10.0-fix-musl-gnu-source.patch |
22 |
new file mode 100644 |
23 |
index 000000000000..be234bab53c9 |
24 |
--- /dev/null |
25 |
+++ b/net-libs/libssh/files/libssh-0.10.0-fix-musl-gnu-source.patch |
26 |
@@ -0,0 +1,58 @@ |
27 |
+https://gitlab.com/libssh/libssh-mirror/-/commit/8cf9c8162fc317761f19c35f60fc0cae7337ceea |
28 |
+https://gitlab.com/libssh/libssh-mirror/-/issues/141 |
29 |
+ |
30 |
+From: Jakub Jelen <jjelen@××××××.com> |
31 |
+Date: Mon, 29 Aug 2022 12:48:34 +0200 |
32 |
+Subject: [PATCH] Do not force GNU_SOURCE during build to fix #141 |
33 |
+ |
34 |
+Signed-off-by: Jakub Jelen <jjelen@××××××.com> |
35 |
+Reviewed-by: Andreas Schneider <asn@××××××××××.org> |
36 |
+--- a/src/CMakeLists.txt |
37 |
++++ b/src/CMakeLists.txt |
38 |
+@@ -348,10 +348,6 @@ endif (WITH_SYMBOL_VERSIONING AND HAVE_LD_VERSION_SCRIPT AND ABIMAP_FOUND) |
39 |
+ # This gets built as a static library, if -DBUILD_SHARED_LIBS=OFF is passed to |
40 |
+ # cmake. |
41 |
+ add_library(ssh ${libssh_SRCS}) |
42 |
+-target_compile_options(ssh |
43 |
+- PRIVATE |
44 |
+- ${DEFAULT_C_COMPILE_FLAGS} |
45 |
+- -D_GNU_SOURCE) |
46 |
+ target_include_directories(ssh |
47 |
+ PUBLIC |
48 |
+ $<BUILD_INTERFACE:${libssh_SOURCE_DIR}/include> |
49 |
+@@ -408,10 +404,6 @@ install(EXPORT libssh-config |
50 |
+ |
51 |
+ if (BUILD_STATIC_LIB) |
52 |
+ add_library(ssh-static STATIC ${libssh_SRCS}) |
53 |
+- target_compile_options(ssh-static |
54 |
+- PRIVATE |
55 |
+- ${DEFAULT_C_COMPILE_FLAGS} |
56 |
+- -D_GNU_SOURCE) |
57 |
+ |
58 |
+ target_include_directories(ssh-static |
59 |
+ PUBLIC |
60 |
+--- a/src/misc.c |
61 |
++++ b/src/misc.c |
62 |
+@@ -1956,7 +1956,7 @@ char *ssh_strerror(int err_num, char *buf, size_t buflen) |
63 |
+ #if defined(_WIN32) |
64 |
+ strerror_s(buf, buflen, err_num); |
65 |
+ return buf; |
66 |
+-#elif defined(__linux__) && defined(_GNU_SOURCE) |
67 |
++#elif defined(__linux__) && defined(__GLIBC__) && defined(_GNU_SOURCE) |
68 |
+ /* GNU extension on Linux */ |
69 |
+ return strerror_r(err_num, buf, buflen); |
70 |
+ #else |
71 |
+--- a/tests/torture.h |
72 |
++++ b/tests/torture.h |
73 |
+@@ -24,10 +24,6 @@ |
74 |
+ #ifndef _TORTURE_H |
75 |
+ #define _TORTURE_H |
76 |
+ |
77 |
+-#ifndef _GNU_SOURCE |
78 |
+-#define _GNU_SOURCE |
79 |
+-#endif |
80 |
+- |
81 |
+ #include <stdio.h> |
82 |
+ #include <stdlib.h> |
83 |
+ #include <stdarg.h> |
84 |
+GitLab |
85 |
|
86 |
diff --git a/net-libs/libssh/libssh-0.10.0.ebuild b/net-libs/libssh/libssh-0.10.0-r1.ebuild |
87 |
similarity index 98% |
88 |
rename from net-libs/libssh/libssh-0.10.0.ebuild |
89 |
rename to net-libs/libssh/libssh-0.10.0-r1.ebuild |
90 |
index 9b897cf8885e..0a5989b9a16b 100644 |
91 |
--- a/net-libs/libssh/libssh-0.10.0.ebuild |
92 |
+++ b/net-libs/libssh/libssh-0.10.0-r1.ebuild |
93 |
@@ -47,6 +47,10 @@ DOCS=( AUTHORS CHANGELOG README ) |
94 |
|
95 |
PATCHES=( "${FILESDIR}/${PN}-0.8.0-tests.patch" ) |
96 |
|
97 |
+PATCHES=( |
98 |
+ "${FILESDIR}"/${P}-fix-musl-gnu-source.patch |
99 |
+) |
100 |
+ |
101 |
src_prepare() { |
102 |
cmake_src_prepare |