parlay

yet another gentoo overlay
git clone https://git.parazyd.org/parlay
Log | Files | Refs | README

monero-0.17.1.9.ebuild (2888B)


      1 # Copyright 1999-2021 Gentoo Authors
      2 # Distributed under the terms of the GNU General Public License v2
      3 
      4 EAPI=7
      5 
      6 inherit cmake git-r3 systemd
      7 
      8 DESCRIPTION="The secure, private, untraceable cryptocurrency"
      9 HOMEPAGE="https://www.getmonero.org https://github.com/monero-project/monero"
     10 SRC_URI=""
     11 EGIT_REPO_URI="https://github.com/monero-project/monero.git"
     12 EGIT_COMMIT="v${PV}"
     13 
     14 LICENSE="BSD MIT"
     15 SLOT="0"
     16 KEYWORDS="~amd64"
     17 IUSE="+daemon hw-wallet libressl readline tools +wallet-cli +wallet-rpc"
     18 REQUIRED_USE="|| ( daemon tools wallet-cli wallet-rpc )"
     19 
     20 DEPEND="
     21 	acct-group/monero
     22 	acct-user/monero
     23 	dev-libs/boost:=[nls,threads]
     24 	dev-libs/libsodium:=
     25 	net-dns/unbound:=[threads]
     26 	net-libs/czmq:=
     27 	hw-wallet? (
     28 		dev-libs/hidapi
     29 		dev-libs/protobuf:=
     30 		virtual/libusb:1
     31 	)
     32 	!libressl? ( dev-libs/openssl:= )
     33 	libressl? ( dev-libs/libressl:= )
     34 	readline? ( sys-libs/readline:0= )"
     35 RDEPEND="${DEPEND}"
     36 BDEPEND="virtual/pkgconfig"
     37 
     38 PATCHES=("${FILESDIR}/${PN}-0.17.1.3-linkjobs.patch")
     39 
     40 src_configure() {
     41 	local mycmakeargs=(
     42 		# Monero's liblmdb conflicts with the system liblmdb :(
     43 		-DBUILD_SHARED_LIBS=OFF
     44 		-DMANUAL_SUBMODULES=ON
     45 		-DMONERO_PARALLEL_LINK_JOBS=1
     46 	)
     47 
     48 	cmake_src_configure
     49 }
     50 
     51 src_compile() {
     52 	local targets=()
     53 	use daemon && targets+=(daemon)
     54 	use tools && targets+=(blockchain_{ancestry,blackball,db,depth,export,import,prune,prune_known_spent_data,stats,usage})
     55 	use wallet-cli && targets+=(simplewallet)
     56 	use wallet-rpc && targets+=(wallet_rpc_server)
     57 	cmake_build ${targets[@]}
     58 }
     59 
     60 src_install() {
     61 	# Install all binaries.
     62 	find "${BUILD_DIR}/bin/" -type f -executable -print0 |
     63 		while IFS= read -r -d '' line; do
     64 			dobin "$line"
     65 		done
     66 
     67 	if use daemon; then
     68 		dodoc utils/conf/monerod.conf
     69 
     70 		# data-dir
     71 		keepdir /var/lib/monero
     72 		fowners monero:monero /var/lib/monero
     73 		fperms 0755 /var/lib/monero
     74 
     75 		# log-file dir
     76 		keepdir /var/log/monero
     77 		fowners monero:monero /var/log/monero
     78 		fperms 0755 /var/log/monero
     79 
     80 		# /etc/monero/monerod.conf
     81 		insinto /etc/monero
     82 		newins "${FILESDIR}/monerod-0.16.0.3-r1.monerod.conf" monerod.conf
     83 
     84 		# OpenRC
     85 		newconfd "${FILESDIR}/monerod-0.16.0.3-r1.confd" monerod
     86 		newinitd "${FILESDIR}/monerod-0.16.0.3-r1.initd" monerod
     87 
     88 		# systemd
     89 		systemd_newunit "${FILESDIR}/monerod-0.17.1.5.service" monerod.service
     90 	fi
     91 }
     92 
     93 pkg_postinst() {
     94 	if use daemon; then
     95 		einfo "Start the Monero P2P daemon as a system service with"
     96 		einfo "'rc-service monerod start'. Enable it at startup with"
     97 		einfo "'rc-update add monerod default'."
     98 		einfo
     99 		einfo "Run monerod status as any user to get sync status and other stats."
    100 		einfo
    101 		einfo "The Monero blockchain can take up a lot of space (80 GiB) and is stored"
    102 		einfo "in /var/lib/monero by default. You may want to enable pruning by adding"
    103 		einfo "'prune-blockchain=1' to /etc/monero/monerod.conf to prune the blockchain"
    104 		einfo "or move the data directory to another disk."
    105 	fi
    106 }