From 42c0c7001dcc31813ebbfe21e2afc19c99f7309b Mon Sep 17 00:00:00 2001
* gnu/packages/finance.scm (xmrig): New variable.
gnu/packages/finance.scm | 59 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
Toggle diff (83 lines)
diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index 9f2d055048..4cb3075c6f 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
;;; Copyright © 2021 François J <francois-oss@avalenn.eu>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
;;; Copyright © 2021 John Kehayias <john.kehayias@protonmail.com>
+;;; Copyright © 2022 Justin Veilleux <terramorpha@cock.li>
;;; This file is part of GNU Guix.
@@ -93,6 +94,7 @@ (define-module (gnu packages finance)
#:use-module (gnu packages linux)
#:use-module (gnu packages man)
#:use-module (gnu packages maths)
+ #:use-module (gnu packages mpi)
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages networking)
@@ -1978,3 +1980,60 @@ (define-public python-mt-940
format used by SWIFT. It returns smart Python collections for statistics
(license license:bsd-3)))
+ (url "https://github.com/xmrig/xmrig")
+ (commit (string-append "v" version))))
+ (sha256 (base32 "0mp7q14pfbdjvjai6nw6psqakr1hnzkkn4c51iw578866n2lmxw5"))
+ (with-imported-modules '((guix build utils))
+ (use-modules (guix build utils))
+ (substitute* "src/donate.h"
+ (("constexpr const int kDefaultDonateLevel = 1;")
+ "constexpr const int kDefaultDonateLevel = 0;")
+ (("constexpr const int kMinimumDonateLevel = 1;")
+ "constexpr const int kMinimumDonateLevel = 0;")))))))
+ (build-system cmake-build-system)
+ #:modules '((guix build utils)
+ (guix build cmake-build-system))
+ ;; There is no 'install' target, we must install xmrig manually
+ (lambda* (#:key #:allow-other-keys)
+ (string-append #$output "/bin")))))))
+ (home-page "https://xmrig.com/")
+ (synopsis "Monero miner")
+ "XMRig is a high performance, open source, cross platform RandomX, KawPow,
+CryptoNight, AstroBWT and GhostRider unified CPU/GPU miner and RandomX
+Warning: upstream, by default, receives a percentage of the mining time. This
+anti-functionality has been neutralised in Guix, but possibly not in all other
+Warning: This software, because of it's nature, has high energy consumption
+and will increase your carbon footprint. Also, the energy expenses might be
+higher that the cryptocurrency gained by mining.")
+ (license license:gpl3+)))