summaryrefslogtreecommitdiff
path: root/lang/newlisp-devel/Makefile
blob: a2fcad8efbcdfe7ffd606699e36dce8de4e54015 (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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# Created by: Stanislav Sedov <ssedov@mbsd.msk.ru>
# $FreeBSD$

PORTNAME=	newlisp
PORTVERSION=	10.6.1
PORTREVISION=	2
CATEGORIES=	lang
MASTER_SITES=	http://www.newlisp.org/downloads/development/
PKGNAMESUFFIX=	-devel

MAINTAINER=	olgeni@FreeBSD.org
COMMENT=	LISP like scripting language

LICENSE=	GPLv3

BROKEN_mips=		fails to compile: unrecognized command line option "-m64"
BROKEN_mips64=		fails to compile: unrecognized command line option "-m64"

LIB_DEPENDS=	libffi.so:devel/libffi

CONFLICTS=	newlisp-[0-9]*

USES=		compiler:c11 readline tar:tgz

HAS_CONFIGURE=	yes
ALL_TARGET=	default

REINPLACE_ARGS=	-i ""

MODULES=	canvas cgi crypto ftp getopts infix odbc pop3 \
		postscript smtp smtpx stat unix xmlrpc-client zlib

DOCS=		CHANGES CodePatterns.html ExpressionEvaluation.html \
		MemoryManagement.html newLISP-${PORTVERSION}-Release.html \
		manual_frame.html newLISPdoc.html \
		newlisp_index.html newlisp_manual.html \

OPTIONS_DEFINE=	GMP GSL MYSQL PGSQL SQLITE GUISERV DOCS EXAMPLES
GSL_DESC=	GSL (GNU Scientific Library)
GUISERV_DESC=	Install GUI server (in Java)

.include <bsd.port.options.mk>

CFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib

.if ${ARCH} == "amd64" || ${ARCH} == "sparc64"
CFLAGS+=	-DNEWLISP64
.endif

.if ${PORT_OPTIONS:MGMP}
LIB_DEPENDS+=	libgmp.so:math/gmp
MODULES+=	gmp
PLIST_SUB+=	GMP=""
.else
PLIST_SUB+=	GMP="@comment "
.endif

.if ${PORT_OPTIONS:MGSL}
LIB_DEPENDS+=	libgsl.so:math/gsl
MODULES+=	gsl
PLIST_SUB+=	GSL=""
.else
PLIST_SUB+=	GSL="@comment "
.endif

.if ${PORT_OPTIONS:MMYSQL}
USE_MYSQL=	yes
MODULES+=	mysql
PLIST_SUB+=	MYSQL=""
.else
PLIST_SUB+=	MYSQL="@comment "
.endif

.if ${PORT_OPTIONS:MPGSQL}
USES+=		pgsql
MODULES+=	postgres
PLIST_SUB+=	PGSQL=""
.else
PLIST_SUB+=	PGSQL="@comment "
.endif

.if ${PORT_OPTIONS:MSQLITE}
USES+=		sqlite
MODULES+=	sqlite3
PLIST_SUB+=	SQLITE=""
.else
PLIST_SUB+=	SQLITE="@comment "
.endif

.if ${PORT_OPTIONS:MGUISERV}
PLIST_SUB+=	GUISERV=""
.else
PLIST_SUB+=	GUISERV="@comment "
.endif

post-patch:
	@${REINPLACE_CMD} -E -e "s,install -m 644, \$${BSD_INSTALL_DATA},g" \
		-e "s,install -m 755, \$${BSD_INSTALL_SCRIPT},g" \
		-e "s,^(datadir=).*,\1${STAGEDIR}${PREFIX}/share,g" \
		-e "s,^(bindir=).*,\1${STAGEDIR}${PREFIX}/bin,g" \
		${WRKSRC}/Makefile

	@${REINPLACE_CMD} -E \
		-e "s,/usr/(local/)?bin/newlisp,${PREFIX}/bin/newlisp,g" \
		-e "s,/usr/(local/)?share/newlisp,${DATADIR},g" \
		-e "s,/usr/(local/)?lib/newlisp.so,${PREFIX}/lib/newlisp.so,g"\
		-e "s,/usr/bin,${PREFIX}/bin,g" \
		-e "s,/usr/local/bin/vi,/usr/bin/vi,g" \
		${WRKSRC}/examples/* \
		${WRKSRC}/doc/* \
		${WRKSRC}/guiserver/*.lsp \
		${WRKSRC}/modules/* \
		${WRKSRC}/newlisp.c

	@${REINPLACE_CMD} -E -e \
		"s,/usr/local/mysql/lib/(libmysqlclient.)dylib,${LOCALBASE}/lib/mysql/\1so.${MYSQL${MYSQL_VER}_LIBVER}," \
		${WRKSRC}/modules/mysql.lsp
	@${REINPLACE_CMD} -E -e \
		"s,/usr/local/lib/(libsqlite)3.so,${LOCALBASE}/lib/\1${_SQLITE_VER}.so," \
		${WRKSRC}/modules/sqlite3.lsp
	@${REINPLACE_CMD} -E -e \
		"s,/usr/local/lib/libgmp.so,${LOCALBASE}/lib/libgmp.so," \
		${WRKSRC}/modules/gmp.lsp
	@${REINPLACE_CMD} -E -e \
		"s,/usr/local/lib/libgsl.so,${LOCALBASE}/lib/libgsl.so," \
		${WRKSRC}/modules/gsl.lsp
	@${REINPLACE_CMD} -E -e \
		"s,/usr/local/lib/libpq.so.5.1,${LOCALBASE}/lib/libpq.so.5," \
		${WRKSRC}/modules/postgres.lsp
	@${REINPLACE_CMD} -E -e \
		"s,/usr/share/newlisp,${LOCALBASE}/share/newlisp," \
		${WRKSRC}/newlisp.h

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/newlisp ${STAGEDIR}${PREFIX}/bin
	${INSTALL_SCRIPT} ${WRKSRC}/util/newlispdoc ${STAGEDIR}${PREFIX}/bin

	@${MKDIR} ${STAGEDIR}${DATADIR}/util
	${INSTALL_DATA} ${WRKSRC}/util/syntax.cgi \
			${WRKSRC}/util/README.txt \
			${WRKSRC}/util/newlisp.jsf \
			${WRKSRC}/util/newlisp.vim \
			${WRKSRC}/util/standard.lsp \
			${STAGEDIR}${DATADIR}/util

	@${MKDIR} ${STAGEDIR}${DATADIR}/modules
	${INSTALL_DATA} ${MODULES:S,^,${WRKSRC}/modules/,:S,$,.lsp,} \
		${STAGEDIR}${DATADIR}/modules

	${INSTALL_MAN} ${WRKSRC}/doc/newlisp.1 ${STAGEDIR}${PREFIX}/man/man1
	${INSTALL_MAN} ${WRKSRC}/doc/newlispdoc.1 ${STAGEDIR}${PREFIX}/man/man1

.if ${PORT_OPTIONS:MGUISERV}
	@${MKDIR} ${STAGEDIR}${DATADIR}/guiserver
	@(cd ${WRKSRC}/guiserver/ && ${COPYTREE_SHARE} \*.lsp \
		${STAGEDIR}${DATADIR}/guiserver/ \
		"! -name guiserver.lsp ! -name newlisp-edit.lsp")
	${INSTALL_DATA} ${WRKSRC}/guiserver/guiserver.jar ${STAGEDIR}${DATADIR}
	${INSTALL_DATA} ${WRKSRC}/guiserver/guiserver.lsp ${STAGEDIR}${DATADIR}
	${INSTALL_SCRIPT} ${WRKSRC}/guiserver/newlisp-edit.lsp \
		${STAGEDIR}${PREFIX}/bin/newlisp-edit
.endif

.if ${PORT_OPTIONS:MDOCS}
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${DOCS:S,^,${WRKSRC}/doc/,} ${STAGEDIR}${DOCSDIR}
.if ${PORT_OPTIONS:MGUISERV}
	@${MKDIR} ${STAGEDIR}${DOCSDIR}/guiserver
	${INSTALL_DATA} ${WRKSRC}/guiserver/index.html \
		${WRKSRC}/guiserver/guiserver.lsp.html \
		${STAGEDIR}${DOCSDIR}/guiserver
.endif
.endif

.if ${PORT_OPTIONS:MEXAMPLES}
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
	${INSTALL_DATA} ${WRKSRC}/examples/* ${STAGEDIR}${EXAMPLESDIR}
.endif

.include <bsd.port.mk>