From 943568aaa73bd93ac6b5011e436aab87f8ad3733 Mon Sep 17 00:00:00 2001 From: Bloyburt Date: Sat, 22 Jul 2023 10:33:03 +0900 Subject: network/xmrig: Added (cryptominer). Signed-off-by: Andrew Clemons Signed-off-by: Willy Sudiarto Raharjo --- network/xmrig/README | 100 ++++++++++++++++++++++++++ network/xmrig/donate.patch | 13 ++++ network/xmrig/slack-desc | 19 +++++ network/xmrig/xmrig.SlackBuild | 159 +++++++++++++++++++++++++++++++++++++++++ network/xmrig/xmrig.info | 10 +++ 5 files changed, 301 insertions(+) create mode 100644 network/xmrig/README create mode 100644 network/xmrig/donate.patch create mode 100644 network/xmrig/slack-desc create mode 100644 network/xmrig/xmrig.SlackBuild create mode 100644 network/xmrig/xmrig.info diff --git a/network/xmrig/README b/network/xmrig/README new file mode 100644 index 0000000000..25ffe1318c --- /dev/null +++ b/network/xmrig/README @@ -0,0 +1,100 @@ +XMRig is a high performance, open source, cross platform RandomX, +KawPow, CryptoNight and GhostRider unified CPU/GPU miner and +RandomX benchmark. Official binaries are available for Windows, +Linux, macOS and FreeBSD. + +Mining Backends: +* CPU (x64/ARMv7/ARMv8) +* OpenCL for AMD GPUs +(CUDA for NVIDIA GPUs requires an external CUDA plugin "xmrig-cuda" +as a dependency; for the time being, you will have to compile this +yourself) + +Usage: +The preferred way to configure the miner is the JSON config file, +as it is more flexible and human friendly. The command line interface +does not cover all features, such as mining profiles for different +algorithms. Important options can be changed during runtime without +miner restart by editing the config file or executing API calls. + +Config File: +An online wizard (located at https://xmrig.com/wizard) can be used +to help create an initial configuration for the miner. The resulting +config file must be placed as either .xmrig.json or .config/xmrig.json +in your user home directory. + +Donations: +Donations are the percentage of your hashing power that you want to +donate to the developer, and are used to support XMRig Development. +Default donation 1% (1 minute in 100 minutes) can be increased via +command line option --donate-level or disabled in the source code. +Alternatively, pass the option "DONATE=no" to the script to disable +donations altogether (although a one-time donation to the developers +is recommended if you choose to do this). + +Algorithms: +Various algorithms can be enabled/disabled by passing variables to the +script (VAR=yes/no ./xmrig.SlackBuild) These algorithms include: +WITH_CN_LITE=yes|no (default: yes) + (disable all CryptoNight-Lite algorithms (cn-lite/*)) +WITH_CN_HEAVY=yes|no (default: yes) + (disable all CryptoNight-Heavy algorithms (cn-heavy/*)) +WITH_CN_PICO=yes|no (default: yes) + (disable CryptoNight-Pico algorithms (cn-pico and cn-pico/tlo)) +WITH_CN_FEMTO=yes|no (default: yes) + (disable CryptoNight-UPX2 algorithm) +WITH_RANDOMX=yes|no (default: yes) + (disable RandomX algorithms (rx/*)) +WITH_ARGON2=yes|no (default: yes) + (disable Argon2 algorithms (argon2/*) +WITH_KAWPOW=yes|no (default: yes) + (disable KawPow algorithm (kawpow) +WITH_GHOSTRIDER=yes|no (default: yes) + (disable GhostRider algorithm (gr) + +Features: +Various features can be enabled/disabled by passing variables to the +script (VAR=yes/no ./xmrig.SlackBuild) These features include: +WITH_HWLOC=yes|no (default: yes) + (disable hwloc support. Disabling this feature is not recommended + in most cases. This feature adds an external dependency to + libhwloc (1.10.0+)) +WITH_LIBCPUID=yes|no (default: yes) + (disable built-in libcpuid support. This feature is always disabled + if hwloc is enabled. If both hwloc and libcpuid are disabled, auto + configuration for CPU will be very limited.) +WITH_HTTP=yes|no (default: yes) + (disable built-in HTTP support. This feature is used for HTTP API + and daemon (solo mining) support) +WITH_TLS=yes|no (default: yes) + (disable SSL/TLS support (secure connections to pool). This feature + adds an external dependency to OpenSSL (included in Slackware by + default)) +WITH_ASM=yes|no (default: yes) + (disable assembly optimisations for modern CryptoNight algorithms) +WITH_EMBEDDED_CONFIG=yes|no (default: no) + (enable embedded config support) +WITH_OPENCL=yes|no (default: yes) + (disable OpenCL backend) +WITH_CUDA=yes|no (default: no) + (enable NVIDIA CUDA backend; requires xmrig-cuda dependency) +WITH_NVML=yes|no (default: no) + (disable NVML (NVIDIA Management Library) support. This feature is + only available if CUDA is enabled) +WITH_MSR=yes|no (default: yes) + (disable MSR mod & 1st-gen Ryzen fix) +WITH_ADL=yes|no (default: yes) + (disable ADL (AMD Display Library) or sysfs support. Tihs feature + is only available if OpenCL is enabled) +WITH_PROFILING=yes|no (default: no) + (enable profiling for developers) +WITH_SSE4_1=yes|no (default: yes) + (disable SSE 4.1 for Blake2) +WITH_BENCHMARK=yes|no (default: yes) + (disable builtin RandomX benchmark and stress test) +WITH_SECURE_JIT=yes|no (default: no) + (enable secure access to JIT memory. Off by default on all OS, + except for macOS with ARM CPU) +WITH_DMI=yes|no (default: yes) + (disable DMI/SMBIOS reader) + diff --git a/network/xmrig/donate.patch b/network/xmrig/donate.patch new file mode 100644 index 0000000000..e2ca7ef48e --- /dev/null +++ b/network/xmrig/donate.patch @@ -0,0 +1,13 @@ +--- donate.h 2023-07-03 06:42:00.000000000 +0100 ++++ donate0.h 2023-07-19 13:30:36.907129259 +0100 +@@ -37,8 +37,8 @@ + * If you plan on changing donations to 0%, please consider making a one-off donation to my wallet: + * XMR: 48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD + */ +-constexpr const int kDefaultDonateLevel = 1; +-constexpr const int kMinimumDonateLevel = 1; ++constexpr const int kDefaultDonateLevel = 0; ++constexpr const int kMinimumDonateLevel = 0; + + + #endif // XMRIG_DONATE_H diff --git a/network/xmrig/slack-desc b/network/xmrig/slack-desc new file mode 100644 index 0000000000..3bd5fc5aa6 --- /dev/null +++ b/network/xmrig/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +xmrig: xmrig (unified CPU/GPU cryptocurrency miner) +xmrig: +xmrig: XMRig is a high performance, open source, cross platform RandomX, +xmrig: KawPow, CryptoNight and GhostRider unified CPU/GPU miner and RandomX +xmrig: benchmark. Official binaries are available for Windows, Linux, macOS +xmrig: and FreeBSD. +xmrig: +xmrig: Homepage: https://xmrig.com/ +xmrig: +xmrig: +xmrig: diff --git a/network/xmrig/xmrig.SlackBuild b/network/xmrig/xmrig.SlackBuild new file mode 100644 index 0000000000..dadfa360a3 --- /dev/null +++ b/network/xmrig/xmrig.SlackBuild @@ -0,0 +1,159 @@ +#!/bin/bash + +# Slackware build script for xmrig + +# Copyright 2023 Bloyburt +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=xmrig +VERSION=${VERSION:-6.20.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# Donations can be enabled/disabled here +[ "${DONATE:-yes}" = no ] && patch src/donate.h < $CWD/donate.patch + +# Algorithms can be enabled/disabled here +[ "${WITH_CN_LITE:-yes}" = no ] && WITH_CN_LITE='-DWITH_CN_LITE=OFF' +[ "${WITH_CN_HEAVY:-yes}" = no ] && WITH_CN_HEAVY='-DWITH_CN_HEAVY=OFF' +[ "${WITH_CN_PICO:-yes}" = no ] && WITH_CN_PICO='-DWITH_CN_PICO=OFF' +[ "${WITH_CN_FEMTO:-yes}" = no ] && WITH_CN_FEMTO='-DWITH_CN_FEMTO=OFF' +[ "${WITH_RANDOMX:-yes}" = no ] && WITH_RANDOMX='-DWITH_RANDOMX=OFF' +[ "${WITH_ARGON2:-yes}" = no ] && WITH_ARGON2='-DWITH_ARGON2=OFF' +[ "${WITH_KAPOW:-yes}" = no ] && WITH_KAPOW='-DWITH_KAPOW=OFF' +[ "${WITH_GHOSTRIDER:-yes}" = no ] && WITH_GHOSTRIDER='-DWITH_GHOSTRIDER=OFF' + +# Features can be enabled/disabled here +[ "${WITH_HWLOC:-yes}" = no ] && WITH_HWLOC='-DWITH_HWLOC=OFF' +[ "${WITH_LIBCPUID:-yes}" = no ] && WITH_LIBCPUID='-DWITH_LIBCPUID=OFF' +[ "${WITH_HTTP:-yes}" = no ] && WITH_HTTP='-DWITH_HTTP=OFF' +[ "${WITH_TLS:-yes}" = no ] && WITH_TLS='-DWITH_TLS=OFF' +[ "${WITH_ASM:-yes}" = no ] && WITH_ASM='-DWITH_ASM=OFF' +[ "${WITH_EMBEDDED_CONFIG:-no}" = yes ] && WITH_EMBEDDED_CONFIG='-DWITH_EMBEDDED_CONFIG=ON' +[ "${WITH_OPENCL:-yes}" = no ] && WITH_OPENCL='-DWITH_OPENCL=OFF' +[ "${WITH_CUDA:-no}" = yes ] && WITH_CUDA='-DWITH_CUDA=ON' +[ "${WITH_NVML:-no}" = yes ] && WITH_NVML='-DWITH_NVML=ON' +[ "${WITH_MSR:-yes}" = no ] && WITH_MSR='-DWITH_MSR=OFF' +[ "${WITH_ADL:-yes}" = no ] && WITH_ADL='-DWITH_ADL=OFF' +[ "${WITH_PROFILING:-no}" = yes ] && WITH_PROFILING='-DWITH_PROFILING=ON' +[ "${WITH_SSE4_1:-yes}" = no ] && WITH_SSE4_1='-DWITH_SSE4_1=OFF' +[ "${WITH_BENCHMARK:-yes}" = no ] && WITH_BENCHMARK='-DWITH_BENCHMARK=OFF' +[ "${WITH_SECURE_JIT:-no}" = yes ] && WITH_SECURE_JIT='-DWITH_SECURE_JIT=ON' +[ "${WITH_DMI:-yes}" = no ] && WITH_DMI='-DWITH_DMI=OFF' + +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + $WITH_CN_LITE \ + $WITH_CN_HEAVY \ + $WITH_CN_PICO \ + $WITH_CN_FEMTO \ + $WITH_RANDOMX \ + $WITH_ARGON2 \ + $WITH_KAPOW \ + $WITH_GHOSTRIDER \ + $WITH_HWLOC \ + $WITH_LIBCPUID \ + $WITH_HTTP \ + $WITH_TLS \ + $WITH_ASM \ + $WITH_EMBEDDED_CONFIG \ + $WITH_OPENCL \ + $WITH_CUDA \ + $WITH_NVML \ + $WITH_MSR \ + $WITH_ADL \ + $WITH_PROFILING \ + $WITH_SSE4_1 \ + $WITH_BENCHMARK \ + $WITH_SECURE_JIT \ + $WITH_DMI \ + -DCMAKE_BUILD_TYPE=Release .. + make +cd .. + +mkdir -p $PKG/usr/bin +cp -a build/$PRGNAM $PKG/usr/bin/$PRGNAM + +rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a doc *.md LICENSE $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/network/xmrig/xmrig.info b/network/xmrig/xmrig.info new file mode 100644 index 0000000000..4cf9b14494 --- /dev/null +++ b/network/xmrig/xmrig.info @@ -0,0 +1,10 @@ +PRGNAM="xmrig" +VERSION="6.20.0" +HOMEPAGE="https://xmrig.com/" +DOWNLOAD="https://github.com/xmrig/xmrig/archive/v6.20.0/xmrig-6.20.0.tar.gz" +MD5SUM="8f8fde7ac5f1a470f90c1612378118e1" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="%README% hwloc" +MAINTAINER="Bloyburt" +EMAIL="alexpen@startmail.com" -- cgit v1.2.3-65-gdbad