all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#54068] [PATCH] Add xmrig and p2pool
@ 2022-02-19 23:12 Justin Veilleux
  2022-02-20 10:14 ` Maxime Devos
  2022-02-20 10:17 ` Maxime Devos
  0 siblings, 2 replies; 12+ messages in thread
From: Justin Veilleux @ 2022-02-19 23:12 UTC (permalink / raw)
  To: 54068

[-- Attachment #1: Type: text/plain, Size: 125 bytes --]

Here are two patches to add, respectively, the xmrig monero mining 
software and p2pool, a decentralized mining pool.

Cheers

[-- Attachment #2: 0002-gnu-Add-p2pool.patch --]
[-- Type: text/x-patch, Size: 2406 bytes --]

From 912cc0657b3de6eca9771f11b6bdade0fa24ddcc Mon Sep 17 00:00:00 2001
From: terramorpha <terramorpha@cock.li>
Date: Sat, 19 Feb 2022 18:07:42 -0500
Subject: [PATCH 2/2] gnu: Add p2pool.

* gnu/packages/finance.scm (p2pool): New variable.
---
 gnu/packages/finance.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index 6d4e71ee24..ae344f010c 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -82,6 +82,7 @@ (define-module (gnu packages finance)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages groff)
+  #:use-module (gnu packages gsasl)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages haskell-check)
   #:use-module (gnu packages haskell-web)
@@ -897,6 +898,41 @@ (define-public xmrig
 and RandomX benchmark.")
     (license license:gpl3)))
 
+(define-public p2pool
+  (package
+    (name "p2pool")
+    (version "1.7")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/SChernykh/p2pool")
+             (commit (string-append "v" version))
+             (recursive? #t)))
+       (sha256 (base32 "0jxl7j8x4nc65c8mdilifqy1gz1881g3qmmi48wvpciv8pbw45x2"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      ;; There are no tests.
+      #:tests? #f
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'install 'install-p2pool
+            ;; The 'install' target forgets to install the binary
+            (lambda* (#:key outputs #:allow-other-keys)
+              (use-modules (guix build utils))
+              (install-file "p2pool" (string-append (assoc-ref outputs "out") "/bin"))
+              #t)))))
+    (inputs
+     (list libuv zeromq gss))
+    (home-page "https://p2pool.io/")
+    (synopsis "Decentralized Monero mining pool")
+    (description "Monero P2Pool is a peer-to-peer Monero mining pool.  P2Pool
+combines the advantages of pool and solo mining; you still fully control your
+Monero node and what it mines, but you get frequent payouts like on a regular
+pool.")
+    (license license:gpl3)))
+
 (define-public python-trezor-agent
   ;; It is called 'libagent' in pypi; i.e. this is the library as opposed to
   ;; the toplevel app called trezor-agent.
-- 
2.34.0


[-- Attachment #3: 0001-gnu-Add-xmrig.patch --]
[-- Type: text/x-patch, Size: 2637 bytes --]

From 13e1d1b98f105b7c9d24735f7d05a6ec8b6b8e0b Mon Sep 17 00:00:00 2001
From: terramorpha <terramorpha@cock.li>
Date: Sat, 19 Feb 2022 14:34:50 -0500
Subject: [PATCH 1/2] gnu: Add xmrig.

* gnu/packages/finance.scm (xmrig): New variable.
---
 gnu/packages/finance.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index 985eaa87f7..6d4e71ee24 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -26,6 +26,7 @@
 ;;; 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)
@@ -857,6 +859,44 @@ (define-public monero-gui
 the Monero GUI client.")
     (license license:bsd-3)))
 
+(define-public xmrig
+  (package
+    (name "xmrig")
+    (version "6.16.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/xmrig/xmrig")
+         (commit (string-append "v" version))))
+       (sha256 (base32 "0mp7q14pfbdjvjai6nw6psqakr1hnzkkn4c51iw578866n2lmxw5"))))
+    (build-system cmake-build-system)
+    (inputs
+     (list
+      `(,hwloc "lib")
+      libuv
+      openssl))
+    (arguments
+     (list
+      ;; There are no tests.
+      #:tests? #f
+      #:phases
+      #~(modify-phases %standard-phases
+          (replace 'install
+            ;; There is no 'install' target, we must install xmrig manually
+            (lambda* (#:key outputs #:allow-other-keys)
+              (use-modules (guix build utils))
+              (install-file "xmrig" (string-append (assoc-ref outputs "out") "/bin"))
+              #t)))))
+    (home-page "https://xmrig.com/")
+    (synopsis "XMR miner")
+    (description
+     "XMRig is a high performance, open source, cross platform
+RandomX, KawPow, CryptoNight, AstroBWT and GhostRider unified CPU/GPU miner
+and RandomX benchmark.")
+    (license license:gpl3)))
+
 (define-public python-trezor-agent
   ;; It is called 'libagent' in pypi; i.e. this is the library as opposed to
   ;; the toplevel app called trezor-agent.
-- 
2.34.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#54068] [PATCH] Add xmrig and p2pool
  2022-02-19 23:12 [bug#54068] [PATCH] Add xmrig and p2pool Justin Veilleux
@ 2022-02-20 10:14 ` Maxime Devos
  2022-02-20 10:17 ` Maxime Devos
  1 sibling, 0 replies; 12+ messages in thread
From: Maxime Devos @ 2022-02-20 10:14 UTC (permalink / raw)
  To: Justin Veilleux, 54068

[-- Attachment #1: Type: text/plain, Size: 1713 bytes --]

Justin Veilleux schreef op za 19-02-2022 om 18:12 [-0500]:
> +      #~(modify-phases %standard-phases
> +          (replace 'install
> +            ;; There is no 'install' target, we must install xmrig
> manually
> +            (lambda* (#:key outputs #:allow-other-keys)
> +              (use-modules (guix build utils))

'use-modules' currently only behaves well on the top-level, I recommend
moving it into #:modules (see e.g. glibc).

> +              (install-file "xmrig" (string-append (assoc-ref
> outputs "out") "/bin"))

This can be simplified a little by replacing (assoc-ref outputs "out")
--> #$output.

> +              #t)))))

Phases don't have to return #t anymore, this can be removed.

> +    (home-page "https://xmrig.com/")
> +    (synopsis "XMR miner")

I think ‘Monero miner’ would be more descriptive.

> +    (description
> +     "XMRig is a high performance, open source, cross platform
> +RandomX, KawPow, CryptoNight, AstroBWT and GhostRider unified
> CPU/GPU miner
> +and RandomX benchmark.")

This notes many positive qualities of XMRig, but ignores the negative
quantities.  Perhaps you could add something about high energy
consumption?  (See recent thread ‘Excessively energy-consuming software
considered malware?’ on guix-devel (not yet on lists.gnu.org
apparently).)

(I'm assuming here the situation is the same as for Bitcoin, but
I don't actually know if this is the case.)

> +    (license license:gpl3)))

Looking at
<https://github.com/xmrig/xmrig/blob/master/src/App_win.cpp>, it
appears to be gpl3+.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#54068] [PATCH] Add xmrig and p2pool
  2022-02-19 23:12 [bug#54068] [PATCH] Add xmrig and p2pool Justin Veilleux
  2022-02-20 10:14 ` Maxime Devos
@ 2022-02-20 10:17 ` Maxime Devos
  2022-04-05 14:05   ` Ludovic Courtès
  1 sibling, 1 reply; 12+ messages in thread
From: Maxime Devos @ 2022-02-20 10:17 UTC (permalink / raw)
  To: Justin Veilleux, 54068

[-- Attachment #1: Type: text/plain, Size: 555 bytes --]

Justin Veilleux schreef op za 19-02-2022 om 18:12 [-0500]:
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri
> +        (git-reference
> +         (url "https://github.com/xmrig/xmrig")
> +         (commit (string-append "v" version))))
> +       (sha256 (base32
> "0mp7q14pfbdjvjai6nw6psqakr1hnzkkn4c51iw578866n2lmxw5"))))

I'm seeing some bundling in 'src/3rdparty'.  Also, bin/WinRing0
contains a binary.  Could things be unbundled and the binary be
removed?

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#54068] [PATCH] Add xmrig and p2pool
  2022-02-20 10:17 ` Maxime Devos
@ 2022-04-05 14:05   ` Ludovic Courtès
  2022-04-05 18:57     ` Justin Veilleux
  2022-04-06  0:51     ` [bug#54068] " Justin Veilleux
  0 siblings, 2 replies; 12+ messages in thread
From: Ludovic Courtès @ 2022-04-05 14:05 UTC (permalink / raw)
  To: Justin Veilleux; +Cc: 54068, Maxime Devos

Hi Justin,

Did you have a chance to look at Maxime’s feedback?  It would be great
if you could address it and send updated patches.

  https://issues.guix.gnu.org/54068

TIA,
Ludo’.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#54068] [PATCH] Add xmrig and p2pool
  2022-04-05 14:05   ` Ludovic Courtès
@ 2022-04-05 18:57     ` Justin Veilleux
  2022-04-06 10:29       ` Maxime Devos
  2022-04-06  0:51     ` [bug#54068] " Justin Veilleux
  1 sibling, 1 reply; 12+ messages in thread
From: Justin Veilleux @ 2022-04-05 18:57 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 54068, Maxime Devos

Hi.

Most issues Maxime raised I can solve easily. The bundling part, 
however, I am unfamiliar with.

Regarding the high consumption of energy, I think, having read thread, I 
think everyone would agree
that a warning in the description would be beneficial.

Finally, since I submitted the patch, I discovered that xmrig, in it's 
default state, will donate 1% of it's runtime to the developpers' pool. 
I don't know what is guix's policy on this matter, but I will assume we 
want it disabled.

I'm going to fix the issues raised and send an updated patch.

Cheers,
Justin.






^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#54068] [PATCH] Add xmrig and p2pool
  2022-04-05 14:05   ` Ludovic Courtès
  2022-04-05 18:57     ` Justin Veilleux
@ 2022-04-06  0:51     ` Justin Veilleux
  1 sibling, 0 replies; 12+ messages in thread
From: Justin Veilleux @ 2022-04-06  0:51 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 54068, Maxime Devos

[-- Attachment #1: Type: text/plain, Size: 129 bytes --]

This is the updated patch for xmrig, but I still have to figure out how 
to package some of p2pool's c++ dependencies.

Cheers.


[-- Attachment #2: 0001-gnu-Add-xmrig.patch --]
[-- Type: text/x-patch, Size: 3171 bytes --]

From a8003036d713228d0f24324992d296161ac3187b Mon Sep 17 00:00:00 2001
From: terramorpha <terramorpha@cock.li>
Date: Tue, 5 Apr 2022 20:46:35 -0400
Subject: [PATCH] gnu: Add xmrig.

* gnu/packages/finance.scm (xmrig): New variable.
---
 gnu/packages/finance.scm | 50 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index 9f2d055048..953e6dd075 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -26,6 +26,7 @@
 ;;; 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,51 @@ (define-public python-mt-940
 format used by SWIFT.  It returns smart Python collections for statistics
 and manipulation.")
     (license license:bsd-3)))
+
+(define-public xmrig
+  (package
+   (name "xmrig")
+    (version "6.16.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/xmrig/xmrig")
+         (commit (string-append "v" version))))
+       (sha256 (base32 "0mp7q14pfbdjvjai6nw6psqakr1hnzkkn4c51iw578866n2lmxw5"))))
+    (build-system cmake-build-system)
+    (inputs
+     (list
+      `(,hwloc "lib")
+      libuv
+      openssl))
+    (arguments
+     (list
+      ;; There are no tests.
+      #:tests? #f
+      #:modules '((guix build utils)
+                  (guix build cmake-build-system))
+      #:phases
+      #~(modify-phases
+         %standard-phases
+         (add-before 'configure 'disable-default-donation
+                     (lambda* (#:key outputs #:allow-other-keys)
+                       (substitute* "src/donate.h"
+                         (("constexpr const int kDefaultDonateLevel = 1;")
+                          "constexpr const int kDefaultDonateLevel = 0;")
+                         (("constexpr const int kMinimumDonateLevel = 1;")
+                          "constexpr const int kMinimumDonateLevel = 0;"))))
+         (replace 'install
+                  ;; There is no 'install' target, we must install xmrig manually
+                  (lambda* (#:key #:allow-other-keys)
+                    (install-file "xmrig"
+                                  (string-append #$output "/bin")))))))
+    (home-page "https://xmrig.com/")
+    (synopsis "Monero miner")
+    (description
+     "XMRig is a high performance, open source, cross platform RandomX, KawPow,
+CryptoNight, AstroBWT and GhostRider unified CPU/GPU miner and RandomX
+benchmark. Warning: This software, because of it's nature, has high energy
+consumption.")
+    (license license:gpl3+)))
-- 
2.34.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#54068] [PATCH] Add xmrig and p2pool
  2022-04-05 18:57     ` Justin Veilleux
@ 2022-04-06 10:29       ` Maxime Devos
  2022-04-06 15:33         ` Justin Veilleux
  0 siblings, 1 reply; 12+ messages in thread
From: Maxime Devos @ 2022-04-06 10:29 UTC (permalink / raw)
  To: Justin Veilleux, Ludovic Courtès; +Cc: 54068

[-- Attachment #1: Type: text/plain, Size: 1213 bytes --]

Justin Veilleux schreef op di 05-04-2022 om 14:57 [-0400]:
> Finally, since I submitted the patch, I discovered that xmrig, in it's 
> default state, will donate 1% of it's runtime to the developpers' pool. 
> I don't know what is guix's policy on this matter, but I will assume we 
> want it disabled.

IMO, involuntary donations are not donations, but theft.  Or possibly
taxes, but the xmrig developers are not a state (and if they were, you
might not even be part of that state), so not that either.

Maybe as a warning (to people that might install xmrig on non-guix
systems or without a package manager) you could add something like

  Warning: upstream always confiscates a percentage of the results. 
  This anti-functionality has been neutralised in Guix, but possibly
  not in all other distributions.

and move 'disable-default-donation' to a snippet such that
"guix build --source xmrig" returns a ‘safe’ xmrig.

and maybe

  Warning: This software, because of it's nature, has high energy
  consumption, so by using it, you accelerate global warming. 
  Additionally, the energy expenses might be more than the
  cryptocurrency gained by mining.

Greetings
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#54068] [PATCH] Add xmrig and p2pool
  2022-04-06 10:29       ` Maxime Devos
@ 2022-04-06 15:33         ` Justin Veilleux
  2022-04-06 18:24           ` Maxime Devos
  0 siblings, 1 reply; 12+ messages in thread
From: Justin Veilleux @ 2022-04-06 15:33 UTC (permalink / raw)
  To: Maxime Devos, Ludovic Courtès; +Cc: 54068

[-- Attachment #1: Type: text/plain, Size: 150 bytes --]

Hi, I moved the neutralisation of donation to the source's snippet and 
updated the description to reflect the cost of using xmrig.


Cheers, Justin.

[-- Attachment #2: 0001-gnu-Add-xmrig.patch --]
[-- Type: text/x-patch, Size: 3446 bytes --]

From 42c0c7001dcc31813ebbfe21e2afc19c99f7309b Mon Sep 17 00:00:00 2001
From: terramorpha <terramorpha@cock.li>
Date: Tue, 5 Apr 2022 20:46:35 -0400
Subject: [PATCH] gnu: Add xmrig.

* gnu/packages/finance.scm (xmrig): New variable.
---
 gnu/packages/finance.scm | 59 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

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
@@ -26,6 +26,7 @@
 ;;; 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
 and manipulation.")
     (license license:bsd-3)))
+
+(define-public xmrig
+  (package
+   (name "xmrig")
+    (version "6.16.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/xmrig/xmrig")
+         (commit (string-append "v" version))))
+       (sha256 (base32 "0mp7q14pfbdjvjai6nw6psqakr1hnzkkn4c51iw578866n2lmxw5"))
+       (snippet
+        (with-imported-modules '((guix build utils))
+          #~(begin
+              (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)
+    (inputs
+     (list
+      `(,hwloc "lib")
+      libuv
+      openssl))
+    (arguments
+     (list
+      ;; There are no tests.
+      #:tests? #f
+      #:modules '((guix build utils)
+                  (guix build cmake-build-system))
+      #:phases
+      #~(modify-phases
+         %standard-phases
+         (replace 'install
+                  ;; There is no 'install' target, we must install xmrig manually
+                  (lambda* (#:key #:allow-other-keys)
+                    (install-file "xmrig"
+                                  (string-append #$output "/bin")))))))
+    (home-page "https://xmrig.com/")
+    (synopsis "Monero miner")
+    (description
+     "XMRig is a high performance, open source, cross platform RandomX, KawPow,
+CryptoNight, AstroBWT and GhostRider unified CPU/GPU miner and RandomX
+benchmark.
+
+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
+distributions.
+
+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+)))
-- 
2.34.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#54068] [PATCH] Add xmrig and p2pool
  2022-04-06 15:33         ` Justin Veilleux
@ 2022-04-06 18:24           ` Maxime Devos
  2022-04-06 19:46             ` Justin Veilleux
  2022-04-06 19:53             ` Justin Veilleux
  0 siblings, 2 replies; 12+ messages in thread
From: Maxime Devos @ 2022-04-06 18:24 UTC (permalink / raw)
  To: Justin Veilleux, Ludovic Courtès; +Cc: 54068

[-- Attachment #1: Type: text/plain, Size: 930 bytes --]

Justin Veilleux schreef op wo 06-04-2022 om 11:33 [-0400]:
> +       (snippet
> +        (with-imported-modules '((guix build utils))
> +          #~(begin
> +              (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;")))))))

This can be done a bit simpler:

(origin [...]
  (modules '((guix build utils)))
  (snippet #~(substitute* "src/donate.h" [...])))

not 100% sure if that works ...

Greetings,
Maxime.

p.s. Do you know any other distros packaging xmrig & p2pool?  Maybe
they can be informed as well ...

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#54068] [PATCH] Add xmrig and p2pool
  2022-04-06 18:24           ` Maxime Devos
@ 2022-04-06 19:46             ` Justin Veilleux
  2022-04-06 19:53             ` Justin Veilleux
  1 sibling, 0 replies; 12+ messages in thread
From: Justin Veilleux @ 2022-04-06 19:46 UTC (permalink / raw)
  To: Maxime Devos, Ludovic Courtès; +Cc: 54068

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

You are right, this is simpler

Regarding the other distros and the automatic/minimum donation, I found 
that most major distributions*
patch out the minimum donation level(but keep the default of 1%) and few 
leave it unchanged.

*: https://repology.org/project/xmrig/versions

[-- Attachment #2: 0001-gnu-Add-xmrig.patch --]
[-- Type: text/x-patch, Size: 3342 bytes --]

From 0851821735fef3df3e1792644a8544af79a45e0f Mon Sep 17 00:00:00 2001
From: terramorpha <terramorpha@cock.li>
Date: Tue, 5 Apr 2022 20:46:35 -0400
Subject: [PATCH] gnu: Add xmrig.

* gnu/packages/finance.scm (xmrig): New variable.
---
 gnu/packages/finance.scm | 57 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index 9f2d055048..87727b987a 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -26,6 +26,7 @@
 ;;; 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,58 @@ (define-public python-mt-940
 format used by SWIFT.  It returns smart Python collections for statistics
 and manipulation.")
     (license license:bsd-3)))
+
+(define-public xmrig
+  (package
+   (name "xmrig")
+    (version "6.17.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/xmrig/xmrig")
+         (commit (string-append "v" version))))
+       (sha256 (base32 "11wh2ry3dnjynzc9a3nd8mfja7h6nxmx4fwaha82ssz5dkfqvj9b"))
+       (modules '((guix build utils)))
+       (snippet
+        #~(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)
+    (inputs
+     (list
+      `(,hwloc "lib")
+      libuv
+      openssl))
+    (arguments
+     (list
+      ;; There are no tests.
+      #:tests? #f
+      #:modules '((guix build utils)
+                  (guix build cmake-build-system))
+      #:phases
+      #~(modify-phases
+         %standard-phases
+         (replace 'install
+                  ;; There is no 'install' target, we must install xmrig manually
+                  (lambda* (#:key #:allow-other-keys)
+                    (install-file "xmrig"
+                                  (string-append #$output "/bin")))))))
+    (home-page "https://xmrig.com/")
+    (synopsis "Monero miner")
+    (description
+     "XMRig is a high performance, open source, cross platform RandomX, KawPow,
+CryptoNight, AstroBWT and GhostRider unified CPU/GPU miner and RandomX
+benchmark.
+
+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
+distributions.
+
+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+)))
-- 
2.34.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#54068] [PATCH] Add xmrig and p2pool
  2022-04-06 18:24           ` Maxime Devos
  2022-04-06 19:46             ` Justin Veilleux
@ 2022-04-06 19:53             ` Justin Veilleux
  2022-08-12 15:45               ` bug#54068: " Guillaume Le Vaillant
  1 sibling, 1 reply; 12+ messages in thread
From: Justin Veilleux @ 2022-04-06 19:53 UTC (permalink / raw)
  To: Maxime Devos, Ludovic Courtès; +Cc: 54068

Also, I forgot...

P2pool does not have this behaviour. In fact, xmrig and p2pool are only 
related insofar as one needs the former to use the latter.

I have not yet managed to extract the bundled dependencies of p2pool as 
explicit inputs. In particular, robin-hood-hashing is a c++ library 
which doesn't have a package structure and can't be `install`ed.


Cheers.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#54068: [PATCH] Add xmrig and p2pool
  2022-04-06 19:53             ` Justin Veilleux
@ 2022-08-12 15:45               ` Guillaume Le Vaillant
  0 siblings, 0 replies; 12+ messages in thread
From: Guillaume Le Vaillant @ 2022-08-12 15:45 UTC (permalink / raw)
  To: Justin Veilleux; +Cc: 54068-done

[-- Attachment #1: Type: text/plain, Size: 167 bytes --]

Hi Justin,

I rebased/modified/updated your patches, and pushed them as
ed4a3f17bf73d6a7e1d282924233498db79f7038 and
fc408acd61022d1db366bd1cec9ba1537773dfa1.
Thanks.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-08-12 15:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-19 23:12 [bug#54068] [PATCH] Add xmrig and p2pool Justin Veilleux
2022-02-20 10:14 ` Maxime Devos
2022-02-20 10:17 ` Maxime Devos
2022-04-05 14:05   ` Ludovic Courtès
2022-04-05 18:57     ` Justin Veilleux
2022-04-06 10:29       ` Maxime Devos
2022-04-06 15:33         ` Justin Veilleux
2022-04-06 18:24           ` Maxime Devos
2022-04-06 19:46             ` Justin Veilleux
2022-04-06 19:53             ` Justin Veilleux
2022-08-12 15:45               ` bug#54068: " Guillaume Le Vaillant
2022-04-06  0:51     ` [bug#54068] " Justin Veilleux

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.