1 |
commit: c191801ff491f6e9058e7c2fc511c9672b04f1dc |
2 |
Author: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Oct 2 13:32:01 2018 +0000 |
4 |
Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 2 13:33:04 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c191801f |
7 |
|
8 |
net-libs/libssh: Fix compile error on HPPA |
9 |
|
10 |
Package-Manager: Portage-2.3.50, Repoman-2.3.11 |
11 |
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org> |
12 |
|
13 |
.../files/libssh-0.8.3-strict-overflow.patch | 21 ++++ |
14 |
net-libs/libssh/libssh-0.8.3-r1.ebuild | 111 +++++++++++++++++++++ |
15 |
2 files changed, 132 insertions(+) |
16 |
|
17 |
diff --git a/net-libs/libssh/files/libssh-0.8.3-strict-overflow.patch b/net-libs/libssh/files/libssh-0.8.3-strict-overflow.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..93b15ec061b |
20 |
--- /dev/null |
21 |
+++ b/net-libs/libssh/files/libssh-0.8.3-strict-overflow.patch |
22 |
@@ -0,0 +1,21 @@ |
23 |
+Neither i nor j are ever counted downward for the array pointers, so assume |
24 |
+they were intended to be signed integers. |
25 |
+ |
26 |
+Fixes a compiler warning on HPPA triggering an error because of |
27 |
+-Werror=strict-overflow -Wstrict-overflow=2: |
28 |
+ |
29 |
+src/connect.c:509:7: error: assuming signed overflow does not occur when |
30 |
+simplifying conditional to constant [-Werror=strict-overflow] |
31 |
+ if(j != 0) |
32 |
+ ^ |
33 |
+--- a/src/connect.c |
34 |
++++ b/src/connect.c |
35 |
+@@ -471,7 +471,7 @@ |
36 |
+ fd_set *readfds, struct timeval *timeout) { |
37 |
+ fd_set origfds; |
38 |
+ socket_t fd; |
39 |
+- int i,j; |
40 |
++ unsigned int i,j; |
41 |
+ int rc; |
42 |
+ int base_tm, tm; |
43 |
+ struct ssh_timestamp ts; |
44 |
|
45 |
diff --git a/net-libs/libssh/libssh-0.8.3-r1.ebuild b/net-libs/libssh/libssh-0.8.3-r1.ebuild |
46 |
new file mode 100644 |
47 |
index 00000000000..7b660604f3a |
48 |
--- /dev/null |
49 |
+++ b/net-libs/libssh/libssh-0.8.3-r1.ebuild |
50 |
@@ -0,0 +1,111 @@ |
51 |
+# Copyright 1999-2018 Gentoo Authors |
52 |
+# Distributed under the terms of the GNU General Public License v2 |
53 |
+ |
54 |
+EAPI=6 |
55 |
+ |
56 |
+MY_P="${PN}-${PV/_rc/rc}" |
57 |
+inherit cmake-multilib |
58 |
+ |
59 |
+DESCRIPTION="Access a working SSH implementation by means of a library" |
60 |
+HOMEPAGE="https://www.libssh.org/" |
61 |
+ |
62 |
+if [[ "${PV}" == *9999 ]] ; then |
63 |
+ inherit git-r3 |
64 |
+ EGIT_REPO_URI="https://git.libssh.org/projects/libssh.git" |
65 |
+else |
66 |
+ inherit eapi7-ver |
67 |
+ SRC_URI="https://www.libssh.org/files/$(ver_cut 1-2)/${MY_P}.tar.xz" |
68 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux" |
69 |
+fi |
70 |
+ |
71 |
+LICENSE="LGPL-2.1" |
72 |
+SLOT="0/4" # subslot = soname major version |
73 |
+IUSE="debug doc examples gcrypt gssapi libressl mbedtls pcap server +sftp static-libs test zlib" |
74 |
+# Maintainer: check IUSE-defaults at DefineOptions.cmake |
75 |
+ |
76 |
+REQUIRED_USE="?? ( gcrypt mbedtls ) test? ( static-libs )" |
77 |
+ |
78 |
+RDEPEND=" |
79 |
+ !gcrypt? ( |
80 |
+ !mbedtls? ( |
81 |
+ !libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] ) |
82 |
+ libressl? ( dev-libs/libressl:=[${MULTILIB_USEDEP}] ) |
83 |
+ ) |
84 |
+ ) |
85 |
+ gcrypt? ( >=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] ) |
86 |
+ gssapi? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] ) |
87 |
+ mbedtls? ( net-libs/mbedtls[${MULTILIB_USEDEP}] ) |
88 |
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] ) |
89 |
+" |
90 |
+DEPEND="${RDEPEND} |
91 |
+ doc? ( app-doc/doxygen[dot] ) |
92 |
+ test? ( >=dev-util/cmocka-0.3.1[${MULTILIB_USEDEP}] ) |
93 |
+" |
94 |
+ |
95 |
+DOCS=( AUTHORS README ChangeLog ) |
96 |
+ |
97 |
+S="${WORKDIR}/${MY_P}" |
98 |
+ |
99 |
+PATCHES=( |
100 |
+ "${FILESDIR}/${PN}-0.8.0-tests.patch" |
101 |
+ "${FILESDIR}/${PN}-0.8.3-strict-overflow.patch" |
102 |
+) |
103 |
+ |
104 |
+src_prepare() { |
105 |
+ cmake-utils_src_prepare |
106 |
+ |
107 |
+ # just install the examples, do not compile them |
108 |
+ cmake_comment_add_subdirectory examples |
109 |
+ |
110 |
+ # keyfile torture test is currently broken |
111 |
+ sed -i \ |
112 |
+ -e '/torture_keyfiles/d' \ |
113 |
+ tests/unittests/CMakeLists.txt || die |
114 |
+} |
115 |
+ |
116 |
+multilib_src_configure() { |
117 |
+ local mycmakeargs=( |
118 |
+ -DUNIT_TESTING="$(usex test)" |
119 |
+ -DWITH_DEBUG_CALLTRACE="$(usex debug)" |
120 |
+ -DWITH_DEBUG_CRYPTO="$(usex debug)" |
121 |
+ -DWITH_GCRYPT="$(usex gcrypt)" |
122 |
+ -DWITH_GSSAPI="$(usex gssapi)" |
123 |
+ -DWITH_MBEDTLS="$(usex mbedtls)" |
124 |
+ -DWITH_NACL=no |
125 |
+ -DWITH_PCAP="$(usex pcap)" |
126 |
+ -DWITH_SERVER="$(usex server)" |
127 |
+ -DWITH_SFTP="$(usex sftp)" |
128 |
+ -DWITH_STACK_PROTECTOR=OFF |
129 |
+ -DWITH_STACK_PROTECTOR_STRONG=OFF |
130 |
+ -DWITH_STATIC_LIB="$(usex static-libs)" |
131 |
+ -DWITH_ZLIB="$(usex zlib)" |
132 |
+ ) |
133 |
+ |
134 |
+ multilib_is_native_abi || mycmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON ) |
135 |
+ |
136 |
+ cmake-utils_src_configure |
137 |
+} |
138 |
+ |
139 |
+multilib_src_compile() { |
140 |
+ cmake-utils_src_compile |
141 |
+ multilib_is_native_abi && use doc && cmake-utils_src_compile docs |
142 |
+} |
143 |
+ |
144 |
+multilib_src_install() { |
145 |
+ cmake-utils_src_install |
146 |
+ use doc && HTML_DOCS=( "${BUILD_DIR}"/doc/html/. ) |
147 |
+ |
148 |
+ # compatibility symlink until all consumers have been updated |
149 |
+ # to no longer use libssh_threads.so |
150 |
+ dosym libssh.so /usr/$(get_libdir)/libssh_threads.so |
151 |
+} |
152 |
+ |
153 |
+multilib_src_install_all() { |
154 |
+ use mbedtls && DOCS+=( README.mbedtls ) |
155 |
+ einstalldocs |
156 |
+ |
157 |
+ if use examples; then |
158 |
+ docinto examples |
159 |
+ dodoc examples/*.{c,h,cpp} |
160 |
+ fi |
161 |
+} |