Gentoo Archives: gentoo-commits

From: "Efe İzbudak" <efe.izbudak@××××××××.tr>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: net-p2p/monero/files/, net-p2p/monero/
Date: Fri, 30 Sep 2022 21:27:40
Message-Id: 1664573233.3184a663a9b13d29c3e1bb71f71b0bfab7b19c71.efe.izbudak@gentoo
1 commit: 3184a663a9b13d29c3e1bb71f71b0bfab7b19c71
2 Author: Efe İzbudak <efe.izbudak <AT> metu <DOT> edu <DOT> tr>
3 AuthorDate: Fri Sep 30 21:26:49 2022 +0000
4 Commit: Efe İzbudak <efe.izbudak <AT> metu <DOT> edu <DOT> tr>
5 CommitDate: Fri Sep 30 21:27:13 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=3184a663
7
8 net-p2p/monero: add 0.18.1.2
9
10 Signed-off-by: Efe İzbudak <efe.izbudak <AT> metu.edu.tr>
11
12 net-p2p/monero/Manifest | 1 +
13 .../monero-0.18.1.2-unbundle-dependencies.patch | 102 ++++++++++++++++++
14 net-p2p/monero/monero-0.18.1.2.ebuild | 117 +++++++++++++++++++++
15 3 files changed, 220 insertions(+)
16
17 diff --git a/net-p2p/monero/Manifest b/net-p2p/monero/Manifest
18 index 0e415c491..066f2d24e 100644
19 --- a/net-p2p/monero/Manifest
20 +++ b/net-p2p/monero/Manifest
21 @@ -4,3 +4,4 @@ DIST monero-0.17.3.0.tar.gz 10659302 BLAKE2B fe73172e490f119a3d3730e3c11afd386e5
22 DIST monero-0.17.3.2.tar.gz 10685156 BLAKE2B f313ec0e5e224797448a43ad46d4e990174eec6cdceec6dc9a25d62f014a775172e103d05a33558404bd84a8443ba6ada0c27f81a3a83fe630d16cbad97602f5 SHA512 2d34e0525b2ca1d7bddb8ea51776b49fec4fb866a1c1239c347460ed3369af2f430be32da45666f16c369cebef099f285971c0e806d75d60354f195c5f93891d
23 DIST monero-0.18.1.0.tar.gz 11600139 BLAKE2B dac1182e772b4163b2cc76ec83dc2cb5e91b251dab2185d4a2df6134780f05fadba2fc603964caab973ef6bc37dce1bfcb194c92ea4f843cfb953f9a5fc24378 SHA512 761f1bae4157ea05565c7459d1cd2a9316317068e3afc18a7215e4a949dee7eb58fe023cbd04c9fec0141d1f3dc33f526b2a187934b33d7aff2b55e47fad599c
24 DIST monero-0.18.1.1.tar.gz 11609864 BLAKE2B 45591a856d251b6d11dc9eac987852fc413bea3fd035c330218cbb2226636ed4284b69e016a0e4ad71e2976fbe8bd6a4bc1d48cca05a45722add068c56ae0d9e SHA512 71c7d1940a31943b5a01236ffd7760907a3e63c50e31efa04cbd75f90d65401ed367efc1a9685a45638df7bdabd158ab61ee94398e3ca8e6c998aeb779db2066
25 +DIST monero-0.18.1.2.tar.gz 11609034 BLAKE2B 3186a1038e9dd8f204a506df28c526bf3e0e5f788ad2d6b512f02735162a479be3f46d309d4e6888f30f962d68ecaf269888c8c0b21a066cad78b3c06f8cfc83 SHA512 d112f34b2fe6720c324560dd523badb68f08d03183d4bbbe7e1aa95f641cde4a1c4fa4042f1d47f9920f799269cc9620150136ebbef6dd66fcd4df0336c0d7f3
26
27 diff --git a/net-p2p/monero/files/monero-0.18.1.2-unbundle-dependencies.patch b/net-p2p/monero/files/monero-0.18.1.2-unbundle-dependencies.patch
28 new file mode 100644
29 index 000000000..6cd7e7c3d
30 --- /dev/null
31 +++ b/net-p2p/monero/files/monero-0.18.1.2-unbundle-dependencies.patch
32 @@ -0,0 +1,102 @@
33 +--- a/CMakeLists.txt
34 ++++ b/CMakeLists.txt
35 +@@ -458,7 +458,7 @@
36 + # elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
37 + # set(BSDI TRUE)
38 +
39 +-include_directories(external/rapidjson/include external/easylogging++ src contrib/epee/include external external/supercop/include)
40 ++include_directories(external/rapidjson/include external/easylogging++ src contrib/epee/include external )
41 +
42 + if(APPLE)
43 + cmake_policy(SET CMP0042 NEW)
44 +@@ -1201,7 +1201,6 @@
45 + set(ZMQ_LIB "${ZMQ_LIB};${SODIUM_LIBRARY}")
46 + endif()
47 +
48 +-include(external/supercop/functions.cmake) # place after setting flags and before src directory inclusion
49 + add_subdirectory(contrib)
50 + add_subdirectory(src)
51 +
52 +--- a/external/CMakeLists.txt
53 ++++ b/external/CMakeLists.txt
54 +@@ -37,21 +37,7 @@
55 +
56 + find_package(Miniupnpc REQUIRED)
57 +
58 +-message(STATUS "Using in-tree miniupnpc")
59 +-set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE)
60 +-add_subdirectory(miniupnp/miniupnpc)
61 +-set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
62 +-set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON)
63 +-if(MSVC)
64 +- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267")
65 +-elseif(NOT MSVC)
66 +- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value")
67 +-endif()
68 +-if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
69 +- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE")
70 +-endif()
71 +-
72 +-set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
73 ++set(UPNP_LIBRARIES "miniupnpc" PARENT_SCOPE)
74 +
75 + find_package(Unbound)
76 +
77 +@@ -69,4 +55,3 @@
78 + add_subdirectory(db_drivers)
79 + add_subdirectory(easylogging++)
80 + add_subdirectory(qrcodegen)
81 +-add_subdirectory(randomx EXCLUDE_FROM_ALL)
82 +--- a/src/crypto/CMakeLists.txt
83 ++++ b/src/crypto/CMakeLists.txt
84 +@@ -55,6 +55,7 @@
85 + endif()
86 +
87 + include_directories(${RANDOMX_INCLUDE})
88 ++include_directories(SYSTEM /usr/include/monero)
89 +
90 + set(crypto_headers)
91 +
92 +@@ -97,6 +98,3 @@
93 + # cheat because cmake and ccache hate each other
94 + set_property(SOURCE CryptonightR_template.S PROPERTY LANGUAGE C)
95 + set_property(SOURCE CryptonightR_template.S PROPERTY XCODE_EXPLICIT_FILE_TYPE sourcecode.asm)
96 +-
97 +-# Must be done last, because it references libraries in this directory
98 +-add_subdirectory(wallet)
99 +--- a/src/crypto/wallet/crypto.h
100 ++++ b/src/crypto/wallet/crypto.h
101 +@@ -30,7 +30,6 @@
102 + #pragma once
103 +
104 + #include <cstddef>
105 +-#include "crypto/wallet/ops.h"
106 +
107 + namespace crypto {
108 + namespace wallet {
109 +--- a/src/device/CMakeLists.txt
110 ++++ b/src/device/CMakeLists.txt
111 +@@ -73,7 +73,7 @@
112 + cncrypto
113 + cryptonote_format_utils_basic
114 + ringct_basic
115 +- wallet-crypto
116 ++ monero-crypto
117 + ${OPENSSL_CRYPTO_LIBRARIES}
118 + ${Boost_SERIALIZATION_LIBRARY}
119 + PRIVATE
120 +--- a/src/p2p/net_node.inl
121 ++++ b/src/p2p/net_node.inl
122 +@@ -60,9 +60,9 @@
123 + #include "cryptonote_core/cryptonote_core.h"
124 + #include "net/parse.h"
125 +
126 +-#include <miniupnp/miniupnpc/miniupnpc.h>
127 +-#include <miniupnp/miniupnpc/upnpcommands.h>
128 +-#include <miniupnp/miniupnpc/upnperrors.h>
129 ++#include <miniupnpc/miniupnpc.h>
130 ++#include <miniupnpc/upnpcommands.h>
131 ++#include <miniupnpc/upnperrors.h>
132 +
133 + #undef MONERO_DEFAULT_LOG_CATEGORY
134 + #define MONERO_DEFAULT_LOG_CATEGORY "net.p2p"
135
136 diff --git a/net-p2p/monero/monero-0.18.1.2.ebuild b/net-p2p/monero/monero-0.18.1.2.ebuild
137 new file mode 100644
138 index 000000000..6c810793c
139 --- /dev/null
140 +++ b/net-p2p/monero/monero-0.18.1.2.ebuild
141 @@ -0,0 +1,117 @@
142 +# Copyright 1999-2021 Gentoo Authors
143 +# Distributed under the terms of the GNU General Public License v2
144 +
145 +EAPI=7
146 +
147 +inherit cmake systemd
148 +
149 +DESCRIPTION="The secure, private, untraceable cryptocurrency"
150 +HOMEPAGE="https://github.com/monero-project/monero"
151 +
152 +if [[ ${PV} == 9999 ]]; then
153 + inherit git-r3
154 + EGIT_REPO_URI="https://github.com/monero-project/monero.git"
155 + EGIT_SUBMODULES=()
156 +else
157 + SRC_URI="https://github.com/monero-project/monero/archive/v${PV}.tar.gz -> ${P}.tar.gz"
158 + KEYWORDS="~amd64 ~arm64 ~x86"
159 +fi
160 +
161 +LICENSE="BSD MIT"
162 +SLOT="0"
163 +IUSE="+daemon readline +tools +wallet-cli +wallet-rpc"
164 +REQUIRED_USE="|| ( daemon tools wallet-cli wallet-rpc )"
165 +RESTRICT="test"
166 +
167 +DEPEND="
168 + acct-group/monero
169 + acct-user/monero
170 + dev-libs/boost:=[nls]
171 + dev-libs/libsodium:=
172 + dev-libs/openssl:=
173 + dev-libs/randomx
174 + dev-libs/rapidjson
175 + dev-libs/supercop
176 + net-dns/unbound:=[threads]
177 + net-libs/czmq:=
178 + net-libs/miniupnpc
179 + readline? ( sys-libs/readline:0= )
180 +"
181 +RDEPEND="${DEPEND}"
182 +BDEPEND="virtual/pkgconfig"
183 +
184 +PATCHES=(
185 + "${FILESDIR}/${PN}-0.18.1.2-unbundle-dependencies.patch"
186 +)
187 +
188 +src_configure() {
189 + local mycmakeargs=(
190 + # TODO: Update CMake to install built libraries (help wanted)
191 + -DBUILD_SHARED_LIBS=OFF
192 + -DMANUAL_SUBMODULES=ON
193 + -DUSE_DEVICE_TREZOR=OFF
194 + )
195 +
196 + use elibc_musl && mycmakeargs+=( -DSTACK_TRACE=OFF )
197 +
198 + cmake_src_configure
199 +}
200 +
201 +src_compile() {
202 + local targets=()
203 + use daemon && targets+=(daemon)
204 + use tools && targets+=(blockchain_{ancestry,blackball,db,depth,export,import,prune,prune_known_spent_data,stats,usage})
205 + use wallet-cli && targets+=(simplewallet)
206 + use wallet-rpc && targets+=(wallet_rpc_server)
207 + cmake_build ${targets[@]}
208 +}
209 +
210 +src_install() {
211 + einstalldocs
212 +
213 + # Install all binaries.
214 + find "${BUILD_DIR}/bin/" -type f -executable -print0 |
215 + while IFS= read -r -d '' line; do
216 + dobin "$line"
217 + done
218 +
219 + if use daemon; then
220 + dodoc utils/conf/monerod.conf
221 +
222 + # data-dir
223 + keepdir /var/lib/monero
224 + fowners monero:monero /var/lib/monero
225 + fperms 0755 /var/lib/monero
226 +
227 + # log-file dir
228 + keepdir /var/log/monero
229 + fowners monero:monero /var/log/monero
230 + fperms 0755 /var/log/monero
231 +
232 + # /etc/monero/monerod.conf
233 + insinto /etc/monero
234 + doins "${FILESDIR}/monerod.conf"
235 +
236 + # OpenRC
237 + newconfd "${FILESDIR}/monerod.confd" monerod
238 + newinitd "${FILESDIR}/monerod.initd" monerod
239 +
240 + # systemd
241 + systemd_dounit "${FILESDIR}/monerod.service"
242 + fi
243 +}
244 +
245 +pkg_postinst() {
246 + if use daemon; then
247 + elog "Start the Monero P2P daemon as a system service with"
248 + elog "'rc-service monerod start'. Enable it at startup with"
249 + elog "'rc-update add monerod default'."
250 + elog
251 + elog "Run monerod status as any user to get sync status and other stats."
252 + elog
253 + elog "The Monero blockchain can take up a lot of space (80 GiB) and is stored"
254 + elog "in /var/lib/monero by default. You may want to enable pruning by adding"
255 + elog "'prune-blockchain=1' to /etc/monero/monerod.conf to prune the blockchain"
256 + elog "or move the data directory to another disk."
257 + fi
258 +}