summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlayman <layman@localhost>2013-11-30 17:24:33 -0500
committerlayman <layman@localhost>2013-11-30 17:24:33 -0500
commit9802f7dd46f34f8fbe9cadb3c2a68000e1e1f89e (patch)
treef37d3f1d21c71c8c86a557dbd155b16777300b3f
parentnet-p2p/ppcoin-qt: fix typo in src_test() (diff)
downloadblueness-9802f7dd46f34f8fbe9cadb3c2a68000e1e1f89e.tar.gz
blueness-9802f7dd46f34f8fbe9cadb3c2a68000e1e1f89e.tar.bz2
blueness-9802f7dd46f34f8fbe9cadb3c2a68000e1e1f89e.zip
net-p2p/primecoin-qt: initial commit
-rw-r--r--net-p2p/primecoin-qt/Manifest4
-rw-r--r--net-p2p/primecoin-qt/files/primecoin-sys_leveldb.patch176
-rw-r--r--net-p2p/primecoin-qt/metadata.xml11
-rw-r--r--net-p2p/primecoin-qt/primecoin-qt-0.1.2.ebuild144
4 files changed, 335 insertions, 0 deletions
diff --git a/net-p2p/primecoin-qt/Manifest b/net-p2p/primecoin-qt/Manifest
new file mode 100644
index 0000000..ec6ea4e
--- /dev/null
+++ b/net-p2p/primecoin-qt/Manifest
@@ -0,0 +1,4 @@
+AUX primecoin-sys_leveldb.patch 6836 SHA256 460e6d013d897d108c8c0234dc0a5f57b114b050c586f8877ef8ad7c3f1f6dba SHA512 b7dd42bf2a83528db7b828fd95e93a9c025cb84ea3844591a4012fd2504a785cbdc589ceff6324664a44087d09a133c05eed186c4dfa82b534257224ff0f906f WHIRLPOOL b6a178d084d9f877c82cba21301071e542e39e63865dcb0179d2a2b3d6e1d72d2ae9263a3332c4512298d29850023e5b8b1249f86520d8ad3c55fcd339a46013
+DIST primecoin-0.1.2.tar.gz 16521236 SHA256 d0f3c6a91b4d505f25e9284bcca85e420cf09d0e6cf71e5a001b7e1367ef46d0 SHA512 cff71b0e6459c4e534e78acef9491090d05c0cb864a068c0a3cb289310a1ee13fd69c7b61a7d6cb9732af54fbcf1fa4e77db8c8528a09bbdafd36421fdf7aff1 WHIRLPOOL 5031efa135dcf08975a06a037179863ad180920e0c55e0ec5d1863b4b24d005ce829fa0e0f081120d3610bc0abd1d3919db477a33e32ec6d0d353b7177480eb1
+EBUILD primecoin-qt-0.1.2.ebuild 3143 SHA256 6eb15195ce699fea813d9b98f924330379eaa1ee9a27977cbb6f97385e80f554 SHA512 c2bbde275ddf1313abf75a0bb9396899f602f472cd850d34831c9aadb6f4a25439eadef76ba031e855cff2fdee7e756a17cbe2a4ccb26fbe09cf2595893efd89 WHIRLPOOL d04f9a9d56f2e19997b9abea0102e3b01b22d9b87692755952aac5d689ade282d5723acace27401238f9343f166924a1303e9ac903cdc8d371c7e6742d600f21
+MISC metadata.xml 335 SHA256 fd617e5b5cdf18a293d584d24d15a4cf35d3626106804f2424bd2d55143cf804 SHA512 80c5870e0ef0fdb6e4ffc9a7877aeca9269684e1bc42e2dd1ce6ea10214710dc70b4dcf848f581b439ae50d5dac32614c292ca943d023f4d53b773f1af851565 WHIRLPOOL d64f49a82dd2e8107c4dee45b3f56de370064b5303b912be29a9307167b7e0b78659e468647fe370b83d94881121c476acf80cefd943cde67c02ceff38696edc
diff --git a/net-p2p/primecoin-qt/files/primecoin-sys_leveldb.patch b/net-p2p/primecoin-qt/files/primecoin-sys_leveldb.patch
new file mode 100644
index 0000000..39d0aa6
--- /dev/null
+++ b/net-p2p/primecoin-qt/files/primecoin-sys_leveldb.patch
@@ -0,0 +1,176 @@
+diff -Naur primecoin-0.1.2-linux.orig/src/bitcoin-qt.pro primecoin-0.1.2-linux/src/bitcoin-qt.pro
+--- primecoin-0.1.2-linux.orig/src/bitcoin-qt.pro 2013-08-05 08:37:14.000000000 -0400
++++ primecoin-0.1.2-linux/src/bitcoin-qt.pro 2013-11-30 16:39:48.464770389 -0500
+@@ -4,7 +4,7 @@
+ VERSION = 0.8.3
+ INCLUDEPATH += src src/json src/qt
+ QT += network
+-DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
++DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE LEVELDB_WITHOUT_MEMENV
+ CONFIG += no_include_pwd
+ CONFIG += thread
+
+@@ -98,25 +98,29 @@
+ QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
+ }
+
++contains(USE_SYSTEM_LEVELDB, 1) {
++ LIBS += -lleveldb
++} else {
+ INCLUDEPATH += src/leveldb/include src/leveldb/helpers
+-LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a
++LIBS += $$PWD/src/leveldb/libleveldb.a
+ !win32 {
+ # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences
+- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a
++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a
+ } else {
+ # make an educated guess about what the ranlib command is called
+ isEmpty(QMAKE_RANLIB) {
+ QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
+ }
+ LIBS += -lshlwapi
+- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a
+ }
+ genleveldb.target = $$PWD/src/leveldb/libleveldb.a
+ genleveldb.depends = FORCE
+ PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a
+ QMAKE_EXTRA_TARGETS += genleveldb
++}
+ # Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
+-QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb ; $(MAKE) clean
++QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb && $(MAKE) clean || true
+
+ # regenerate src/build.h
+ !win32|contains(USE_BUILD_INFO, 1) {
+diff -Naur primecoin-0.1.2-linux.orig/src/src/leveldb.cpp primecoin-0.1.2-linux/src/src/leveldb.cpp
+--- primecoin-0.1.2-linux.orig/src/src/leveldb.cpp 2013-08-05 08:37:20.000000000 -0400
++++ primecoin-0.1.2-linux/src/src/leveldb.cpp 2013-11-30 16:41:25.632773774 -0500
+@@ -8,7 +8,9 @@
+ #include <leveldb/env.h>
+ #include <leveldb/cache.h>
+ #include <leveldb/filter_policy.h>
+-#include <memenv/memenv.h>
++#ifndef LEVELDB_WITHOUT_MEMENV
++#include <memenv.h>
++#endif
+
+ #include <boost/filesystem.hpp>
+
+@@ -43,8 +45,12 @@
+ options = GetOptions(nCacheSize);
+ options.create_if_missing = true;
+ if (fMemory) {
++#ifndef LEVELDB_WITHOUT_MEMENV
+ penv = leveldb::NewMemEnv(leveldb::Env::Default());
+ options.env = penv;
++#else
++ throw std::runtime_error("CLevelDB(): compiled without memenv support");
++#endif
+ } else {
+ if (fWipe) {
+ printf("Wiping LevelDB in %s\n", path.string().c_str());
+diff -Naur primecoin-0.1.2-linux.orig/src/src/makefile.unix primecoin-0.1.2-linux/src/src/makefile.unix
+--- primecoin-0.1.2-linux.orig/src/src/makefile.unix 2013-08-05 08:37:21.000000000 -0400
++++ primecoin-0.1.2-linux/src/src/makefile.unix 2013-11-30 17:20:06.545854617 -0500
+@@ -111,8 +111,7 @@
+ # adds some defaults in front. Unfortunately, LDFLAGS=... $(LDFLAGS) does not work.
+ xLDFLAGS=$(LDHARDENING) $(LDFLAGS)
+
+-OBJS= \
+- leveldb/libleveldb.a \
++BASEOBJS := \
+ obj/alert.o \
+ obj/version.o \
+ obj/checkpoints.o \
+@@ -121,7 +120,6 @@
+ obj/crypter.o \
+ obj/key.o \
+ obj/db.o \
+- obj/init.o \
+ obj/keystore.o \
+ obj/main.o \
+ obj/net.o \
+@@ -141,25 +139,44 @@
+ obj/hash.o \
+ obj/bloom.o \
+ obj/noui.o \
+- obj/leveldb.o \
+ obj/txdb.o \
+ obj/prime.o \
+ obj/checkpointsync.o
+
++OBJS := \
++ obj/leveldb.o \
++ obj/init.o \
++ $(BASEOBJS)
++
++TESTOBJS := \
++ obj-test/leveldb.o \
++ $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) \
++ $(BASEOBJS)
++
+ all: primecoind
+
+ test check: test_primecoin FORCE
+ ./test_primecoin
+
++ifdef USE_SYSTEM_LEVELDB
++ LIBS += -lleveldb
++ TESTLIBS += -lmemenv
++else
+ #
+ # LevelDB support
+ #
+ MAKEOVERRIDES =
+-LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
++LIBS += $(CURDIR)/leveldb/libleveldb.a
++TESTLIBS += $(CURDIR)/leveldb/libmemenv.a
+ DEFS += $(addprefix -I,$(CURDIR)/leveldb/include)
+ DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
+ leveldb/libleveldb.a:
+- @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && cd ..
++ @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a && cd ..
++leveldb/libmemenv.a:
++ @echo "Building LevelDB memenv ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libmemenv.a && cd ..
++OBJS += leveldb/libleveldb.a
++TESTOBJS += leveldb/libmemenv.a
++endif
+
+ # auto-generated dependencies:
+ -include obj/*.P
+@@ -170,24 +187,22 @@
+ version.cpp: obj/build.h
+ DEFS += -DHAVE_BUILD_INFO
+
+-obj/%.o: %.cpp
+- $(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
++P_TO_D = \
+ @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
++ sed -e 's/\#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+ -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+ rm -f $(@:%.o=%.d)
+
+-primecoind: $(OBJS:obj/%=obj/%)
+- $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
++obj/%.o: %.cpp
++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
+
+-TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
++primecoind: $(OBJS)
++ $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
+
+ obj-test/%.o: test/%.cpp
+- $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
+- @cp $(@:%.o=%.d) $(@:%.o=%.P); \
+- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+- -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
+- rm -f $(@:%.o=%.d)
++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $<
++ $(P_TO_D)
+
+ test_primecoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
+ $(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ $(TESTLIBS) $(xLDFLAGS) $(LIBS)
diff --git a/net-p2p/primecoin-qt/metadata.xml b/net-p2p/primecoin-qt/metadata.xml
new file mode 100644
index 0000000..6365b7b
--- /dev/null
+++ b/net-p2p/primecoin-qt/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <use>
+ <flag name='qrcode'>Enable generation of QR Codes for receiving payments</flag>
+ </use>
+</pkgmetadata>
diff --git a/net-p2p/primecoin-qt/primecoin-qt-0.1.2.ebuild b/net-p2p/primecoin-qt/primecoin-qt-0.1.2.ebuild
new file mode 100644
index 0000000..98f30fd
--- /dev/null
+++ b/net-p2p/primecoin-qt/primecoin-qt-0.1.2.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+DB_VER="4.8"
+
+LANGS="af_ZA ar bg bs ca_ES ca cs cy da de el_GR en eo es_CL es et eu_ES fa_IR fa fi fr_CA fr gu_IN he hi_IN hr hu it ja la lt lv_LV nb nl pl pt_BR pt_PT ro_RO ru sk sr sv th_TH tr uk zh_CN zh_TW"
+
+inherit db-use eutils fdo-mime gnome2-utils kde4-functions qt4-r2
+
+MyPV="${PV/_/-}"
+MyPN="primecoin"
+MyP="${MyPN}-${MyPV}"
+
+DESCRIPTION="Cryptocurrency forked from Bitcoin which aims to be energy efficiency."
+HOMEPAGE="http://peercoin.net/"
+SRC_URI="mirror://sourceforge/${MyPN}/${MyP}-linux.tar.gz -> ${MyP}.tar.gz"
+
+LICENSE="MIT ISC GPL-3 LGPL-2.1 public-domain || ( CC-BY-SA-3.0 LGPL-2.1 )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="dbus ipv6 kde +qrcode upnp"
+
+RDEPEND="
+ >=dev-libs/boost-1.41.0[threads(+)]
+ dev-libs/openssl:0[-bindist]
+ qrcode? (
+ media-gfx/qrencode
+ )
+ upnp? (
+ net-libs/miniupnpc
+ )
+ sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
+ <=dev-libs/leveldb-1.12.0[-snappy]
+ dev-qt/qtgui:4
+ dbus? (
+ dev-qt/qtdbus:4
+ )
+"
+DEPEND="${RDEPEND}
+ >=app-shells/bash-4.1
+"
+
+DOCS="doc/README.md doc/release-notes.md"
+
+S="${WORKDIR}/${MyP}-linux/src"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${MyPN}-sys_leveldb.patch
+ rm -r src/leveldb
+
+ cd src || die
+
+ local filt= yeslang= nolang=
+
+ for lan in $LANGS; do
+ if [ ! -e qt/locale/bitcoin_$lan.ts ]; then
+ ewarn "Language '$lan' no longer supported. Ebuild needs update."
+ fi
+ done
+
+ for ts in $(ls qt/locale/*.ts)
+ do
+ x="${ts/*bitcoin_/}"
+ x="${x/.ts/}"
+ if ! use "linguas_$x"; then
+ nolang="$nolang $x"
+ rm "$ts"
+ filt="$filt\\|$x"
+ else
+ yeslang="$yeslang $x"
+ fi
+ done
+
+ filt="bitcoin_\\(${filt:2}\\)\\.\(qm\|ts\)"
+ sed "/${filt}/d" -i 'qt/bitcoin.qrc'
+ einfo "Languages -- Enabled:$yeslang -- Disabled:$nolang"
+}
+
+src_configure() {
+ OPTS=()
+
+ use dbus && OPTS+=("USE_DBUS=1")
+ if use upnp; then
+ OPTS+=("USE_UPNP=1")
+ else
+ OPTS+=("USE_UPNP=-")
+ fi
+
+ use qrcode && OPTS+=("USE_QRCODE=1")
+ use ipv6 || OPTS+=("USE_IPV6=-")
+
+ OPTS+=("USE_SYSTEM_LEVELDB=1")
+ OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
+ OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
+
+ if has_version '>=dev-libs/boost-1.52'; then
+ OPTS+=("LIBS+=-lboost_chrono\$\$BOOST_LIB_SUFFIX")
+ fi
+
+ #The primecoin codebase is mostly taken from bitcoin-qt
+ eqmake4 bitcoin-qt.pro "${OPTS[@]}"
+}
+
+#Tests are broken
+#src_test() {
+# cd src || die
+# emake -f makefile.unix "${OPTS[@]}" test_primecoin
+# ./test_primecoin || die 'Tests failed'
+#}
+
+src_install() {
+ qt4-r2_src_install
+
+ dobin ${PN}
+
+ insinto /usr/share/pixmaps
+ newins "share/pixmaps/primecoin.ico" "${PN}.ico"
+
+ make_desktop_entry "${PN} %u" "PPcoin-Qt" "/usr/share/pixmaps/${PN}.ico" "Qt;Network;P2P;Office;Finance;" "MimeType=x-scheme-handler/primecoin;\nTerminal=false"
+
+ newman contrib/debian/manpages/bitcoin-qt.1 ${PN}.1
+
+ if use kde; then
+ insinto /usr/share/kde4/services
+ newins contrib/debian/bitcoin-qt.protocol ${PN}.protocol
+ fi
+}
+
+update_caches() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+ buildsycoca
+}
+
+pkg_postinst() {
+ update_caches
+}
+
+pkg_postrm() {
+ update_caches
+}