All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH/next 1/1] package/xmrig: new package
@ 2021-05-23 10:30 Bernd Kuhls
  2021-05-24 12:00 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Kuhls @ 2021-05-23 10:30 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 DEVELOPERS               |  1 +
 package/Config.in        |  1 +
 package/xmrig/Config.in  | 22 ++++++++++++++++++++++
 package/xmrig/xmrig.hash |  3 +++
 package/xmrig/xmrig.mk   | 40 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 67 insertions(+)
 create mode 100644 package/xmrig/Config.in
 create mode 100644 package/xmrig/xmrig.hash
 create mode 100644 package/xmrig/xmrig.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index a90ad1c354..ffe99a219d 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -456,6 +456,7 @@ F:	package/waylandpp/
 F:	package/x11r7/
 F:	package/x264/
 F:	package/x265/
+F:	package/xmrig/
 F:	package/ytree/
 F:	package/znc/
 F:	support/testing/tests/package/test_perl_html_parser.py
diff --git a/package/Config.in b/package/Config.in
index 4af6057c4d..828c013fe7 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2059,6 +2059,7 @@ menu "Miscellaneous"
 	source "package/sunwait/Config.in"
 	source "package/taskd/Config.in"
 	source "package/wine/Config.in"
+	source "package/xmrig/Config.in"
 	source "package/xutil_util-macros/Config.in"
 endmenu
 
diff --git a/package/xmrig/Config.in b/package/xmrig/Config.in
new file mode 100644
index 0000000000..3007201610
--- /dev/null
+++ b/package/xmrig/Config.in
@@ -0,0 +1,22 @@
+config BR2_PACKAGE_XMRIG
+	bool "xmrig"
+	# archs officially supported by upstream
+	depends on BR2_aarch64 || BR2_x86_64 || BR2_i386
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # libuv
+	depends on BR2_USE_MMU # libuv
+	depends on !BR2_STATIC_LIBS # libuv
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # libuv
+	# xmrig needs fenv.h which is not provided by uclibc
+	depends on !BR2_TOOLCHAIN_USES_UCLIBC
+	select BR2_PACKAGE_LIBUV
+	help
+	  RandomX, CryptoNight, AstroBWT and Argon2 CPU/GPU miner.
+
+	  https://xmrig.com
+
+comment "xmrig needs a glibc or musl toolchain w/ NPTL, dynamic library"
+	depends on BR2_TOOLCHAIN_USES_UCLIBC || \
+		!BR2_TOOLCHAIN_HAS_THREADS_NPTL || BR2_STATIC_LIBS
+	depends on BR2_aarch64 || BR2_x86_64 || BR2_i386
+	depends on BR2_USE_MMU
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4
diff --git a/package/xmrig/xmrig.hash b/package/xmrig/xmrig.hash
new file mode 100644
index 0000000000..c80bdd6621
--- /dev/null
+++ b/package/xmrig/xmrig.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  7570030c4b3e257bda190a100dc59f78b74c823af7561222a99b296f5e7b1ac2  xmrig-6.12.1.tar.gz
+sha256  589ed823e9a84c56feb95ac58e7cf384626b9cbf4fda2a907bc36e103de1bad2  LICENSE
diff --git a/package/xmrig/xmrig.mk b/package/xmrig/xmrig.mk
new file mode 100644
index 0000000000..aa36fcdf57
--- /dev/null
+++ b/package/xmrig/xmrig.mk
@@ -0,0 +1,40 @@
+################################################################################
+#
+# xmrig
+#
+################################################################################
+
+XMRIG_VERSION = 6.12.1
+XMRIG_SITE = $(call github,xmrig,xmrig,v$(XMRIG_VERSION))
+XMRIG_LICENSE = GPL-3.0+
+XMRIG_LICENSE_FILES = LICENSE
+XMRIG_DEPENDENCIES = libuv
+XMRIG_CONF_OPTS = -DWITH_CUDA=OFF
+
+ifeq ($(BR2_PACKAGE_HAS_LIBOPENCL),y)
+XMRIG_CONF_OPTS += -DWITH_OPENCL=ON
+XMRIG_DEPENDENCIES += libopencl
+else
+XMRIG_CONF_OPTS += -DWITH_OPENCL=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_HWLOC),y)
+XMRIG_CONF_OPTS += -DWITH_HWLOC=ON
+XMRIG_DEPENDENCIES += hwloc
+else
+XMRIG_CONF_OPTS += -DWITH_HWLOC=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
+XMRIG_CONF_OPTS += -DWITH_TLS=ON
+XMRIG_DEPENDENCIES += openssl
+else
+XMRIG_CONF_OPTS += -DWITH_TLS=OFF
+endif
+
+define XMRIG_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -D $(@D)/xmrig$(if $(BR2_PACKAGE_OPENSSL),,-notls) \
+		$(TARGET_DIR)/usr/bin/xmrig$(if $(BR2_PACKAGE_OPENSSL),,-notls)
+endef
+
+$(eval $(cmake-package))
-- 
2.29.2

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

