summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Andrews <candrews@gentoo.org>2018-04-06 15:21:32 -0400
committerCraig Andrews <candrews@gentoo.org>2018-04-06 15:21:53 -0400
commite9c1423bb64f362ff30e6c074bf27aff47829dd9 (patch)
tree62eb33271a66471ffa2bec63a6ffe25c7f7aaed6 /net-p2p
parentsys-libs/glibc: tweak riscv preconfigure mangling (diff)
downloadgentoo-e9c1423bb64f362ff30e6c074bf27aff47829dd9.tar.gz
gentoo-e9c1423bb64f362ff30e6c074bf27aff47829dd9.tar.bz2
gentoo-e9c1423bb64f362ff30e6c074bf27aff47829dd9.zip
net-p2p/xmr-stak: Set the library path to get_libdir
Closes: https://bugs.gentoo.org/652602 See: https://github.com/fireice-uk/xmr-stak/pull/1339 Package-Manager: Portage-2.3.28, Repoman-2.3.9
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/xmr-stak/files/xmr-stak-2.4.2-fix-paths.patch68
-rw-r--r--net-p2p/xmr-stak/xmr-stak-2.4.2-r1.ebuild69
2 files changed, 137 insertions, 0 deletions
diff --git a/net-p2p/xmr-stak/files/xmr-stak-2.4.2-fix-paths.patch b/net-p2p/xmr-stak/files/xmr-stak-2.4.2-fix-paths.patch
new file mode 100644
index 000000000000..cd71554b3770
--- /dev/null
+++ b/net-p2p/xmr-stak/files/xmr-stak-2.4.2-fix-paths.patch
@@ -0,0 +1,68 @@
+From 3bbf91be9f510ef999c62ae2d42a094d271299b7 Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Fri, 6 Apr 2018 14:56:44 -0400
+Subject: [PATCH 1/2] Use EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH
+
+Use EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH to control the path to which the executable and libraries are installed.
+---
+ CMakeLists.txt | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 15a2684c..66c2f6f8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -535,23 +535,23 @@ target_link_libraries(xmr-stak ${LIBS} xmr-stak-c xmr-stak-backend)
+ # do not install the binary if the project and install are equal
+ if( NOT CMAKE_INSTALL_PREFIX STREQUAL PROJECT_BINARY_DIR )
+ install(TARGETS xmr-stak
+- RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
++ RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/${EXECUTABLE_OUTPUT_PATH}")
+ if(CUDA_FOUND)
+ if(WIN32)
+ install(TARGETS xmrstak_cuda_backend
+- RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
++ RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/${LIBRARY_OUTPUT_PATH}")
+ else()
+ install(TARGETS xmrstak_cuda_backend
+- LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
++ LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/${LIBRARY_OUTPUT_PATH}")
+ endif()
+ endif()
+ if(OpenCL_FOUND)
+ if(WIN32)
+ install(TARGETS xmrstak_opencl_backend
+- RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
++ RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/${LIBRARY_OUTPUT_PATH}")
+ else()
+ install(TARGETS xmrstak_opencl_backend
+- LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
++ LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/${LIBRARY_OUTPUT_PATH}")
+ endif()
+ endif()
+ else()
+
+From c1d907ee03795fdce80daba6395e2a7eb1333930 Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Fri, 6 Apr 2018 15:11:07 -0400
+Subject: [PATCH 2/2] Allow EXECUTABLE and LIBRARY paths to be set
+
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 66c2f6f8..1ff7fbb4 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -522,8 +522,8 @@ else()
+ add_executable(xmr-stak ${SRCFILES_CPP})
+ endif()
+
+-set(EXECUTABLE_OUTPUT_PATH "bin")
+-set(LIBRARY_OUTPUT_PATH "bin")
++set(EXECUTABLE_OUTPUT_PATH "bin" CACHE STRING "Path to place executables")
++set(LIBRARY_OUTPUT_PATH "bin" CACHE STRING "Path to place libraries")
+
+ target_link_libraries(xmr-stak ${LIBS} xmr-stak-c xmr-stak-backend)
+
diff --git a/net-p2p/xmr-stak/xmr-stak-2.4.2-r1.ebuild b/net-p2p/xmr-stak/xmr-stak-2.4.2-r1.ebuild
new file mode 100644
index 000000000000..046820ffa943
--- /dev/null
+++ b/net-p2p/xmr-stak/xmr-stak-2.4.2-r1.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils systemd
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="https://github.com/fireice-uk/xmr-stak.git"
+ EGIT_BRANCH="dev"
+ inherit git-r3
+ SRC_URI=""
+else
+ SRC_URI="https://github.com/fireice-uk/xmr-stak/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Unified all-in-one Monero miner"
+HOMEPAGE="https://github.com/fireice-uk/xmr-stak"
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="cuda devfee hwloc opencl ssl webserver"
+
+DEPEND="cuda? ( dev-util/nvidia-cuda-toolkit )
+ hwloc? ( sys-apps/hwloc )
+ opencl? ( virtual/opencl )
+ ssl? ( dev-libs/openssl:0= )
+ webserver? ( net-libs/libmicrohttpd )"
+RDEPEND="${DEPEND}"
+PATCHES=(
+ "${FILESDIR}/${PN}-2.4.2-fix-paths.patch"
+)
+
+src_prepare() {
+ cmake-utils_src_prepare
+ if ! use devfee; then
+ sed -i -e 's!fDevDonationLevel = .*;!fDevDonationLevel = 0.0;!' xmrstak/donate-level.hpp || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCUDA_ENABLE=$(usex cuda)
+ -DHWLOC_ENABLE=$(usex hwloc)
+ -DMICROHTTPD_ENABLE=$(usex webserver)
+ -DOpenCL_ENABLE=$(usex opencl)
+ -DOpenSSL_ENABLE=$(usex ssl)
+ -DLIBRARY_OUTPUT_PATH=$(get_libdir)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ systemd_newunit "${FILESDIR}"/${PN}-2.3.0.service ${PN}.service
+ dodir /etc/xmr-stak
+}
+
+pkg_postinst() {
+ if [ ! -e "${ROOT}etc/xmr-stak/main.config" ]; then
+ ewarn "To use xmr-stack:"
+ if use cuda || use opencl; then
+ ewarn "As root or as a user that is a member of the 'video' group,"
+ fi
+ ewarn "run:"
+ ewarn "/usr/bin/xmr-stak --cpu /etc/xmr-stak/cpu.config --amd /etc/xmr-stak/amd.config --nvidia /etc/xmr-stak/nvidia.config -c /etc/xmr-stak/main.config"
+ ewarn "If the systemd will be used, xmr-stak can now be terminated and 'systemctl start xmr-stak' can be used."
+ fi
+}