aboutsummaryrefslogtreecommitdiffstats
path: root/net-p2p/litecoin/Makefile
blob: 58926acebdbf4318da9583896891668afff6595e (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
95
96
97
98
99
100
101
# Created by: Steve Wills <swills@FreeBSD.org>
# $FreeBSD$

PORTNAME=   litecoin
PORTVERSION=    0.6.3c
CATEGORIES= net-p2p finance

MAINTAINER= swills@FreeBSD.org
COMMENT=    Virtual Peer-to-Peer Currency Software

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

USE_GITHUB= yes
GH_ACCOUNT= litecoin-project
GH_COMMIT=  8ad55e4
GH_TAGNAME= v${PORTVERSION}

USE_OPENSSL=    yes
USE_BDB=    yes
WANT_BDB_VER=   48

USE_GMAKE=  yes

OPTIONS_DEFINE= GUI UPNP QRCODES DBUS
OPTIONS_DEFAULT=    GUI QRCODES

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

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

.include <bsd.port.options.mk>

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

.if ${PORT_OPTIONS:MGUI} && !defined(WITHOUT_X11)
USE_QT4=    qmake_build linguist uic moc rcc
BINARY=     litecoin-qt
.else
BINARY=     litecoind
MAKEFILE=   makefile.unix
ALL_TARGET= ${BINARY}
MAKE_ARGS+= -C ${WRKSRC}/src USE_UPNP=${QMAKE_USE_UPNP}
.endif

PLIST_FILES=    bin/${BINARY}

.if ${PORT_OPTIONS:MGUI} && !defined(WITHOUT_X11) && ${PORT_OPTIONS:MQRCODES}
LIB_DEPENDS+=   qrencode:${PORTSDIR}/graphics/libqrencode
QMAKE_USE_QRCODE=1
.else
QMAKE_USE_QRCODE=0
.endif

.if ${PORT_OPTIONS:MDBUS}
USE_QT4+=   dbus
QMAKE_USE_DBUS= 1
.else
QMAKE_USE_DBUS= 0
.endif

.include <bsd.port.pre.mk>

do-configure:
.if ${PORT_OPTIONS:MGUI} && !defined(WITHOUT_X11)
    cd ${BUILD_WRKSRC} && \
        ${QMAKE} PREFIX=${PREFIX} -spec ${QMAKESPEC} ${QMAKEFLAGS} \
        QMAKE_LIBDIR+=${BDB_LIB_DIR} \
        QMAKE_LRELEASE=${LOCALBASE}/bin/lrelease-qt4 \
        USE_UPNP=${QMAKE_USE_UPNP} \
        USE_QRCODE=${QMAKE_USE_QRCODE} \
        USE_DBUS=${QMAKE_USE_DBUS} \
        litecoin-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

post-patch:
    @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' ${WRKSRC}/src/makefile.unix

regression-test:
.if !${PORT_OPTIONS:MGUI} || defined(WITHOUT_X11)
    @${GMAKE} -C ${WRKSRC}/src -f makefile.unix USE_UPNP=${QMAKE_USE_UPNP} test_litecoin
    (cd ${WRKSRC}/src ; ./test_litecoin)
.endif

.include <bsd.port.post.mk>