aboutsummaryrefslogtreecommitdiffstats
path: root/math/libjbigi/Makefile
blob: e3424995c6dbc7627c5b33ed480342e2d7d828d5 (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
# New ports collection makefile for:    i2p jbigi JNI
# Date created:     Fri Dec 23 12:02:32 UTC 2005
# Whom:                 Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   libjbigi
PORTVERSION=    0.7.2
PORTREVISION=   1
CATEGORIES= math java
MASTER_SITES=   http://mirror.i2p2.de/ \
        ${MASTER_SITE_GOOGLE_CODE}
DISTNAME=   i2psource_${PORTVERSION}

MAINTAINER= lioux@FreeBSD.org
COMMENT=    i2p JNI to GNU MP Bignum library (libgmp)

BUILD_DEPENDS=  ${LOCALBASE}/lib/libgmp.a:${PORTSDIR}/math/libgmp4

USE_BZIP2=  yes
USE_JAVA=   yes
JAVA_BUILD= jdk
JAVA_VERSION=   1.5+
JAVA_OS=    native
PROJECTHOST=    i2p

WRKSRC=     ${WRKDIR}/i2p-${PORTVERSION}/core/c

PLIST_FILES=    %%JAVAJARDIR%%/jbigi.jar

JBIGI_BUILD_ENV=    \
            CC="${CC}" \
            CFLAGS="${CFLAGS} -fPIC -DPIC" \
            LDFLAGS="${LDFLAGS} -static" \
            JAVA_HOME="${JAVA_HOME}" \
            LOCALBASE="${LOCALBASE}"
JBIGI_LIBS= \
        libjbigi-freebsd-none.so

do-install:
    @${INSTALL_DATA} ${WRKSRC}/jbigi.jar \
        ${JAVAJARDIR}

.include <bsd.port.pre.mk>

.if ${ARCH} == "amd64"
BROKEN= doesn't build: relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
.endif

.if ${ARCH} == "i386"
JBIGI_BUILD_JCPUID= yes
.endif

.if ${ARCH} == "i386" || ${ARCH} == "amd64"
JBIGI_LIBS+=    libjbigi-freebsd-x86.so
.endif

do-build:
## build JNI
.ifdef(JBIGI_BUILD_JCPUID)
# jcpuid
    cd ${BUILD_WRKSRC}/jcpuid && \
        ${ENV} ${JBIGI_BUILD_ENV} \
            ${SH} ./build.sh
.endif
# jbigi
    cd ${BUILD_WRKSRC}/jbigi && \
        ${ENV} ${JBIGI_BUILD_ENV} \
            ${SH} ./build_jbigi.sh static
## prepare jar
.ifdef(JBIGI_BUILD_JCPUID)
# jcpuid
    @${MKDIR} ${WRKSRC}/t/freenet/support/CPUInformation/
    @${CP} ${WRKSRC}/jcpuid/lib/freenet/support/CPUInformation/*jcpuid* \
        ${WRKSRC}/t/freenet/support/CPUInformation/
.endif
# jbigi
    @${MKDIR} ${WRKSRC}/t/net/i2p/util
.for lib in ${JBIGI_LIBS}
    @${CP} ${WRKSRC}/jbigi/libjbigi.so \
        ${WRKSRC}/t/net/i2p/util/${lib}
.endfor
    @cd ${WRKSRC}/t && ${JAR} cf ../jbigi.jar .

.include <bsd.port.post.mk>