Gentoo Archives: gentoo-commits

From: Craig Andrews <candrews@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-p2p/xmr-stak/, net-p2p/xmr-stak/files/
Date: Fri, 06 Apr 2018 19:22:07
Message-Id: 1523042513.e9c1423bb64f362ff30e6c074bf27aff47829dd9.candrews@gentoo
1 commit: e9c1423bb64f362ff30e6c074bf27aff47829dd9
2 Author: Craig Andrews <candrews <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 6 19:21:32 2018 +0000
4 Commit: Craig Andrews <candrews <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 6 19:21:53 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9c1423b
7
8 net-p2p/xmr-stak: Set the library path to get_libdir
9
10 Closes: https://bugs.gentoo.org/652602
11 See: https://github.com/fireice-uk/xmr-stak/pull/1339
12 Package-Manager: Portage-2.3.28, Repoman-2.3.9
13
14 .../xmr-stak/files/xmr-stak-2.4.2-fix-paths.patch | 68 +++++++++++++++++++++
15 net-p2p/xmr-stak/xmr-stak-2.4.2-r1.ebuild | 69 ++++++++++++++++++++++
16 2 files changed, 137 insertions(+)
17
18 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
19 new file mode 100644
20 index 00000000000..cd71554b377
21 --- /dev/null
22 +++ b/net-p2p/xmr-stak/files/xmr-stak-2.4.2-fix-paths.patch
23 @@ -0,0 +1,68 @@
24 +From 3bbf91be9f510ef999c62ae2d42a094d271299b7 Mon Sep 17 00:00:00 2001
25 +From: Craig Andrews <candrews@××××××××××××.com>
26 +Date: Fri, 6 Apr 2018 14:56:44 -0400
27 +Subject: [PATCH 1/2] Use EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH
28 +
29 +Use EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH to control the path to which the executable and libraries are installed.
30 +---
31 + CMakeLists.txt | 10 +++++-----
32 + 1 file changed, 5 insertions(+), 5 deletions(-)
33 +
34 +diff --git a/CMakeLists.txt b/CMakeLists.txt
35 +index 15a2684c..66c2f6f8 100644
36 +--- a/CMakeLists.txt
37 ++++ b/CMakeLists.txt
38 +@@ -535,23 +535,23 @@ target_link_libraries(xmr-stak ${LIBS} xmr-stak-c xmr-stak-backend)
39 + # do not install the binary if the project and install are equal
40 + if( NOT CMAKE_INSTALL_PREFIX STREQUAL PROJECT_BINARY_DIR )
41 + install(TARGETS xmr-stak
42 +- RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
43 ++ RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/${EXECUTABLE_OUTPUT_PATH}")
44 + if(CUDA_FOUND)
45 + if(WIN32)
46 + install(TARGETS xmrstak_cuda_backend
47 +- RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
48 ++ RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/${LIBRARY_OUTPUT_PATH}")
49 + else()
50 + install(TARGETS xmrstak_cuda_backend
51 +- LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
52 ++ LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/${LIBRARY_OUTPUT_PATH}")
53 + endif()
54 + endif()
55 + if(OpenCL_FOUND)
56 + if(WIN32)
57 + install(TARGETS xmrstak_opencl_backend
58 +- RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
59 ++ RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/${LIBRARY_OUTPUT_PATH}")
60 + else()
61 + install(TARGETS xmrstak_opencl_backend
62 +- LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
63 ++ LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/${LIBRARY_OUTPUT_PATH}")
64 + endif()
65 + endif()
66 + else()
67 +
68 +From c1d907ee03795fdce80daba6395e2a7eb1333930 Mon Sep 17 00:00:00 2001
69 +From: Craig Andrews <candrews@××××××××××××.com>
70 +Date: Fri, 6 Apr 2018 15:11:07 -0400
71 +Subject: [PATCH 2/2] Allow EXECUTABLE and LIBRARY paths to be set
72 +
73 +---
74 + CMakeLists.txt | 4 ++--
75 + 1 file changed, 2 insertions(+), 2 deletions(-)
76 +
77 +diff --git a/CMakeLists.txt b/CMakeLists.txt
78 +index 66c2f6f8..1ff7fbb4 100644
79 +--- a/CMakeLists.txt
80 ++++ b/CMakeLists.txt
81 +@@ -522,8 +522,8 @@ else()
82 + add_executable(xmr-stak ${SRCFILES_CPP})
83 + endif()
84 +
85 +-set(EXECUTABLE_OUTPUT_PATH "bin")
86 +-set(LIBRARY_OUTPUT_PATH "bin")
87 ++set(EXECUTABLE_OUTPUT_PATH "bin" CACHE STRING "Path to place executables")
88 ++set(LIBRARY_OUTPUT_PATH "bin" CACHE STRING "Path to place libraries")
89 +
90 + target_link_libraries(xmr-stak ${LIBS} xmr-stak-c xmr-stak-backend)
91 +
92
93 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
94 new file mode 100644
95 index 00000000000..046820ffa94
96 --- /dev/null
97 +++ b/net-p2p/xmr-stak/xmr-stak-2.4.2-r1.ebuild
98 @@ -0,0 +1,69 @@
99 +# Copyright 1999-2018 Gentoo Foundation
100 +# Distributed under the terms of the GNU General Public License v2
101 +
102 +EAPI=6
103 +
104 +inherit cmake-utils systemd
105 +
106 +if [[ ${PV} == "9999" ]] ; then
107 + EGIT_REPO_URI="https://github.com/fireice-uk/xmr-stak.git"
108 + EGIT_BRANCH="dev"
109 + inherit git-r3
110 + SRC_URI=""
111 +else
112 + SRC_URI="https://github.com/fireice-uk/xmr-stak/archive/${PV}.tar.gz -> ${P}.tar.gz"
113 + KEYWORDS="~amd64"
114 +fi
115 +
116 +DESCRIPTION="Unified all-in-one Monero miner"
117 +HOMEPAGE="https://github.com/fireice-uk/xmr-stak"
118 +LICENSE="GPL-3"
119 +SLOT="0"
120 +IUSE="cuda devfee hwloc opencl ssl webserver"
121 +
122 +DEPEND="cuda? ( dev-util/nvidia-cuda-toolkit )
123 + hwloc? ( sys-apps/hwloc )
124 + opencl? ( virtual/opencl )
125 + ssl? ( dev-libs/openssl:0= )
126 + webserver? ( net-libs/libmicrohttpd )"
127 +RDEPEND="${DEPEND}"
128 +PATCHES=(
129 + "${FILESDIR}/${PN}-2.4.2-fix-paths.patch"
130 +)
131 +
132 +src_prepare() {
133 + cmake-utils_src_prepare
134 + if ! use devfee; then
135 + sed -i -e 's!fDevDonationLevel = .*;!fDevDonationLevel = 0.0;!' xmrstak/donate-level.hpp || die
136 + fi
137 +}
138 +
139 +src_configure() {
140 + local mycmakeargs=(
141 + -DCUDA_ENABLE=$(usex cuda)
142 + -DHWLOC_ENABLE=$(usex hwloc)
143 + -DMICROHTTPD_ENABLE=$(usex webserver)
144 + -DOpenCL_ENABLE=$(usex opencl)
145 + -DOpenSSL_ENABLE=$(usex ssl)
146 + -DLIBRARY_OUTPUT_PATH=$(get_libdir)
147 + )
148 + cmake-utils_src_configure
149 +}
150 +
151 +src_install() {
152 + cmake-utils_src_install
153 + systemd_newunit "${FILESDIR}"/${PN}-2.3.0.service ${PN}.service
154 + dodir /etc/xmr-stak
155 +}
156 +
157 +pkg_postinst() {
158 + if [ ! -e "${ROOT}etc/xmr-stak/main.config" ]; then
159 + ewarn "To use xmr-stack:"
160 + if use cuda || use opencl; then
161 + ewarn "As root or as a user that is a member of the 'video' group,"
162 + fi
163 + ewarn "run:"
164 + 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"
165 + ewarn "If the systemd will be used, xmr-stak can now be terminated and 'systemctl start xmr-stak' can be used."
166 + fi
167 +}