Skip to content

Commit

Permalink
net-p2p/litecoind: add 0.18.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SoapGentoo authored and thesamesam committed Jun 18, 2021
1 parent 3b486b9 commit 2d4a9bb
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
1 change: 1 addition & 0 deletions net-p2p/litecoind/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DIST litecoin-0.10.4.0.tar.gz 4730189 BLAKE2B 3b3e4db10ca7ebb048853a424438d888a239cc736b1b2aa29dd0b6571daec5a64f95aee98a82991cd3e69b26965151f298655ca09745f103ebde1d15216ae2f8 SHA512 ae17e754d188efb1b51a376a52fe03e43b58c5059673b7dd4ecbf4f48574290b84011525fef2e10893f53e4da3d6ad9b5577001bb40aef7080d4c2479f4714a9
DIST litecoin-0.18.1.tar.gz 5122629 BLAKE2B c6cb220bb893518eaf04e1b4b825dc0318103c955da6f262ef13fc9d925b7bae1bb0407a701a04a17bb3040c613b666e6de3331d443046e9d83aec4ed559e02e SHA512 59605cc0c4fd67c128bad0e2cabcc7b6bda1ebf5b23b7fcaee9fa69e86a4349598feba413f0ad42aef9338a42b0d6f8c04306634bd543856a2e7a203aa717f40
37 changes: 37 additions & 0 deletions net-p2p/litecoind/files/litecoind-0.18.1-system-leveldb.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
--- a/configure.ac
+++ b/configure.ac
@@ -894,10 +894,22 @@
[AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])
fi

+dnl Check for leveldb, only if explicitly requested
LEVELDB_CPPFLAGS=
LIBLEVELDB=
LIBMEMENV=
-AM_CONDITIONAL([EMBEDDED_LEVELDB],[true])
+AC_ARG_WITH([system-leveldb],
+ [AS_HELP_STRING([--with-system-leveldb],
+ [Build with system LevelDB (default is no; DANGEROUS; NOT SUPPORTED)])],
+ [system_leveldb=$withval],
+ [system_leveldb=no]
+)
+if test x$system_leveldb != xno; then
+ LEVELDB_CPPFLAGS=
+ LIBLEVELDB=-lleveldb
+ LIBMEMENV=-lmemenv
+fi
+AM_CONDITIONAL([EMBEDDED_LEVELDB],[test x$system_leveldb = xno])
AC_SUBST(LEVELDB_CPPFLAGS)
AC_SUBST(LIBLEVELDB)
AC_SUBST(LIBMEMENV)
--- a/src/dbwrapper.cpp
+++ b/src/dbwrapper.cpp
@@ -10,7 +10,7 @@
#include <leveldb/cache.h>
#include <leveldb/env.h>
#include <leveldb/filter_policy.h>
-#include <memenv.h>
+#include <leveldb/helpers/memenv.h>
#include <stdint.h>
#include <algorithm>

87 changes: 87 additions & 0 deletions net-p2p/litecoind/litecoind-0.18.1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

DB_VER="4.8"

inherit autotools db-use flag-o-matic systemd

MY_PV="${PV/_/-}"
MY_PN="litecoin"
MY_P="${MY_PN}-${MY_PV}"

DESCRIPTION="The offical daemon to run your own (full) Litecoin node"
HOMEPAGE="https://litecoin.org/"
SRC_URI="https://github.com/${MY_PN}-project/${MY_PN}/archive/v${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
S="${WORKDIR}/${MY_P}"

LICENSE="MIT ISC GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="cpu_flags_x86_sse2 upnp +wallet"

RDEPEND="
acct-group/litecoin
acct-user/litecoin
dev-libs/boost:=[threads(+)]
dev-libs/leveldb:=
dev-libs/libevent:=[threads(+)]
dev-libs/openssl:=[-bindist(-)]
sys-libs/db:$(db_ver_to_slot ${DB_VER})[cxx]
upnp? ( net-libs/miniupnpc:= )"
DEPEND="${RDEPEND}"

PATCHES=( "${FILESDIR}"/${P}-system-leveldb.patch )

src_prepare() {
default
rm -r src/leveldb || die
eautoreconf
}

src_configure() {
# To avoid executable GNU stack.
append-ldflags -Wl,-z,noexecstack

local myeconfargs=(
$(use_enable wallet)
$(use_with upnp miniupnpc)
$(use_enable upnp upnp-default)
$(use_enable cpu_flags_x86_sse2 sse2)
--disable-ccache
--disable-static
# tests are broken and segfault
--disable-tests
--with-system-leveldb
--without-libs
--with-daemon
--without-gui
--without-qrencode
)
econf "${myeconfargs[@]}"
}

src_install() {
default

insinto /etc/litecoin
doins "${FILESDIR}"/litecoin.conf
fowners litecoin:litecoin /etc/litecoin/litecoin.conf
fperms 600 /etc/litecoin/litecoin.conf

newconfd "${FILESDIR}"/litecoin.confd ${PN}
newinitd "${FILESDIR}"/litecoin.initd-r1 ${PN}
systemd_dounit "${FILESDIR}"/litecoin.service

keepdir /var/lib/litecoin/.litecoin
fperms 700 /var/lib/litecoin
fowners litecoin:litecoin /var/lib/litecoin/
fowners litecoin:litecoin /var/lib/litecoin/.litecoin
dosym /etc/litecoin/litecoin.conf /var/lib/litecoin/.litecoin/litecoin.conf

dodoc doc/README.md doc/release-notes.md

insinto /etc/logrotate.d
newins "${FILESDIR}"/litecoind.logrotate litecoind
}

0 comments on commit 2d4a9bb

Please sign in to comment.