aboutsummaryrefslogtreecommitdiffstats
path: root/net-p2p/bitcoin/Makefile
blob: 30bde579c56884fed6aa2f702b78d3937acaeef9 (plain) (blame)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Created by: Shaun Amott <shaun@FreeBSD.org>
# $FreeBSD$

PORTNAME=   bitcoin
PORTVERSION=    0.8.3
CATEGORIES= net-p2p finance
MASTER_SITES=   ${MASTER_SITE_LOCAL} \
        http://people.freebsd.org/~swills/ \
        GH

MAINTAINER= robbak@robbak.com
COMMENT=    Virtual Peer-to-Peer Currency Client

LIB_DEPENDS=    boost_date_time:${PORTSDIR}/devel/boost-libs

OPTIONS_DEFINE= GUI UPNP QRCODES
OPTIONS_DEFAULT=    GUI QRCODES

GUI_DESC=   Build as a QT4 GUI
UPNP_DESC=  Build with UPNP support
QRCODES_DESC=   Build with QR code display

USE_GITHUB= yes
GH_ACCOUNT= bitcoin
GH_PROJECT= bitcoin
GH_COMMIT=  6a0ba5c
GH_TAGNAME= v${PORTVERSION}

USE_GMAKE=  yes
USE_OPENSSL=    yes
USE_BDB=    yes
WANT_BDB_VER=   48
MAKE_JOBS_SAFE= yes

CXXFLAGS+=  -I${LOCALBASE}/include -I${BDB_INCLUDE_DIR}
CXXFLAGS+=  -L${LOCALBASE}/lib -L${BDB_LIB_DIR}
CXXFLAGS+=  -Wno-invalid-offsetof

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MGUI} && !defined(WITHOUT_X11)
USE_QT4=    corelib gui qmake_build linguist uic moc rcc
BINARY=     bitcoin-qt
.else
BINARY=     bitcoind
ALL_TARGET= ${BINARY} test
MAKE_ARGS+= -C ${WRKSRC}/src
.endif

.if ${PORT_OPTIONS:MQRCODES}
LIB_DEPENDS+=   qrencode:${PORTSDIR}/graphics/libqrencode
QMAKE_USE_QRCODE=1
.else
QMAKE_USE_QRCODE=0
.endif

PLIST_FILES=    bin/${BINARY}

.if ${PORT_OPTIONS:MUPNP}
LIB_DEPENDS+=   miniupnpc:${PORTSDIR}/net/miniupnpc
QMAKE_USE_UPNP= 1
.else
QMAKE_USE_UPNP= -
.endif

.include <bsd.port.pre.mk>

post-patch:
.if !${PORT_OPTIONS:MGUI} || defined(WITHOUT_X11)
    @cd ${WRKSRC}/src && ${CP} -p makefile.unix Makefile
    @${REINPLACE_CMD} \
        -e 's|^USE_UPNP.*$$|USE_UPNP=${QMAKE_USE_UPNP}|' \
        -e 's|-l pthread|${PTHREAD_LIBS}|g' \
        -e 's:-l dl::' \
        ${WRKSRC}/src/Makefile
.endif

do-configure:
.if ${PORT_OPTIONS:MGUI} && !defined(WITHOUT_X11)
    cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} \
        ${QMAKE} USE_UPNP=${QMAKE_USE_UPNP} USE_QRCODE=${QMAKE_USE_QRCODE} \
        QMAKE_LRELEASE=lrelease-qt4 PREFIX=${PREFIX} INCLUDEPATH=${BDB_INCLUDE_DIR} \
        QMAKE_LIBDIR+=${BDB_LIB_DIR} bitcoin-qt.pro
.endif

do-install:
    @${MKDIR} ${PREFIX}/bin
.if ${PORT_OPTIONS:MGUI} && !defined(WITHOUT_X11)
    ${INSTALL_PROGRAM} ${WRKSRC}/${BINARY} ${PREFIX}/bin/
.else
    ${INSTALL_PROGRAM} ${WRKSRC}/src/${BINARY} ${PREFIX}/bin/
.endif

.include <bsd.port.post.mk>