Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-vpn/i2pd/, net-vpn/i2pd/files/
Date: Sat, 09 Jan 2021 12:55:40
Message-Id: 1610196312.9d525905e50dc0b4902b9811db594af913e5d60d.sam@gentoo
1 commit: 9d525905e50dc0b4902b9811db594af913e5d60d
2 Author: Alexey Korepanov <kaikaikai <AT> yandex <DOT> ru>
3 AuthorDate: Fri Jan 8 16:13:25 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 9 12:45:12 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d525905
7
8 net-vpn/i2pd: version bump to 2.35.0
9
10 Signed-off-by: Alexey Korepanov <kaikaikai <AT> yandex.ru>
11 Closes: https://bugs.gentoo.org/763033
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 net-vpn/i2pd/Manifest | 1 +
15 net-vpn/i2pd/files/i2pd-2.35.0-avx-detection.patch | 32 ++++++++
16 net-vpn/i2pd/i2pd-2.35.0.ebuild | 95 ++++++++++++++++++++++
17 3 files changed, 128 insertions(+)
18
19 diff --git a/net-vpn/i2pd/Manifest b/net-vpn/i2pd/Manifest
20 index db90e6f4267..e95441059af 100644
21 --- a/net-vpn/i2pd/Manifest
22 +++ b/net-vpn/i2pd/Manifest
23 @@ -2,3 +2,4 @@ DIST i2pd-2.32.0.tar.gz 1098880 BLAKE2B 0b5db302cac78c6993fd7c25362bad512c059722
24 DIST i2pd-2.32.1.tar.gz 1099034 BLAKE2B be32443d2d686247459e74396202ff5fc595be27b7a4e207aa756f35c6b65fe05b006491bb9b8a564bc2b3c1144dae1dcba8dcfdff95cedfb032ca137f30d617 SHA512 2c492942526b5d6dd787baaf6ad31b036c593d633a36ba951c02d3289607be5e43562057622deee51db724854eef6f4bd67eaec62699b07aad47ee49fd291783
25 DIST i2pd-2.33.0.tar.gz 1101578 BLAKE2B d569a7900bda1fecc19f6ec966cd004d04599993193de9bcda89620dff9909889c14165aca457e6a5fa0539614304af11be573329b9a54596684d3232ee28833 SHA512 7a3e7a8a908be8a12b675fda4ce923cb2b0eaf3e9b12a513b9ae7b56e9ecb593eef0ea278debb4027406d50ee9a46599a6792a54ce2e2f4e2c44c1fc82479910
26 DIST i2pd-2.34.0.tar.gz 1103199 BLAKE2B 16e16a0e396b22f5de797455a97322e51bc2289e770617106d4daa9a7cd6d1d94d4d84955e182493f3c11dbacd527fbb3f127bd4e2e555a7b04f7eb697213dcb SHA512 74c8234b850159c6e680fa61b20e2c22a0f04ca8397b4aa68f92fa20520fb74a63e442ac75c2fbb17dc1e5a193011b9b38085cee08746de4496620778aa7f027
27 +DIST i2pd-2.35.0.tar.gz 1105837 BLAKE2B 4480b3b4922d2a51d158366674ad7880b7710d3c2bc45d3e403330d3a8ea04a7803a1a7826b0d60c4f9837e84c2900b9635024846d0fce7d585e30ad658fbd27 SHA512 cffc41484a63eba7c7091957cd4d8b8584bb02580d70c69132f1447018be5b3cde7893ae4a0bcb914d53e95c089d4253ece6e20442c9da7810e7800a2b99b117
28
29 diff --git a/net-vpn/i2pd/files/i2pd-2.35.0-avx-detection.patch b/net-vpn/i2pd/files/i2pd-2.35.0-avx-detection.patch
30 new file mode 100644
31 index 00000000000..6e407f1978c
32 --- /dev/null
33 +++ b/net-vpn/i2pd/files/i2pd-2.35.0-avx-detection.patch
34 @@ -0,0 +1,32 @@
35 +From ca3b8191510c1006d031d02c50edcf6b4f6a6e8f Mon Sep 17 00:00:00 2001
36 +From: R4SAS <r4sas@×××××××.org>
37 +Date: Thu, 10 Dec 2020 18:32:41 +0300
38 +Subject: [PATCH] [avx] check ig c++ target supports AVX
39 +
40 +Signed-off-by: R4SAS <r4sas@×××××××.org>
41 +---
42 + libi2pd/Crypto.cpp | 2 +-
43 + 1 file changed, 1 insertion(+), 1 deletion(-)
44 +
45 +--- a/libi2pd/Crypto.cpp
46 ++++ b/libi2pd/Crypto.cpp
47 +@@ -638,7 +638,7 @@ namespace crypto
48 + {
49 + uint64_t buf[256];
50 + uint64_t hash[12]; // 96 bytes
51 +-#if defined(__x86_64__) || defined(__i386__)
52 ++#if (defined(__x86_64__) || defined(__i386__)) && defined(__AVX__) // not all X86 targets supports AVX (like old Pentium, see #1600)
53 + if(i2p::cpu::avx)
54 + {
55 + __asm__
56 +--- a/libi2pd/Identity.cpp
57 ++++ b/libi2pd/Identity.cpp
58 +@@ -828,7 +828,7 @@ namespace data
59 + XORMetric operator^(const IdentHash& key1, const IdentHash& key2)
60 + {
61 + XORMetric m;
62 +-#if defined(__x86_64__) || defined(__i386__)
63 ++#if (defined(__x86_64__) || defined(__i386__)) && defined(__AVX__) // not all X86 targets supports AVX (like old Pentium, see #1600)
64 + if(i2p::cpu::avx)
65 + {
66 + __asm__
67
68 diff --git a/net-vpn/i2pd/i2pd-2.35.0.ebuild b/net-vpn/i2pd/i2pd-2.35.0.ebuild
69 new file mode 100644
70 index 00000000000..b33e89eb849
71 --- /dev/null
72 +++ b/net-vpn/i2pd/i2pd-2.35.0.ebuild
73 @@ -0,0 +1,95 @@
74 +# Copyright 1999-2021 Gentoo Authors
75 +# Distributed under the terms of the GNU General Public License v2
76 +
77 +EAPI=7
78 +
79 +inherit cmake toolchain-funcs systemd
80 +
81 +DESCRIPTION="A C++ daemon for accessing the I2P anonymous network"
82 +HOMEPAGE="https://github.com/PurpleI2P/i2pd"
83 +SRC_URI="https://github.com/PurpleI2P/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
84 +
85 +LICENSE="BSD"
86 +SLOT="0"
87 +KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
88 +IUSE="cpu_flags_x86_aes cpu_flags_x86_avx i2p-hardening libressl static +upnp"
89 +
90 +RDEPEND="
91 + acct-user/i2pd
92 + acct-group/i2pd
93 + !static? (
94 + dev-libs/boost:=[threads]
95 + !libressl? ( dev-libs/openssl:0=[-bindist] )
96 + libressl? ( dev-libs/libressl:0= )
97 + upnp? ( net-libs/miniupnpc:= )
98 + )"
99 +DEPEND="${RDEPEND}
100 + static? (
101 + dev-libs/boost:=[static-libs,threads]
102 + sys-libs/zlib[static-libs]
103 + !libressl? ( dev-libs/openssl:0=[static-libs] )
104 + libressl? ( dev-libs/libressl:0=[static-libs] )
105 + upnp? ( net-libs/miniupnpc:=[static-libs] )
106 + )"
107 +
108 +CMAKE_USE_DIR="${S}/build"
109 +
110 +DOCS=( README.md contrib/i2pd.conf contrib/tunnels.conf )
111 +
112 +PATCHES=(
113 + "${FILESDIR}/i2pd-2.25.0-lib-path.patch"
114 + "${FILESDIR}/i2pd-2.35.0-avx-detection.patch"
115 +)
116 +
117 +pkg_pretend() {
118 + if use i2p-hardening && ! tc-is-gcc; then
119 + die "i2p-hardening requires gcc"
120 + fi
121 +}
122 +
123 +src_configure() {
124 + mycmakeargs=(
125 + -DWITH_AESNI=$(usex cpu_flags_x86_aes ON OFF)
126 + -DWITH_HARDENING=$(usex i2p-hardening ON OFF)
127 + -DWITH_PCH=OFF
128 + -DWITH_STATIC=$(usex static ON OFF)
129 + -DWITH_UPNP=$(usex upnp ON OFF)
130 + -DWITH_LIBRARY=ON
131 + -DWITH_BINARY=ON
132 + )
133 + cmake_src_configure
134 +}
135 +
136 +src_install() {
137 + cmake_src_install
138 +
139 + # config
140 + insinto /etc/i2pd
141 + doins contrib/i2pd.conf
142 + doins contrib/tunnels.conf
143 +
144 + # working directory
145 + insinto /var/lib/i2pd
146 + doins -r contrib/certificates
147 +
148 + # add /var/lib/i2pd/certificates to CONFIG_PROTECT
149 + doenvd "${FILESDIR}/99i2pd"
150 +
151 + # openrc and systemd daemon routines
152 + newconfd "${FILESDIR}/i2pd-2.6.0-r3.confd" i2pd
153 + newinitd "${FILESDIR}/i2pd-2.6.0-r3.initd" i2pd
154 + systemd_newunit "${FILESDIR}/i2pd-2.6.0-r3.service" i2pd.service
155 +
156 + # logrotate
157 + insinto /etc/logrotate.d
158 + newins "${FILESDIR}/i2pd-2.6.0-r3.logrotate" i2pd
159 +}
160 +
161 +pkg_postinst() {
162 + if [[ -f ${EROOT}/etc/i2pd/subscriptions.txt ]]; then
163 + ewarn
164 + ewarn "Configuration of the subscriptions has been moved from"
165 + ewarn "subscriptions.txt to i2pd.conf. We recommend updating"
166 + ewarn "i2pd.conf accordingly and deleting subscriptions.txt."
167 + fi
168 +}