summaryrefslogtreecommitdiff
path: root/finance/bitcoin/Makefile
blob: 7fc96bb5d13531a54d261546e6d04ea63de4b269 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# $NetBSD: Makefile,v 1.6 2018/11/12 03:52:02 ryoon Exp $

DISTNAME=	bitcoin-0.16.1
PKGREVISION=	4
CATEGORIES=	finance
MASTER_SITES=	${MASTER_SITE_GITHUB:=bitcoin/}
GITHUB_TAG=	v${PKGVERSION_NOREV}

MAINTAINER=	khorben@defora.org
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"