summaryrefslogtreecommitdiffstats
path: root/devel/nspr/Makefile
blob: c2c3a4452edb2e37eaeead55f5291c6cf3197869 (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
# Ports collection Makefile for:    nspr
# Date created:             18 December 2001
# Whom:                 Maxim Sobolev <sobomax@FreeBSD.org>
#
# $FreeBSD$
#    $MCom: ports/devel/nspr/Makefile,v 1.1 2007/07/05 13:49:54 ahze Exp $

PORTNAME=   nspr
DISTVERSION=    4.6.7-1
CATEGORIES= devel
MASTER_SITES=   LOCAL
MASTER_SITE_SUBDIR= ahze
#MASTER_SITES=  ${MASTER_SITE_MOZILLA}
#MASTER_SITE_SUBDIR=    nspr/releases/v${PORTVERSION}/src
DISTNAME=   ${PORTNAME}-4.6.6-1

MAINTAINER= gnome@FreeBSD.org
COMMENT=    A platform-neutral API for system level and libc like functions

WRKSRC=     ${WRKDIR}/${DISTNAME}/mozilla/nsprpub/build

USE_LDCONFIG=   yes
USE_GMAKE=  yes
GNU_CONFIGURE=  yes
CONFIGURE_SCRIPT=../configure
CONFIGURE_ARGS= --disable-debug \
        --with-pthreads
CONFIGURE_ENV=  BSD_PTHREAD_LIBS=${PTHREAD_LIBS}

MAKE_ENV=   DIST=${WRKSRC}/dist

LIBS=       libnspr4.so.1 libplc4.so.1 libplds4.so.1

.include <bsd.port.pre.mk>

post-patch:
    @${REINPLACE_CMD} -e 's,-lpthread,${PTHREAD_LIBS},g ; s,echo aout,echo elf,g' ${WRKSRC}/${CONFIGURE_SCRIPT}
.if ${OSVERSION} < 601104
    @${REINPLACE_CMD} -e 's|pthread_cond_wait|_pthread_cond_wait|g' \
            ${WRKSRC}/../pr/src/md/unix/pthreads_user.c \
        ${WRKSRC}/../pr/src/pthreads/ptsynch.c
.endif

do-install:
    ${MKDIR} ${PREFIX}/include/nspr
    ${TAR} -C ${WRKSRC}/dist/include --dereference -cf - . | \
        ${TAR} -C ${PREFIX}/include -xf -
    ${TAR} -C ${WRKSRC}/dist/lib --dereference -cf - . | \
        ${TAR} -C ${PREFIX}/lib -xf -
    ${INSTALL_SCRIPT} ${WRKSRC}/config/nspr-config ${PREFIX}/bin
    ${MKDIR} ${PREFIX}/libdata/pkgconfig
    ${INSTALL_DATA} ${WRKSRC}/config/nspr.pc ${PREFIX}/libdata/pkgconfig
.for lib in ${LIBS}
    ${LN} -sf ${lib} ${PREFIX}/lib/${lib:R}
.endfor

prtests:
    env PTHREAD_LIBS="${PTHREAD_LIBS}" ${GMAKE} -C ${WRKSRC}/pr/tests
    ${LN} -sf libmy.so.1 ${WRKSRC}/pr/tests/dll/libmy.so
    cd ${WRKSRC}/pr/tests && ../../../pr/tests/runtests.sh

libtests:
    ${GMAKE} -C ${WRKSRC}/lib/tests
    ${WRKSRC}/lib/tests/string
    ${WRKSRC}/lib/tests/base64t
    # The test below is commented out, because arena requires
    # command-line arguments. If you can provide reasonable values
    # for it, please contact ${MAINTAINER}. Thank you.
    #   ${WRKSRC}/lib/tests/arena
    #

test: libtests prtests

#.if defined(PARALLEL_PACKAGE_BUILD)
#post-build: test
#.else
post-build:
    #
    # Please, consider running ``make test'' to find any
    # possible build problems.
    #
#.endif

.include <bsd.port.post.mk>