* [Buildroot] [PATCH/next 1/1] package/xmrig: new package
  2021-05-23 10:30 [Buildroot] [PATCH/next 1/1] package/xmrig: new package Bernd Kuhls
@ 2021-05-24 12:00 ` Yann E. MORIN
  0 siblings, 0 replies; 2+ messages in thread
From: Yann E. MORIN @ 2021-05-24 12:00 UTC (permalink / raw)
  To: buildroot

Bernd, All,

On 2021-05-23 12:30 +0200, Bernd Kuhls spake thusly:
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> ---
[--SNIP--]
> diff --git a/package/xmrig/Config.in b/package/xmrig/Config.in
> new file mode 100644
> index 0000000000..3007201610
> --- /dev/null
> +++ b/package/xmrig/Config.in
> @@ -0,0 +1,22 @@
> +config BR2_PACKAGE_XMRIG
> +	bool "xmrig"
> +	# archs officially supported by upstream
> +	depends on BR2_aarch64 || BR2_x86_64 || BR2_i386
> +	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # libuv
> +	depends on BR2_USE_MMU # libuv

MMU is an architecture dependency, it moust come before toolchain
dependencies.

> +	depends on !BR2_STATIC_LIBS # libuv
> +	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # libuv
> +	# xmrig needs fenv.h which is not provided by uclibc
> +	depends on !BR2_TOOLCHAIN_USES_UCLIBC
> +	select BR2_PACKAGE_LIBUV
> +	help
> +	  RandomX, CryptoNight, AstroBWT and Argon2 CPU/GPU miner.
> +
> +	  https://xmrig.com
> +
> +comment "xmrig needs a glibc or musl toolchain w/ NPTL, dynamic library"
> +	depends on BR2_TOOLCHAIN_USES_UCLIBC || \
> +		!BR2_TOOLCHAIN_HAS_THREADS_NPTL || BR2_STATIC_LIBS
> +	depends on BR2_aarch64 || BR2_x86_64 || BR2_i386
> +	depends on BR2_USE_MMU
> +	depends on BR2_TOOLCHAIN_HAS_SYNC_4

Keep the same ordering in the comment depndencies as in the main option
dependencies.

[--SNIP--]
> diff --git a/package/xmrig/xmrig.mk b/package/xmrig/xmrig.mk
> new file mode 100644
> index 0000000000..aa36fcdf57
> --- /dev/null
> +++ b/package/xmrig/xmrig.mk
> @@ -0,0 +1,40 @@
[--SNIP--]
> +define XMRIG_INSTALL_TARGET_CMDS
> +	$(INSTALL) -m 0755 -D $(@D)/xmrig$(if $(BR2_PACKAGE_OPENSSL),,-notls) \
> +		$(TARGET_DIR)/usr/bin/xmrig$(if $(BR2_PACKAGE_OPENSSL),,-notls)
> +endef

Why can't we use the default install commands?

Regards,
Yann E. MORIN.

> +
> +$(eval $(cmake-package))
> -- 
> 2.29.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

end of thread, other threads:[~2021-05-24 12:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-23 10:30 [Buildroot] [PATCH/next 1/1] package/xmrig: new package Bernd Kuhls
2021-05-24 12:00 ` Yann E. MORIN

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.