aboutsummaryrefslogtreecommitdiffstats
path: root/math/maxima/Makefile
blob: 04e097f771ba3d6a1e87c085657773b854336515 (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Created by: Scott Flatman <sf@dsinw.com>
# $FreeBSD$

PORTNAME=   maxima
PORTVERSION=    5.30.0
PORTREVISION=   1
CATEGORIES= math lisp tk
MASTER_SITES=   SF/maxima/Maxima-source/${PORTVERSION}-source

MAINTAINER= bf@FreeBSD.org
COMMENT=    Symbolic mathematics program

LICENSE=    GPLv2

BUILD_DEPENDS=  ${LOCALBASE}/bin/${LISPPORT}
PATCH_DEPENDS=  ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash
RUN_DEPENDS=    ${LOCALBASE}/bin/${LISPPORT} \
        ${LOCALBASE}/bin/gnuplot:${PORTSDIR}/math/gnuplot \
        ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash

USE_TK =        84+
USE_GMAKE=      yes
USE_PERL5_BUILD=    yes
USE_PYTHON_BUILD=   yes
GNU_CONFIGURE=      yes
CONFIGURE_ARGS+=    --prefix=${PREFIX} \
            --with-posix-shell=${LOCALBASE}/bin/bash \
            --with-wish=${WISH} \
            ${LISPSELECT}

MAN1=   maxima.1
INFO=   maxima imaxima xmaxima

PLIST_SUB=  BINDIR=${BINDIRECTORY}
PLIST_SUB+= LISPBIN=${LISPBINARY}
PLIST_SUB+= MAXIMABIN=${MAXIMABINARY}
PLIST_SUB+= PORTVERSION=${PORTVERSION}

OPTIONS_SINGLE=     LISP
OPTIONS_SINGLE_LISP=    CLISP CMUCL GCL SBCL

OPTIONS_DEFAULT=    SBCL

CLISP_DESC= Build with Clisp
CMUCL_DESC= Build with CMU Common Lisp
GCL_DESC=   Build with GNU Common Lisp
SBCL_DESC=  Build with Steel Bank Common Lisp

.include <bsd.port.pre.mk>

# Lisp to build with. Define only ONE of these!
.if ${PORT_OPTIONS:MCLISP}
LISPSELECT= --enable-clisp
LISPPORT=   clisp:${PORTSDIR}/lang/clisp
BINDIRECTORY=   binary-clisp
LISPBINARY= lisp.run
PLIST_SUB+= LISPBINARY=""
MAXIMABINARY=   maxima.mem
.endif

.if ${PORT_OPTIONS:MCMUCL}
LISPSELECT= --enable-cmucl
LISPPORT=   lisp:${PORTSDIR}/lang/cmucl
BINDIRECTORY=   binary-cmucl
LISPBINARY= lisp
PLIST_SUB+= LISPBINARY=""
MAXIMABINARY=   maxima_core
STRIP=  #strip(1) chokes on LISPBINARY
.endif

.if ${PORT_OPTIONS:MGCL}
LISPSELECT= --enable-gcl
LISPPORT=   gcl:${PORTSDIR}/lang/gcl
BINDIRECTORY=   binary-gcl
#LISPBINARY is null so fudge this so deinstall works cleanly
PLIST_SUB+= LISPBINARY="@comment "
MAXIMABINARY=   maxima
.endif

.if ${PORT_OPTIONS:MSBCL}
.  if ${ARCH} == "i386"
DYNAMIC_SPACE_SIZE?=    512
.  else
DYNAMIC_SPACE_SIZE?=    1024
.  endif
.  if defined(DYNAMIC_SPACE_SIZE)
MAXIMA_LISP_OPTIONS+=   --dynamic-space-size ${DYNAMIC_SPACE_SIZE}
.  endif
.  if defined(MAXIMA_LISP_OPTIONS) && !empty(MAXIMA_LISP_OPTIONS)
LISPSELECT= --with-sbcl="sbcl ${MAXIMA_LISP_OPTIONS}"
.  else
LISPSELECT= --enable-sbcl
.  endif
LISPPORT=   sbcl:${PORTSDIR}/lang/sbcl
BINDIRECTORY=   binary-sbcl
#LISPBINARY is null so fudge this so deinstall works cleanly
PLIST_SUB+= LISPBINARY="@comment "
MAXIMABINARY=   maxima_core
.endif

post-patch:
    @${GREP} -Fe '.core' -l -r ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} \
    -e 's;\.core;_core;g'
    @${FIND} -X ${WRKSRC}/interfaces/xmaxima -name 'Makefile.in' | ${XARGS} \
    ${REINPLACE_CMD} -e "s;tclsh;${TCLSH};g"
    @${REINPLACE_CMD} -e "s;/usr;${LOCALBASE};g" ${WRKSRC}/src/intl.lisp
    @cd ${WRKSRC}/doc/info ; ${LOCALBASE}/bin/bash ./fix_crlf ; \
    ${LOCALBASE}/bin/bash ./fix_tab
    @${REINPLACE_CMD} -e 's;$$maxima_image_base;$${maxima_image_base};g' \
    ${WRKSRC}/src/maxima.in
.if defined(MAXIMA_LISP_OPTIONS) && !empty(MAXIMA_LISP_OPTIONS)
    @${REINPLACE_CMD} -e 's;"@SBCL_NAME@";@SBCL_NAME@;g' \
    ${WRKSRC}/src/maxima.in
    @${REINPLACE_CMD} -e 's;"$$(SBCL_NAME)";$$(SBCL_NAME);g' \
    ${WRKSRC}/src/Makefile.in
.endif

pre-build:
    @${FIND} ${WRKSRC} \( -name '*.bak' -o -name '*.fbsd10bak' -o \
    -name '*.orig' \) -delete

post-install:
    @${ECHO_MSG} ""
    @${CAT} ${PKGMESSAGE}
    @${ECHO_MSG} ""

check regression-test test: build
    @cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${_MAKE_JOBS} \
    ${MAKE_ARGS} check

.include <bsd.port.post.mk>