diff options
author | khorben <khorben@pkgsrc.org> | 2018-07-08 11:13:45 +0000 |
---|---|---|
committer | khorben <khorben@pkgsrc.org> | 2018-07-08 11:13:45 +0000 |
commit | 832a81dba2deb1ab3c3b9bcc31131ca72440cc49 (patch) | |
tree | 53fcf8feddc645e204ce7916b391b7756164fea9 /finance | |
parent | d73436d7784dcdace0b432a186ce831ff076995d (diff) | |
download | pkgsrc-832a81dba2deb1ab3c3b9bcc31131ca72440cc49.tar.gz |
Import bitcoin 0.16.1 as finance/bitcoin
Bitcoin is a decentralized P2P electronic cash system without a central
server or trusted parties. Users hold the crypto keys to their own money
and transact directly with each other, with the help of the network to
check for double-spending.
Diffstat (limited to 'finance')
-rw-r--r-- | finance/bitcoin/DESCR | 4 | ||||
-rw-r--r-- | finance/bitcoin/Makefile | 73 | ||||
-rw-r--r-- | finance/bitcoin/PLIST | 23 | ||||
-rw-r--r-- | finance/bitcoin/distinfo | 9 | ||||
-rw-r--r-- | finance/bitcoin/files/bitcoind.sh | 27 | ||||
-rw-r--r-- | finance/bitcoin/options.mk | 36 | ||||
-rw-r--r-- | finance/bitcoin/patches/patch-src_leveldb_port_port__posix.h | 19 | ||||
-rw-r--r-- | finance/bitcoin/patches/patch-src_netbase.cpp | 17 | ||||
-rw-r--r-- | finance/bitcoin/patches/patch-src_secp256k1_configure.ac | 15 |
9 files changed, 223 insertions, 0 deletions
diff --git a/finance/bitcoin/DESCR b/finance/bitcoin/DESCR new file mode 100644 index 00000000000..5678f626be4 --- /dev/null +++ b/finance/bitcoin/DESCR @@ -0,0 +1,4 @@ +Bitcoin is a decentralized P2P electronic cash system without a central +server or trusted parties. Users hold the crypto keys to their own money +and transact directly with each other, with the help of the network to +check for double-spending. diff --git a/finance/bitcoin/Makefile b/finance/bitcoin/Makefile new file mode 100644 index 00000000000..8f6b6d8c748 --- /dev/null +++ b/finance/bitcoin/Makefile @@ -0,0 +1,73 @@ +# $NetBSD: Makefile,v 1.1 2018/07/08 11:13:45 khorben Exp $ + +DISTNAME= bitcoin-0.16.1 +CATEGORIES= finance +MASTER_SITES= ${MASTER_SITE_GITHUB:=bitcoin/} +GITHUB_TAG= v${PKGVERSION_NOREV} + +MAINTAINER= noud4@users.sourceforge.net +HOMEPAGE= https://github.com/bitcoin/bitcoin/ +COMMENT= P2P electronic cash system +LICENSE= mit + +USE_LIBTOOL= yes +USE_TOOLS+= gmake pkg-config autoconf aclocal autoheader automake +AUTO_MKDIRS= yes +GNU_CONFIGURE= yes + +USE_LANGUAGES= c c++ +# bitcoin-core requires c++11 (but does not need manual --std=c++11). + +# TODO: File bug upstream - configure should add this where it is +# needed. Without -fPIC, linking of test_bitcoin fails. +CFLAGS+= -fPIC + +# configure does not look in PREFIX for boost unless instructed. +CONFIGURE_ARGS+= --with-boost=${BUILDLINK_PREFIX.boost-libs} + +CONFIGURE_ARGS+= --enable-hardening + +# pkgsrc's db4 package installs as db4_, but bitcoin looks for db_. +BUILDLINK_TRANSFORM+= l:db_cxx:db4_cxx + +TEST_TARGET= check + +PLIST_VARS+= qt + +RCD_SCRIPTS= bitcoind +BUILD_DEFS+= VARBASE +OWN_DIRS= ${VARBASE}/bitcoin +EGDIR= ${PREFIX}/share/examples/bitcoin +CONF_FILES= ${EGDIR}/bitcoin.conf ${PKG_SYSCONFDIR}/bitcoin.conf +CONF_FILES_PERMS= ${EGDIR}/bitcoin.conf ${PKG_SYSCONFDIR}/bitcoin.conf ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0644 + +# This is currently unnecessary, but it seems likely we will find a +# file that references /usr when ${PREFIX} is appropriate. +SUBST_CLASSES+= pkg +SUBST_STAGE.pkg= post-patch +SUBST_SED.pkg= -e "s|/usr/|${PREFIX}/|g" +SUBST_MESSAGE.pkg= Fixing /usr references to ${PREFIX}. + +# bitcoin does not actually have releases; only snapshots of the +# repository from which a release would have been made. Remedially +# create configure.in and similar. +pre-configure: + cd ${WRKSRC} && ./autogen.sh + +# TODO: Decide if secp256k1 and univalue are supposed to be installed, +# and if so where, or if they should be linked with privately. +INSTALL_DIRS= ${BUILD_DIRS} src/secp256k1 src/univalue + +# Install the Debian example config file. +post-install: + ${INSTALL_DATA} -m 644 ${WRKSRC}/contrib/debian/examples/bitcoin.conf ${DESTDIR}${EGDIR} + +.include "options.mk" + +.include "../../sysutils/desktop-file-utils/desktopdb.mk" +.include "../../databases/db4/buildlink3.mk" +.include "../../devel/boost-libs/buildlink3.mk" +.include "../../devel/libevent/buildlink3.mk" +.include "../../security/openssl/buildlink3.mk" +.include "../../mk/dlopen.buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/finance/bitcoin/PLIST b/finance/bitcoin/PLIST new file mode 100644 index 00000000000..b67e8a9f324 --- /dev/null +++ b/finance/bitcoin/PLIST @@ -0,0 +1,23 @@ +@comment $NetBSD: PLIST,v 1.1 2018/07/08 11:13:45 khorben Exp $ +bin/bench_bitcoin +bin/bitcoin-cli +${PLIST.qt}bin/bitcoin-qt +bin/bitcoin-tx +bin/bitcoind +bin/test_bitcoin +${PLIST.qt}bin/test_bitcoin-qt +include/bitcoinconsensus.h +include/secp256k1.h +include/secp256k1_recovery.h +include/univalue.h +lib/libbitcoinconsensus.la +lib/libsecp256k1.la +lib/libunivalue.la +lib/pkgconfig/libbitcoinconsensus.pc +lib/pkgconfig/libsecp256k1.pc +lib/pkgconfig/libunivalue.pc +man/man1/bitcoin-cli.1 +${PLIST.qt}man/man1/bitcoin-qt.1 +man/man1/bitcoin-tx.1 +man/man1/bitcoind.1 +share/examples/bitcoin/bitcoin.conf diff --git a/finance/bitcoin/distinfo b/finance/bitcoin/distinfo new file mode 100644 index 00000000000..a81701bf062 --- /dev/null +++ b/finance/bitcoin/distinfo @@ -0,0 +1,9 @@ +$NetBSD: distinfo,v 1.1 2018/07/08 11:13:46 khorben Exp $ + +SHA1 (bitcoin-0.16.1.tar.gz) = 3454dd16befc04bbd624aece219206728982b9bf +RMD160 (bitcoin-0.16.1.tar.gz) = 70710030badc9287870c26a6436c7a108dfab1cc +SHA512 (bitcoin-0.16.1.tar.gz) = d7b7bd376aa743b9f17a1f3299e4c2f924263e7b8231475cc6b6ecf7a551cb639ffdc1f20820e2030f5d8268a099e4a465cbc3512c281005daaa30ec4e1e326b +Size (bitcoin-0.16.1.tar.gz) = 6655512 bytes +SHA1 (patch-src_leveldb_port_port__posix.h) = 6a3cde12951b9801e8ffe19b6134ca48ad0d876c +SHA1 (patch-src_netbase.cpp) = c1357ce9437fab87651df9fd4ca12dd24c59830c +SHA1 (patch-src_secp256k1_configure.ac) = 688e13e1da110bf15557434f19507f43290be8ef diff --git a/finance/bitcoin/files/bitcoind.sh b/finance/bitcoin/files/bitcoind.sh new file mode 100644 index 00000000000..708234ac97c --- /dev/null +++ b/finance/bitcoin/files/bitcoind.sh @@ -0,0 +1,27 @@ +#!@RCD_SCRIPTS_SHELL@ +# +# $NetBSD: bitcoind.sh,v 1.1 2018/07/08 11:13:46 khorben Exp $ +# + +# PROVIDE: bitcoind +# REQUIRE: DAEMON LOGIN wscons +# KEYWORD: shutdown + +if [ -f /etc/rc.subr ]; then + . /etc/rc.subr +fi + +name="bitcoind" +rcvar=$name +command="@PREFIX@/bin/bitcoind" +pidfile="@VARBASE@/run/bitcoind.pid" +required_directory="@VARBASE@/bitcoin" +command_args="-daemon -conf=@PREFIX@/etc/bitcoin.conf -pid=${pidfile} -datadir=${required_directory}" + +if [ -f /etc/rc.subr ]; then + load_rc_config $name + run_rc_command "$1" +else + echo -n " ${name}" + ${command} ${bitcoin_flags} ${command_args} +fi diff --git a/finance/bitcoin/options.mk b/finance/bitcoin/options.mk new file mode 100644 index 00000000000..5c49d914e2a --- /dev/null +++ b/finance/bitcoin/options.mk @@ -0,0 +1,36 @@ +# $NetBSD: options.mk,v 1.1 2018/07/08 11:13:46 khorben Exp $ + +PKG_OPTIONS_VAR= PKG_OPTIONS.bitcoin +PKG_SUPPORTED_OPTIONS+= qt4 qt5 miniupnpc +# qt4 is off because it doubles the footprint of the package. +# Please do not enable it by default; instead, create a split +# package. +PKG_SUGGESTED_OPTIONS+= + +.include "../../mk/bsd.options.mk" + +.if !empty(PKG_OPTIONS:Mqt4) +PLIST.qt= yes + +.include "../../converters/qrencode/buildlink3.mk" +.include "../../devel/protobuf/buildlink3.mk" +BUILDLINK_DEPMETHOD.qt4-tools= full +.include "../../x11/qt4-tools/buildlink3.mk" +.include "../../x11/qt4-libs/buildlink3.mk" + +CONFIGURE_ARGS+= --with-qt-bindir=${QTDIR}/bin +.endif + +.if !empty(PKG_OPTIONS:Mqt5) +PLIST.qt= yes + +.include "../../converters/qrencode/buildlink3.mk" +.include "../../devel/protobuf/buildlink3.mk" +.include "../../x11/qt5-qttools/buildlink3.mk" + +CONFIGURE_ARGS+= --with-qt-bindir=${QTDIR}/bin +.endif + +.if !empty(PKG_OPTIONS:Mminiupnpc) +.include "../../net/miniupnpc/buildlink3.mk" +.endif diff --git a/finance/bitcoin/patches/patch-src_leveldb_port_port__posix.h b/finance/bitcoin/patches/patch-src_leveldb_port_port__posix.h new file mode 100644 index 00000000000..fb5105289fa --- /dev/null +++ b/finance/bitcoin/patches/patch-src_leveldb_port_port__posix.h @@ -0,0 +1,19 @@ +$NetBSD: patch-src_leveldb_port_port__posix.h,v 1.1 2018/07/08 11:13:46 khorben Exp $ + +Accomodate NetBSD's BYTE_ORDER macros. Not known to be filed upstream. + +--- src/leveldb/port/port_posix.h.orig 2015-07-10 17:23:55.000000000 +0000 ++++ src/leveldb/port/port_posix.h +@@ -47,8 +47,12 @@ + #include "port/atomic_pointer.h" + + #ifndef PLATFORM_IS_LITTLE_ENDIAN ++#if defined(OS_NETBSD) ++#define PLATFORM_IS_LITTLE_ENDIAN (BYTE_ORDER == LITTLE_ENDIAN) ++#else + #define PLATFORM_IS_LITTLE_ENDIAN (__BYTE_ORDER == __LITTLE_ENDIAN) + #endif ++#endif + + #if defined(OS_MACOSX) || defined(OS_SOLARIS) || defined(OS_FREEBSD) ||\ + defined(OS_NETBSD) || defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD) ||\ diff --git a/finance/bitcoin/patches/patch-src_netbase.cpp b/finance/bitcoin/patches/patch-src_netbase.cpp new file mode 100644 index 00000000000..778e6e4dcff --- /dev/null +++ b/finance/bitcoin/patches/patch-src_netbase.cpp @@ -0,0 +1,17 @@ +$NetBSD: patch-src_netbase.cpp,v 1.1 2018/07/08 11:13:46 khorben Exp $ + +It is unclear why this patch exists. NetBSD 6 and 7 have AI_ADDRCONFIG, +although NetBSD 5 does not. Arguably upstream should have an autoconf +test instead. This is not known to be reported upstream. + +--- src/netbase.cpp.orig 2017-04-20 09:28:25.000000000 +0000 ++++ src/netbase.cpp +@@ -95,7 +95,7 @@ bool static LookupIntern(const char *psz + aiHint.ai_socktype = SOCK_STREAM; + aiHint.ai_protocol = IPPROTO_TCP; + aiHint.ai_family = AF_UNSPEC; +-#ifdef WIN32 ++#ifndef AI_ADDRCONFIG + aiHint.ai_flags = fAllowLookup ? 0 : AI_NUMERICHOST; + #else + aiHint.ai_flags = fAllowLookup ? AI_ADDRCONFIG : AI_NUMERICHOST; diff --git a/finance/bitcoin/patches/patch-src_secp256k1_configure.ac b/finance/bitcoin/patches/patch-src_secp256k1_configure.ac new file mode 100644 index 00000000000..1b7752f5670 --- /dev/null +++ b/finance/bitcoin/patches/patch-src_secp256k1_configure.ac @@ -0,0 +1,15 @@ +$NetBSD: patch-src_secp256k1_configure.ac,v 1.1 2018/07/08 11:13:46 khorben Exp $ + +Portability fix for the configure script generated. + +--- src/secp256k1/configure.ac.orig 2017-04-20 09:28:25.000000000 +0000 ++++ src/secp256k1/configure.ac +@@ -466,7 +466,7 @@ AM_CONDITIONAL([USE_BENCHMARK], [test x" + AM_CONDITIONAL([USE_ECMULT_STATIC_PRECOMPUTATION], [test x"$set_precomp" = x"yes"]) + AM_CONDITIONAL([ENABLE_MODULE_ECDH], [test x"$enable_module_ecdh" = x"yes"]) + AM_CONDITIONAL([ENABLE_MODULE_RECOVERY], [test x"$enable_module_recovery" = x"yes"]) +-AM_CONDITIONAL([USE_JNI], [test x"$use_jni" == x"yes"]) ++AM_CONDITIONAL([USE_JNI], [test x"$use_jni" = x"yes"]) + AM_CONDITIONAL([USE_EXTERNAL_ASM], [test x"$use_external_asm" = x"yes"]) + AM_CONDITIONAL([USE_ASM_ARM], [test x"$set_asm" = x"arm"]) + |