Gentoo Archives: gentoo-commits

From: Quentin Retornaz <gentoo@××××××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/libressl:master commit in: net-libs/libssh2/files/, net-libs/libssh2/
Date: Sat, 07 May 2022 01:31:58
Message-Id: 1651886986.38adb1e500880665e8d3c9e3821555ce8393e6a0.quentin@gentoo
1 commit: 38adb1e500880665e8d3c9e3821555ce8393e6a0
2 Author: orbea <orbea <AT> riseup <DOT> net>
3 AuthorDate: Wed May 4 05:48:30 2022 +0000
4 Commit: Quentin Retornaz <gentoo <AT> retornaz <DOT> com>
5 CommitDate: Sat May 7 01:29:46 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=38adb1e5
7
8 net-libs/libssh2: Added
9
10 The only difference with the gentoo ebuild is appending
11 -DHAVE_OPAQUE_STRUCTS=1 to the cflags when both the gcrypt
12 and mbedtls USE flags are disabled.
13
14 This solution is taken from the OpenBSD libssh2 Makefile.
15
16 Signed-off-by: orbea <orbea <AT> riseup.net>
17 Closes: https://github.com/gentoo/libressl/pull/403
18 Signed-off-by: Quentin Retornaz <gentoo <AT> retornaz.com>
19
20 net-libs/libssh2/Manifest | 1 +
21 .../libssh2/files/libssh2-1.8.0-mansyntax_sh.patch | 41 ++++++++++++++++
22 net-libs/libssh2/libssh2-1.10.0.ebuild | 55 ++++++++++++++++++++++
23 net-libs/libssh2/metadata.xml | 15 ++++++
24 4 files changed, 112 insertions(+)
25
26 diff --git a/net-libs/libssh2/Manifest b/net-libs/libssh2/Manifest
27 new file mode 100644
28 index 0000000..95b30d0
29 --- /dev/null
30 +++ b/net-libs/libssh2/Manifest
31 @@ -0,0 +1 @@
32 +DIST libssh2-1.10.0.tar.gz 965044 BLAKE2B 0e6f571cc723e0050bf7ba7492f361ef222547dcbc311019cb6762f01405b4906e0418207a7d484c5170bee5e6f666827a7ea0d0cf233f684f999f896ce0b415 SHA512 e064ee1089eb8e6cd5fa2617f4fd8ff56c2721c5476775a98bdb68c6c4ee4d05c706c3bb0eb479a27a8ec0b17a8a5ef43e1d028ad3f134519aa582d3981a3a30
33
34 diff --git a/net-libs/libssh2/files/libssh2-1.8.0-mansyntax_sh.patch b/net-libs/libssh2/files/libssh2-1.8.0-mansyntax_sh.patch
35 new file mode 100644
36 index 0000000..3a33bf7
37 --- /dev/null
38 +++ b/net-libs/libssh2/files/libssh2-1.8.0-mansyntax_sh.patch
39 @@ -0,0 +1,41 @@
40 +--- a/tests/mansyntax.sh
41 ++++ b/tests/mansyntax.sh
42 +@@ -1,37 +1,2 @@
43 + #!/bin/sh
44 +-set -e
45 +-
46 +-# Written by Mikhail Gusarov
47 +-#
48 +-# Run syntax checks for all manpages in the documentation tree.
49 +-#
50 +-
51 +-srcdir=${srcdir:-$PWD}
52 +-dstdir=${builddir:-$PWD}
53 +-mandir=${srcdir}/../docs
54 +-
55 +-#
56 +-# Only test if suitable man is available
57 +-#
58 +-if ! man --help | grep -q warnings; then
59 +- echo "man version not suitable, skipping tests"
60 +- exit 0
61 +-fi
62 +-
63 +-ec=0
64 +-
65 +-trap "rm -f $dstdir/man3" EXIT
66 +-
67 +-ln -sf "$mandir" "$dstdir/man3"
68 +-
69 +-for manpage in $mandir/libssh2_*.*; do
70 +- echo "$manpage"
71 +- warnings=$(LANG=en_US.UTF-8 MANWIDTH=80 man -M "$dstdir" --warnings \
72 +- -E UTF-8 -l "$manpage" 2>&1 >/dev/null)
73 +- if [ -n "$warnings" ]; then
74 +- echo "$warnings"
75 +- ec=1
76 +- fi
77 +-done
78 +-
79 +-exit $ec
80 ++:
81
82 diff --git a/net-libs/libssh2/libssh2-1.10.0.ebuild b/net-libs/libssh2/libssh2-1.10.0.ebuild
83 new file mode 100644
84 index 0000000..843cfe6
85 --- /dev/null
86 +++ b/net-libs/libssh2/libssh2-1.10.0.ebuild
87 @@ -0,0 +1,55 @@
88 +# Copyright 1999-2021 Gentoo Authors
89 +# Distributed under the terms of the GNU General Public License v2
90 +
91 +EAPI=7
92 +CMAKE_ECLASS=cmake
93 +inherit cmake-multilib
94 +
95 +DESCRIPTION="Library implementing the SSH2 protocol"
96 +HOMEPAGE="https://www.libssh2.org"
97 +SRC_URI="https://www.libssh2.org/download/${P}.tar.gz"
98 +
99 +LICENSE="BSD"
100 +SLOT="0"
101 +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-solaris"
102 +IUSE="gcrypt mbedtls zlib"
103 +REQUIRED_USE="?? ( gcrypt mbedtls )"
104 +# Tests try to set containers up using docker (and fail for some reason).
105 +RESTRICT="test"
106 +
107 +RDEPEND="
108 + gcrypt? ( >=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] )
109 + !gcrypt? (
110 + mbedtls? ( net-libs/mbedtls:0=[${MULTILIB_USEDEP}] )
111 + !mbedtls? (
112 + >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
113 + )
114 + )
115 + zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
116 +"
117 +DEPEND="
118 + ${RDEPEND}
119 +"
120 +
121 +multilib_src_configure() {
122 + local crypto_backend=OpenSSL
123 + if use gcrypt; then
124 + crypto_backend=Libgcrypt
125 + elif use mbedtls; then
126 + crypto_backend=mbedTLS
127 + else
128 + append-cflags -DHAVE_OPAQUE_STRUCTS=1
129 + fi
130 +
131 + local mycmakeargs=(
132 + -DBUILD_SHARED_LIBS=ON
133 + -DCRYPTO_BACKEND=${crypto_backend}
134 + -DENABLE_ZLIB_COMPRESSION=$(usex zlib)
135 + )
136 + cmake_src_configure
137 +}
138 +
139 +multilib_src_install_all() {
140 + einstalldocs
141 + find "${ED}" -name '*.la' -delete || die
142 +}
143
144 diff --git a/net-libs/libssh2/metadata.xml b/net-libs/libssh2/metadata.xml
145 new file mode 100644
146 index 0000000..f072d71
147 --- /dev/null
148 +++ b/net-libs/libssh2/metadata.xml
149 @@ -0,0 +1,15 @@
150 +<?xml version="1.0" encoding="UTF-8"?>
151 +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
152 +<pkgmetadata>
153 +<maintainer type="project">
154 +<email>netmon@g.o</email>
155 +</maintainer>
156 +<maintainer type="person">
157 + <email>mgorny@g.o</email>
158 + <name>Michał Górny</name>
159 +</maintainer>
160 +<use>
161 + <flag name="gcrypt">Use <pkg>dev-libs/libgcrypt</pkg> instead of <pkg>dev-libs/openssl</pkg></flag>
162 + <flag name="mbedtls">Use <pkg>net-libs/mbedtls</pkg> instead of <pkg>dev-libs/openssl</pkg></flag>
163 +</use>
164 +</pkgmetadata>