aboutsummaryrefslogtreecommitdiffstats
path: root/math/p5-Math-Pari/Makefile
blob: 511f71f5553952e716c991419316cd8817041c45 (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
# Created by: Michael Haro <mharo@FreeBSD.org>
# $FreeBSD$

PORTNAME=   Math-Pari
PORTVERSION=    2.01080900
CATEGORIES= math perl5
MASTER_SITES=   CPAN  \
        http://pari.math.u-bordeaux.fr/pub/pari/unix/OLD/:pari \
        http://mirrors.rit.edu/zi/:pari
PKGNAMEPREFIX=  p5-
DISTFILES=  ${DISTNAME}.zip \
        pari-2.3.5.tar.gz:pari

MAINTAINER= perl@FreeBSD.org
COMMENT=    PARI - numerical/scientific/number-theoretic calculations

LIB_DEPENDS=    libgmp.so:math/gmp

USES=       perl5
USE_PERL5=  configure

PARI_WRKSRC=    ${WRKDIR}/pari-2.3.5

CFLAGS+=    -I${PARI_WRKSRC}/src/headers -I${PARI_WRKSRC}/build

CONFIGURE_ARGS= parilib="-L${PARI_WRKSRC}/build -lpari" \
        paridir=${PARI_WRKSRC}
MAKE_ARGS=  LDLOADLIBS="-lm -L${PARI_WRKSRC}/build -Wl,-rpath=${SITE_ARCH}/auto/Math/Pari -lpari"

post-patch:
    @${REINPLACE_CMD} -e 's|2001007|2003000|' ${WRKSRC}/Makefile.PL
    @${REINPLACE_CMD} -E '/^list=/s/(ld|ranlib|perl|emacs)//g' \
        ${PARI_WRKSRC}/Configure
    @${REINPLACE_CMD} -e '/^CFLAGS=/s/\$$cflags//' \
        ${PARI_WRKSRC}/config/get_cc

pre-configure:
    cd ${PARI_WRKSRC} && ${SETENV} CC="${CC}" CPP="${CPP}" CXX="${CXX}" \
        CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" CXXFLAGS="${CXXFLAGS}" \
        LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \
        INSTALL="/usr/bin/install -c" \
        INSTALL_DATA="${INSTALL_DATA}" \
        INSTALL_LIB="${INSTALL_LIB}" \
        INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
        INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
        ld="${LD}" perl="${PERL}" ranlib="${RANLIB}" \
        ./Configure --mandir=${MANPREFIX}/man/man1 \
        --prefix=${PREFIX} \
        --share-prefix=${PREFIX}/share \
        --with-gmp=${LOCALBASE}

pre-build:
    cd ${PARI_WRKSRC} && ${DO_MAKE_BUILD:N-j*} gp
    cd ${PARI_WRKSRC} && ln -s $$(dirname $$(readlink gp)) build

post-install:
    ${INSTALL_LIB} ${PARI_WRKSRC}/build/libpari-gmp.so.2.3.5 ${STAGEDIR}${SITE_ARCH}/auto/Math/Pari
    ${LN} -s libpari-gmp.so.2.3.5 ${STAGEDIR}${SITE_ARCH}/auto/Math/Pari/libpari-gmp.so.2

post-clean:
    @${MAKE_CMD} -C ${PORTSDIR}/math/pari -DBATCH clean

.include <bsd.port.mk>