summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-08-30 21:30:09 +0100
committerSam James <sam@gentoo.org>2022-08-30 21:30:09 +0100
commit53106843b6fec1b6a390bf6f3953ae49452407dc (patch)
treec89c1c68c141b346bcf776a38c08824fad1f934a /net-libs/libssh
parentnet-libs/libssh: add gitlab upstream metadata (diff)
downloadgentoo-53106843b6fec1b6a390bf6f3953ae49452407dc.tar.gz
gentoo-53106843b6fec1b6a390bf6f3953ae49452407dc.tar.bz2
gentoo-53106843b6fec1b6a390bf6f3953ae49452407dc.zip
net-libs/libssh: fix build with musl
Revbump as GNU_SOURCE can change runtime behaviour (and indeed that was partly the issue in contention here, although a build failure prevented it getting that far usually.) Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-libs/libssh')
-rw-r--r--net-libs/libssh/files/libssh-0.10.0-fix-musl-gnu-source.patch58
-rw-r--r--net-libs/libssh/libssh-0.10.0-r1.ebuild (renamed from net-libs/libssh/libssh-0.10.0.ebuild)4
2 files changed, 62 insertions, 0 deletions
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
new file mode 100644
index 000000000000..be234bab53c9
--- /dev/null
+++ b/net-libs/libssh/files/libssh-0.10.0-fix-musl-gnu-source.patch
@@ -0,0 +1,58 @@
+https://gitlab.com/libssh/libssh-mirror/-/commit/8cf9c8162fc317761f19c35f60fc0cae7337ceea
+https://gitlab.com/libssh/libssh-mirror/-/issues/141
+
+From: Jakub Jelen <jjelen@redhat.com>
+Date: Mon, 29 Aug 2022 12:48:34 +0200
+Subject: [PATCH] Do not force GNU_SOURCE during build to fix #141
+
+Signed-off-by: Jakub Jelen <jjelen@redhat.com>
+Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -348,10 +348,6 @@ endif (WITH_SYMBOL_VERSIONING AND HAVE_LD_VERSION_SCRIPT AND ABIMAP_FOUND)
+ # This gets built as a static library, if -DBUILD_SHARED_LIBS=OFF is passed to
+ # cmake.
+ add_library(ssh ${libssh_SRCS})
+-target_compile_options(ssh
+- PRIVATE
+- ${DEFAULT_C_COMPILE_FLAGS}
+- -D_GNU_SOURCE)
+ target_include_directories(ssh
+ PUBLIC
+ $<BUILD_INTERFACE:${libssh_SOURCE_DIR}/include>
+@@ -408,10 +404,6 @@ install(EXPORT libssh-config
+
+ if (BUILD_STATIC_LIB)
+ add_library(ssh-static STATIC ${libssh_SRCS})
+- target_compile_options(ssh-static
+- PRIVATE
+- ${DEFAULT_C_COMPILE_FLAGS}
+- -D_GNU_SOURCE)
+
+ target_include_directories(ssh-static
+ PUBLIC
+--- a/src/misc.c
++++ b/src/misc.c
+@@ -1956,7 +1956,7 @@ char *ssh_strerror(int err_num, char *buf, size_t buflen)
+ #if defined(_WIN32)
+ strerror_s(buf, buflen, err_num);
+ return buf;
+-#elif defined(__linux__) && defined(_GNU_SOURCE)
++#elif defined(__linux__) && defined(__GLIBC__) && defined(_GNU_SOURCE)
+ /* GNU extension on Linux */
+ return strerror_r(err_num, buf, buflen);
+ #else
+--- a/tests/torture.h
++++ b/tests/torture.h
+@@ -24,10 +24,6 @@
+ #ifndef _TORTURE_H
+ #define _TORTURE_H
+
+-#ifndef _GNU_SOURCE
+-#define _GNU_SOURCE
+-#endif
+-
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stdarg.h>
+GitLab
diff --git a/net-libs/libssh/libssh-0.10.0.ebuild b/net-libs/libssh/libssh-0.10.0-r1.ebuild
index 9b897cf8885e..0a5989b9a16b 100644
--- a/net-libs/libssh/libssh-0.10.0.ebuild
+++ b/net-libs/libssh/libssh-0.10.0-r1.ebuild
@@ -47,6 +47,10 @@ DOCS=( AUTHORS CHANGELOG README )
PATCHES=( "${FILESDIR}/${PN}-0.8.0-tests.patch" )
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-musl-gnu-source.patch
+)
+
src_prepare() {
cmake_src_prepare