diff options
author | Craig Andrews <candrews@gentoo.org> | 2021-06-08 22:05:37 -0400 |
---|---|---|
committer | Craig Andrews <candrews@gentoo.org> | 2021-06-08 22:09:56 -0400 |
commit | c3a17f8443a9a7ad097cf5942d40c7f129b4f5d7 (patch) | |
tree | 8e6c7c8ca2ab9170bf1a0135c5f4f3380777d0eb /net-misc/xmrig | |
parent | app-misc/filebus: Remove old version 0.2.0 (diff) | |
download | gentoo-c3a17f8443a9a7ad097cf5942d40c7f129b4f5d7.tar.gz gentoo-c3a17f8443a9a7ad097cf5942d40c7f129b4f5d7.tar.bz2 gentoo-c3a17f8443a9a7ad097cf5942d40c7f129b4f5d7.zip |
net-misc/xmrig: high performance, open source cryptocurrency miner
Package-Manager: Portage-3.0.19, Repoman-3.0.3
Signed-off-by: Craig Andrews <candrews@gentoo.org>
Diffstat (limited to 'net-misc/xmrig')
-rw-r--r-- | net-misc/xmrig/Manifest | 1 | ||||
-rw-r--r-- | net-misc/xmrig/files/xmrig.service | 34 | ||||
-rw-r--r-- | net-misc/xmrig/metadata.xml | 23 | ||||
-rw-r--r-- | net-misc/xmrig/xmrig-6.12.2.ebuild | 60 | ||||
-rw-r--r-- | net-misc/xmrig/xmrig-9999.ebuild | 60 |
5 files changed, 178 insertions, 0 deletions
diff --git a/net-misc/xmrig/Manifest b/net-misc/xmrig/Manifest new file mode 100644 index 000000000000..a6ee92b46d12 --- /dev/null +++ b/net-misc/xmrig/Manifest @@ -0,0 +1 @@ +DIST xmrig-6.12.2.tar.gz 1628708 BLAKE2B 4fca418c7e0d6df25c84609d657a050f7df6383d0a5ee3a4ebf87ff26805d4f445d6c184df1651813e21ac4c972e0681d37ccb45a493cb4d1e199a6ba5e707c5 SHA512 a1e8d37955177f0988b0683c9b92dc6eef4bcaea68b3c1411917929a0573119cd13107e5a68a2a7971ec45bf2554aed5fc7d82c11d49e7411e95d9b81fe1a911 diff --git a/net-misc/xmrig/files/xmrig.service b/net-misc/xmrig/files/xmrig.service new file mode 100644 index 000000000000..8b59fc0c131f --- /dev/null +++ b/net-misc/xmrig/files/xmrig.service @@ -0,0 +1,34 @@ +[Unit] +Description=XMRig Monero Miner +After=network-online.target +AssertFileNotEmpty=/etc/xmrig/config.json + +[Service] +ExecStartPre=+/usr/bin/randomx_boost.sh +ExecStartPre=+/usr/bin/enable_1gb_pages.sh +ExecStartPre=/usr/bin/xmrig --config=/etc/xmrig/config.json --dry-run +ExecStart=/usr/bin/xmrig --config=/etc/xmrig/config.json +StandardOutput=journal +StandardError=journal +DynamicUser=true +CPUSchedulingPolicy=idle +PrivateTmp=true +ProtectHome=true +ProtectSystem=strict +NoNewPrivileges=true +PrivateDevices=true +CapabilityBoundingSet= +ProtectClock=true +ProtectKernelModules=true +ProtectKernelTunables=true +ProtectKernelLogs=true +ProtectControlGroups=true +RestrictRealtime=true +RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX +RestrictNamespaces=true +PrivateUsers=true +ConfigurationDirectory=xmrig + +[Install] +WantedBy=multi-user.target + diff --git a/net-misc/xmrig/metadata.xml b/net-misc/xmrig/metadata.xml new file mode 100644 index 000000000000..8d9e1db23fcd --- /dev/null +++ b/net-misc/xmrig/metadata.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>candrews@gentoo.org</email> + <name>Craig Andrews</name> + </maintainer> + <longdescription lang="en"> + XMRig High performance, open source, cross platform RandomX, + CryptoNight, KawPow, AstroBWT, and Argon2 CPU/GPU miner. + </longdescription> + <use> + <flag name="donate"> + Set the default donation level to 1% instead of 0 + </flag> + <flag name="hwloc"> + Use <pkg>sys-apps/hwloc</pkg> for CPU affinity support + </flag> + </use> + <upstream> + <remote-id type="github">xmrig/xmrig</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-misc/xmrig/xmrig-6.12.2.ebuild b/net-misc/xmrig/xmrig-6.12.2.ebuild new file mode 100644 index 000000000000..b6e813dd772e --- /dev/null +++ b/net-misc/xmrig/xmrig-6.12.2.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake optfeature systemd + +DESCRIPTION="RandomX, CryptoNight, KawPow, AstroBWT, and Argon2 CPU/GPU miner" +HOMEPAGE="https://xmrig.com https://github.com/xmrig/xmrig" + +if [[ ${PV} == *9999 ]] ; then + EGIT_REPO_URI="https://github.com/${PN}/${PN}.git" + inherit git-r3 +else + SRC_URI="https://github.com/xmrig/xmrig/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64" +fi + +LICENSE="GPL-3+" +SLOT="0" +IUSE="cpu_flags_x86_sse4_1 donate hwloc +ssl" + +DEPEND=" + dev-libs/libuv:= + hwloc? ( sys-apps/hwloc:= ) + ssl? ( dev-libs/openssl:= ) +" +RDEPEND=" + ${DEPEND} + sys-apps/msr-tools +" + +src_prepare() { + if ! use donate ; then + sed -i 's/1;/0;/g' src/donate.h || die + fi + + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DWITH_SSE4_1=$(usex cpu_flags_x86_sse4_1) + -DWITH_HWLOC=$(usex hwloc) + -DWITH_TLS=$(usex ssl) + -DWITH_OPENCL=OFF + -DWITH_CUDA=OFF + ) + + cmake_src_configure +} + +src_install() { + default + keepdir /etc/xmrig + systemd_dounit "${FILESDIR}"/xmrig.service + dobin "${BUILD_DIR}/xmrig" + dobin "${S}/scripts/enable_1gb_pages.sh" + dobin "${S}/scripts/randomx_boost.sh" +} diff --git a/net-misc/xmrig/xmrig-9999.ebuild b/net-misc/xmrig/xmrig-9999.ebuild new file mode 100644 index 000000000000..b6e813dd772e --- /dev/null +++ b/net-misc/xmrig/xmrig-9999.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake optfeature systemd + +DESCRIPTION="RandomX, CryptoNight, KawPow, AstroBWT, and Argon2 CPU/GPU miner" +HOMEPAGE="https://xmrig.com https://github.com/xmrig/xmrig" + +if [[ ${PV} == *9999 ]] ; then + EGIT_REPO_URI="https://github.com/${PN}/${PN}.git" + inherit git-r3 +else + SRC_URI="https://github.com/xmrig/xmrig/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64" +fi + +LICENSE="GPL-3+" +SLOT="0" +IUSE="cpu_flags_x86_sse4_1 donate hwloc +ssl" + +DEPEND=" + dev-libs/libuv:= + hwloc? ( sys-apps/hwloc:= ) + ssl? ( dev-libs/openssl:= ) +" +RDEPEND=" + ${DEPEND} + sys-apps/msr-tools +" + +src_prepare() { + if ! use donate ; then + sed -i 's/1;/0;/g' src/donate.h || die + fi + + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DWITH_SSE4_1=$(usex cpu_flags_x86_sse4_1) + -DWITH_HWLOC=$(usex hwloc) + -DWITH_TLS=$(usex ssl) + -DWITH_OPENCL=OFF + -DWITH_CUDA=OFF + ) + + cmake_src_configure +} + +src_install() { + default + keepdir /etc/xmrig + systemd_dounit "${FILESDIR}"/xmrig.service + dobin "${BUILD_DIR}/xmrig" + dobin "${S}/scripts/enable_1gb_pages.sh" + dobin "${S}/scripts/randomx_boost.sh" +} |