summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net-p2p/monero/files/monero-0.17.3.0-Do-not-install-trezor-dep-libs.patch25
-rw-r--r--net-p2p/monero/files/monero-0.17.3.0-Drop-in-tree-miniupnpc.patch60
-rw-r--r--net-p2p/monero/files/monero-0.17.3.0-Use-gentoo-dev-libs-randomx.patch18
-rw-r--r--net-p2p/monero/files/monero-0.17.3.0-Use-gentoo-versioning.patch37
-rw-r--r--net-p2p/monero/files/monero-0.17.3.0-translations-use-host-compiler.patch43
-rw-r--r--net-p2p/monero/files/monero-gui-0.17.3.0-cmake-use-gentoo-versioning.patch33
-rw-r--r--net-p2p/monero/monero-0.17.3.0.ebuild211
7 files changed, 427 insertions, 0 deletions
diff --git a/net-p2p/monero/files/monero-0.17.3.0-Do-not-install-trezor-dep-libs.patch b/net-p2p/monero/files/monero-0.17.3.0-Do-not-install-trezor-dep-libs.patch
new file mode 100644
index 00000000..8e67be09
--- /dev/null
+++ b/net-p2p/monero/files/monero-0.17.3.0-Do-not-install-trezor-dep-libs.patch
@@ -0,0 +1,25 @@
+From 6c75b95c9b4c3bd43842e50da7c14f122ed4fcb0 Mon Sep 17 00:00:00 2001
+From: Bertrand Jacquin <bertrand@jacquin.bzh>
+Date: Sat, 15 Jun 2019 00:57:09 +0100
+Subject: [PATCH] Do not install trezor dep libs
+
+---
+ src/wallet/CMakeLists.txt | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/src/wallet/CMakeLists.txt b/src/wallet/CMakeLists.txt
+index bf238ae37887..0cfb534ed4fe 100644
+--- a/src/wallet/CMakeLists.txt
++++ b/src/wallet/CMakeLists.txt
+@@ -149,11 +149,7 @@ if (BUILD_GUI_DEPS)
+ install(TARGETS wallet_merged
+ ARCHIVE DESTINATION ${lib_folder})
+
+- install(FILES ${TREZOR_DEP_LIBS}
+- DESTINATION ${lib_folder})
+ file(WRITE "trezor_link_flags.txt" ${TREZOR_DEP_LINKER})
+- install(FILES "trezor_link_flags.txt"
+- DESTINATION ${lib_folder})
+ endif()
+
+ add_subdirectory(api)
diff --git a/net-p2p/monero/files/monero-0.17.3.0-Drop-in-tree-miniupnpc.patch b/net-p2p/monero/files/monero-0.17.3.0-Drop-in-tree-miniupnpc.patch
new file mode 100644
index 00000000..56b93027
--- /dev/null
+++ b/net-p2p/monero/files/monero-0.17.3.0-Drop-in-tree-miniupnpc.patch
@@ -0,0 +1,60 @@
+From f9b6fc9209e256b00bd5f198a9427d6ce1c9f34b Mon Sep 17 00:00:00 2001
+From: Bertrand Jacquin <bertrand@jacquin.bzh>
+Date: Sun, 17 Jun 2018 22:34:11 +0100
+Subject: [PATCH] Drop in-tree miniupnpc
+
+Since 6b8539803184 ("Build: update CMake and p2p for in-tree
+miniupnp"), a hard dependency is made on miniupnpc which is a git
+submodule not part of the archive available upstream.
+---
+ external/CMakeLists.txt | 19 +++----------------
+ src/p2p/net_node.inl | 6 +++---
+ 2 files changed, 6 insertions(+), 19 deletions(-)
+
+diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
+index 7ae4ba750da4..77e9a50205ff 100644
+--- a/external/CMakeLists.txt
++++ b/external/CMakeLists.txt
+@@ -36,22 +36,9 @@
+ # others.
+
+ find_package(Miniupnpc REQUIRED)
+-
+-message(STATUS "Using in-tree miniupnpc")
+-set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE)
+-add_subdirectory(miniupnp/miniupnpc)
+-set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
+-set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON)
+-if(MSVC)
+- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267")
+-elseif(NOT MSVC)
+- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value")
+-endif()
+-if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE")
+-endif()
+-
+-set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)
++set(UPNP_STATIC false PARENT_SCOPE)
++set(UPNP_INCLUDE ${MINIUPNP_INCLUDE_DIR} PARENT_SCOPE)
++set(UPNP_LIBRARIES ${MINIUPNP_LIBRARY} PARENT_SCOPE)
+
+ find_package(Unbound)
+
+diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
+index 71021b24c3c5..a2f5930aaf7b 100644
+--- a/src/p2p/net_node.inl
++++ b/src/p2p/net_node.inl
+@@ -61,9 +61,9 @@
+ #include "cryptonote_core/cryptonote_core.h"
+ #include "net/parse.h"
+
+-#include <miniupnp/miniupnpc/miniupnpc.h>
+-#include <miniupnp/miniupnpc/upnpcommands.h>
+-#include <miniupnp/miniupnpc/upnperrors.h>
++#include <miniupnpc/miniupnpc.h>
++#include <miniupnpc/upnpcommands.h>
++#include <miniupnpc/upnperrors.h>
+
+ #undef MONERO_DEFAULT_LOG_CATEGORY
+ #define MONERO_DEFAULT_LOG_CATEGORY "net.p2p"
diff --git a/net-p2p/monero/files/monero-0.17.3.0-Use-gentoo-dev-libs-randomx.patch b/net-p2p/monero/files/monero-0.17.3.0-Use-gentoo-dev-libs-randomx.patch
new file mode 100644
index 00000000..3ed12631
--- /dev/null
+++ b/net-p2p/monero/files/monero-0.17.3.0-Use-gentoo-dev-libs-randomx.patch
@@ -0,0 +1,18 @@
+From 0644c9fcb32af4f5cd55dc1040007631f01cf2ca Mon Sep 17 00:00:00 2001
+From: Bertrand Jacquin <bertrand@jacquin.bzh>
+Date: Wed, 6 Nov 2019 01:23:52 +0000
+Subject: [PATCH] Use gentoo dev-libs/randomx
+
+---
+ external/CMakeLists.txt | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
+index 85040f05b3d3..adf307c5fc01 100644
+--- a/external/CMakeLists.txt
++++ b/external/CMakeLists.txt
+@@ -66,4 +66,3 @@ endif()
+ add_subdirectory(db_drivers)
+ add_subdirectory(easylogging++)
+ add_subdirectory(qrcodegen)
+-add_subdirectory(randomx EXCLUDE_FROM_ALL)
diff --git a/net-p2p/monero/files/monero-0.17.3.0-Use-gentoo-versioning.patch b/net-p2p/monero/files/monero-0.17.3.0-Use-gentoo-versioning.patch
new file mode 100644
index 00000000..c10730cf
--- /dev/null
+++ b/net-p2p/monero/files/monero-0.17.3.0-Use-gentoo-versioning.patch
@@ -0,0 +1,37 @@
+From 67dac45de0bfb119888cb5ebb41be1283a074a3d Mon Sep 17 00:00:00 2001
+From: Bertrand Jacquin <bertrand@jacquin.bzh>
+Date: Sat, 15 Jun 2019 00:15:54 +0100
+Subject: [PATCH] Use gentoo versioning
+
+---
+ cmake/Version.cmake | 18 +++---------------
+ 1 file changed, 3 insertions(+), 15 deletions(-)
+
+diff --git a/cmake/Version.cmake b/cmake/Version.cmake
+index 707d7263958a..e6386339d720 100644
+--- a/cmake/Version.cmake
++++ b/cmake/Version.cmake
+@@ -31,20 +31,8 @@ function (write_version tag)
+ configure_file("${CMAKE_CURRENT_LIST_DIR}/../src/version.cpp.in" "${CMAKE_BINARY_DIR}/version.cpp")
+ endfunction ()
+
+-find_package(Git QUIET)
+-if ("$Format:$" STREQUAL "")
+- # We're in a tarball; use hard-coded variables.
+- set(VERSION_IS_RELEASE "true")
+- write_version("release")
+-elseif (GIT_FOUND OR Git_FOUND)
+- message(STATUS "Found Git: ${GIT_EXECUTABLE}")
+- include(GitVersion)
+- get_version_tag_from_git("${GIT_EXECUTABLE}")
+- write_version("${VERSIONTAG}")
+-else()
+- message(STATUS "WARNING: Git was not found!")
+- set(VERSION_IS_RELEASE "false")
+- write_version("unknown")
+-endif ()
++set(VERSION_IS_RELEASE "true")
++write_version("release")
++
+ add_custom_target(genversion ALL
+ DEPENDS "${CMAKE_BINARY_DIR}/version.cpp")
diff --git a/net-p2p/monero/files/monero-0.17.3.0-translations-use-host-compiler.patch b/net-p2p/monero/files/monero-0.17.3.0-translations-use-host-compiler.patch
new file mode 100644
index 00000000..40276b0a
--- /dev/null
+++ b/net-p2p/monero/files/monero-0.17.3.0-translations-use-host-compiler.patch
@@ -0,0 +1,43 @@
+From e10d750a15343998ae1b655947820cdb26e58276 Mon Sep 17 00:00:00 2001
+From: Bertrand Jacquin <bertrand@jacquin.bzh>
+Date: Sat, 30 Nov 2019 02:09:14 +0000
+Subject: [PATCH] translations: use host compiler
+
+Do not pass target compiler and compiler flags as
+generate_translations_header need to be created using host compiler and
+compiler flags
+---
+ CMakeLists.txt | 4 +++-
+ translations/CMakeLists.txt | 4 ++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ffb5abb82534..49f18a57cf7e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -542,7 +542,9 @@ ExternalProject_Add(generate_translations_header
+ SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/translations"
+ BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/translations"
+ STAMP_DIR ${LRELEASE_PATH}
+- CMAKE_ARGS -DLRELEASE_PATH=${LRELEASE_PATH}
++ CMAKE_ARGS
++ -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_BINARY_DIR}/translations.cmake
++ -DLRELEASE_PATH=${LRELEASE_PATH}
+ INSTALL_COMMAND cmake -E echo "")
+ include_directories("${CMAKE_CURRENT_BINARY_DIR}/translations")
+ add_subdirectory(external)
+diff --git a/translations/CMakeLists.txt b/translations/CMakeLists.txt
+index 7e31ed319e94..64bda84f055e 100644
+--- a/translations/CMakeLists.txt
++++ b/translations/CMakeLists.txt
+@@ -28,6 +28,10 @@
+
+ cmake_minimum_required(VERSION 3.5)
+
++# Ensure LDFLAGS for target are not propagated here since target are
++# meant for host
++UNSET(ENV{LDFLAGS})
++
+ project(translations)
+
+ # when crosscompiling import the executable targets from a file
diff --git a/net-p2p/monero/files/monero-gui-0.17.3.0-cmake-use-gentoo-versioning.patch b/net-p2p/monero/files/monero-gui-0.17.3.0-cmake-use-gentoo-versioning.patch
new file mode 100644
index 00000000..546c562a
--- /dev/null
+++ b/net-p2p/monero/files/monero-gui-0.17.3.0-cmake-use-gentoo-versioning.patch
@@ -0,0 +1,33 @@
+From d83bfe6ab9b90b16d48e7bd7c88ee1a75a91afda Mon Sep 17 00:00:00 2001
+From: Bertrand Jacquin <bertrand@jacquin.bzh>
+Date: Sun, 18 Oct 2020 15:43:33 +0100
+Subject: [PATCH] cmake: use gentoo versioning
+
+---
+ cmake/VersionGui.cmake | 14 ++------------
+ 1 file changed, 2 insertions(+), 12 deletions(-)
+
+diff --git a/cmake/VersionGui.cmake b/cmake/VersionGui.cmake
+index e225bf2bb3c0..786bb2d934f1 100644
+--- a/cmake/VersionGui.cmake
++++ b/cmake/VersionGui.cmake
+@@ -31,17 +31,7 @@ function (write_static_version_header tag)
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/version.js.in" "${CMAKE_CURRENT_SOURCE_DIR}/version.js")
+ endfunction ()
+
+-find_package(Git QUIET)
+-if ("$Format:$" STREQUAL "")
+- # We're in a tarball; use hard-coded variables.
+- write_static_version_header("release")
+-elseif (GIT_FOUND OR Git_FOUND)
+- message(STATUS "Found Git: ${GIT_EXECUTABLE}")
+- get_version_tag_from_git("${GIT_EXECUTABLE}")
+- write_static_version_header(${VERSIONTAG})
+-else()
+- message(STATUS "WARNING: Git was not found!")
+- write_static_version_header("unknown")
+-endif ()
++write_static_version_header("release")
++
+ add_custom_target(genversiongui ALL
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/version.js")
diff --git a/net-p2p/monero/monero-0.17.3.0.ebuild b/net-p2p/monero/monero-0.17.3.0.ebuild
new file mode 100644
index 00000000..0a45c1bf
--- /dev/null
+++ b/net-p2p/monero/monero-0.17.3.0.ebuild
@@ -0,0 +1,211 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+MONERO_GUI_PV=0.17.3.0
+
+PYTHON_COMPAT=( python{3_8,3_9} )
+CMAKE_MAKEFILE_GENERATOR="emake"
+inherit git-r3 cmake flag-o-matic toolchain-funcs python-any-r1 systemd
+
+DESCRIPTION="Secure, private, untraceable cryptocurrency"
+HOMEPAGE="https://getmonero.org"
+
+EGIT_REPO_URI="https://github.com/monero-project/${PN}.git"
+EGIT_COMMIT="v${PV}"
+EGIT_COMMIT_GUI="v${MONERO_GUI_PV}"
+EGIT_SUBMODULES=( external/trezor-common external/supercop external/quirc )
+
+LICENSE="NEWLIB"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~arm64"
+CPU_FLAGS="cpu_flags_arm_aes cpu_flags_x86_aes"
+IUSE="doc qt5 nls readline smartcard ${CPU_FLAGS}"
+
+RDEPEND="net-dns/unbound:=[threads]
+ >=dev-libs/randomx-1.1.9:=
+ net-libs/miniupnpc:=
+ dev-libs/openssl:0
+ || (
+ >=dev-libs/boost-1.62:=[icu,nls]
+ >=dev-libs/boost-1.62:=[icu,threads,nls]
+ )
+ net-libs/zeromq:=[sodium]
+ dev-libs/rapidjson:=
+ readline? ( sys-libs/readline:= )
+ smartcard? (
+ dev-libs/hidapi:=
+ virtual/libusb:=
+ virtual/libudev:=
+ dev-libs/protobuf:=
+ )
+ qt5? (
+ dev-qt/qtconcurrent:5
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtdeclarative:5
+ dev-qt/qtnetwork:5
+ dev-qt/qtsvg:5
+ dev-qt/qtxmlpatterns:5[qml]
+ dev-qt/qtwidgets:5
+ dev-qt/qtmultimedia:5
+ dev-qt/qtquickcontrols:5
+ dev-qt/qtquickcontrols2:5
+ dev-qt/qtgraphicaleffects:5
+ dev-libs/libgcrypt:=
+ media-fonts/fontawesome[ttf]
+ )
+ acct-user/monero
+ acct-group/monero"
+DEPEND="${RDEPEND}
+ nls? ( dev-qt/qtchooser )"
+BDEPEND="${PYTHON_DEPS}
+ doc? (
+ media-gfx/graphviz
+ app-doc/doxygen:0
+ )
+ qt5? ( dev-qt/linguist-tools:5 )
+ smartcard? ( $(python_gen_any_dep 'dev-python/protobuf-python[${PYTHON_USEDEP}]') )"
+
+PATCHES_MONERO=(
+ "${FILESDIR}/monero-${PV}-Drop-in-tree-miniupnpc.patch"
+ "${FILESDIR}/monero-${PV}-Use-gentoo-versioning.patch"
+ "${FILESDIR}/monero-${PV}-Do-not-install-trezor-dep-libs.patch"
+ "${FILESDIR}/monero-${PV}-Use-gentoo-dev-libs-randomx.patch"
+ "${FILESDIR}/monero-${PV}-translations-use-host-compiler.patch"
+)
+
+PATCHES_MONERO_GUI=(
+ "${FILESDIR}/monero-gui-${PV}-cmake-use-gentoo-versioning.patch"
+)
+
+CMAKE_BUILD_TYPE=Release
+
+src_unpack() {
+ git-r3_src_unpack
+
+ if use qt5 ; then
+ git-r3_fetch "https://github.com/monero-project/${PN}-gui.git" "${EGIT_COMMIT_GUI}"
+ git-r3_checkout "https://github.com/monero-project/${PN}-gui.git" "${WORKDIR}/monero-gui-${PV}"
+
+ rm -rf "${WORKDIR}/monero-gui-${PV}/monero" || die
+ ln -snf "${WORKDIR}/monero-${PV}" "${WORKDIR}/monero-gui-${PV}/monero" || die
+ fi
+}
+
+src_prepare() {
+ export AR=$(tc-getAR)
+ export CC=$(tc-getCC)
+ export CXX=$(tc-getCXX)
+ tc-export_build_env BUILD_C{C,XX}
+
+ append-cflags -DUSE_EXTRA_EC_CERT
+ append-cxxflags -DUSE_EXTRA_EC_CERT
+
+ CMAKE_USE_DIR="${WORKDIR}/monero-${PV}"
+ BUILD_DIR="${WORKDIR}/monero-${PV}_build"
+ S="${CMAKE_USE_DIR}" PATCHES="${PATCHES_MONERO[@]}" cmake_src_prepare
+
+ if use qt5 ; then
+ CMAKE_USE_DIR="${WORKDIR}/monero-gui-${PV}"
+ BUILD_DIR="${WORKDIR}/monero-gui-${PV}_build"
+ S="${CMAKE_USE_DIR}" PATCHES="${PATCHES_MONERO_GUI[@]}" cmake_src_prepare
+ fi
+}
+
+src_configure() {
+ local mycmakeargs
+ local cmakeargs_monero=(
+ -DBUILD_TAG="$(tc-arch)"
+ -DUSE_CCACHE=OFF
+ -DPYTHON_EXECUTABLE="${PYTHON}"
+ -DBUILD_DOCUMENTATION="$(usex doc ON OFF)"
+ -DBUILD_TESTS=OFF
+ -DCOVERAGE=OFF
+ -DUSE_READLINE="$(usex readline ON OFF)"
+ -DBUILD_GUI_DEPS="$(usex qt5 ON OFF)"
+ -DINSTALL_VENDORED_LIBUNBOUND=OFF
+ -DBUILD_SHARED_LIBS=OFF
+ -DMANUAL_SUBMODULES=ON
+ )
+
+ if use cpu_flags_arm_aes || use cpu_flags_x86_aes ; then
+ cmakeargs_monero+=( -DNO_AES=OFF )
+ else
+ cmakeargs_monero+=( -DNO_AES=ON )
+ fi
+
+ if use elibc_musl ; then
+ # https://github.com/monero-project/monero/issues/2030
+ cmakeargs_monero+=( -DSTACK_TRACE=OFF )
+ fi
+
+ local cmakeargs_monerogui=(
+ "${cmakeargs_monero[@]}"
+ -DUSE_DEVICE_TREZOR="$(usex smartcard ON OFF)"
+ -DWITH_SCANNER=ON
+ -DDEV_MODE=OFF
+ )
+
+ export DATABASE="lmdb"
+ export DEVELOPER_LOCAL_TOOLS=0
+ export DEVELOPER_LIBUNBOUND_OLD=0
+
+ cat > "${WORKDIR}/monero-${PV}_build/translations.cmake" <<- _EOF_ || die
+ SET (CMAKE_C_COMPILER "${BUILD_CC}")
+ SET (CMAKE_C_FLAGS "${BUILD_CFLAGS}")
+ SET (CMAKE_CXX_COMPILER "${BUILD_CXX}")
+ SET (CMAKE_CXX_FLAGS "${BUILD_CXXFLAGS}")
+ SET (CMAKE_EXE_LINKER_FLAGS "${BUILD_LDFLAGS}")
+ SET (CMAKE_MODULE_LINKER_FLAGS "${BUILD_LDFLAGS}")
+ SET (CMAKE_SHARED_LINKER_FLAGS "${BUILD_LDFLAGS}")
+_EOF_
+
+ CMAKE_USE_DIR="${WORKDIR}/monero-${PV}"
+ BUILD_DIR="${WORKDIR}/monero-${PV}_build"
+ mycmakeargs=( ${cmakeargs_monero[@]} )
+ cmake_src_configure
+
+ if use qt5 ; then
+ mkdir -p "${WORKDIR}/monero-gui-${PV}_build/monero" || die
+ cp "${WORKDIR}/monero-${PV}_build/translations.cmake" "${WORKDIR}/monero-gui-${PV}_build/monero/translations.cmake" || die
+
+ CMAKE_USE_DIR="${WORKDIR}/monero-gui-${PV}"
+ BUILD_DIR="${WORKDIR}/monero-gui-${PV}_build"
+ mycmakeargs=( ${cmakeargs_monerogui[@]} )
+ cmake_src_configure
+ fi
+}
+
+src_compile() {
+ CMAKE_USE_DIR="${WORKDIR}/monero-${PV}"
+ BUILD_DIR="${WORKDIR}/monero-${PV}_build"
+ cmake_src_compile
+
+ if use qt5 ; then
+ CMAKE_USE_DIR="${WORKDIR}/monero-gui-${PV}"
+ BUILD_DIR="${WORKDIR}/monero-gui-${PV}_build"
+ cmake_src_compile
+ fi
+}
+
+src_install() {
+ CMAKE_USE_DIR="${WORKDIR}/monero-${PV}"
+ BUILD_DIR="${WORKDIR}/monero-${PV}_build"
+ cmake_src_install
+
+ if use qt5 ; then
+ CMAKE_USE_DIR="${WORKDIR}/monero-gui-${PV}"
+ BUILD_DIR="${WORKDIR}/monero-gui-${PV}_build"
+ cmake_src_install
+ fi
+
+ rm -rf "${ED}/usr/include" || die
+ rm -rf "${ED}/usr/lib" || die
+
+ insinto /etc
+ doins utils/conf/monerod.conf
+
+ newinitd "${FILESDIR}/monerod.initd" monerod
+ systemd_dounit utils/systemd/monerod.service
+}