aboutsummaryrefslogtreecommitdiff
path: root/lang/gauche/Makefile
blob: c74ebfed6a8365d8314ff829ff2cde7c400b3763 (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
PORTNAME=	gauche
PORTVERSION=	0.9.12
CATEGORIES=	lang scheme
MASTER_SITES=	https://github.com/shirok/Gauche/releases/download/release${PORTVERSION:S/./_/g}/
DISTNAME=	Gauche-${PORTVERSION}

MAINTAINER=	lassi+freebsd@lassi.io
COMMENT=	Scheme script interpreter with multibyte character handling
WWW=		https://practical-scheme.net/gauche/

LICENSE=	BSD3CLAUSE
LICENSE_FILE=	${WRKSRC}/COPYING

BROKEN_mips=	Fails to build: redefinition of GC_register_dynamic_libraries
BROKEN_mips64=	Fails to build: redefinition of GC_register_dynamic_libraries
BROKEN_riscv64=	Fails to build: ./include/private/gcconfig.h:709:5: The collector has not been ported to this machine/OS combination

USES=		compiler:c11 cpe gmake iconv makeinfo tar:tgz
GNU_CONFIGURE=	yes
CONFIGURE_ARGS=	--with-local=${LOCALBASE} ${ICONV_CONFIGURE_BASE:S/lib//}
USE_LDCONFIG=	yes
TEST_TARGET=	check
ABI_VERSION=	0.98

PLIST_SUB=	ABI_VERSION="${ABI_VERSION}" \
		VERSION="${PORTVERSION}" \
		TARGET="${CONFIGURE_TARGET}"

# avoids a problem with ccache's pre-processor optimization
MAKE_ENV+=	CCACHE_CPP2=1
TEST_ENV=	# must be empty, otherwise cf-check-lib test fails

INFO=		gauche-refe gauche-refj

OPTIONS_DEFINE=		GDBM THREADS SLIB MANPAGES
OPTIONS_RADIO=		MULTIBYTE TLS
OPTIONS_RADIO_MULTIBYTE=	EUCJP SJIS UTF8
OPTIONS_RADIO_TLS=	AXTLS MBEDTLS
OPTIONS_DEFAULT=	MBEDTLS THREADS UTF8 MANPAGES
OPTIONS_SUB=		yes
NO_OPTIONS_SORT=	yes

AXTLS_DESC=		Cameron Rich's axTLS implementation (bundled)
AXTLS_CONFIGURE_ON=	--with-tls=axtls
EUCJP_DESC=		EUC-JP encoding support
EUCJP_CONFIGURE_ON=	--enable-multibyte=euc-jp
GDBM_LIB_DEPENDS=	libgdbm.so:databases/gdbm
GDBM_CONFIGURE_ON=	--with-dbm=gdbm,ndbm
GDBM_CONFIGURE_OFF=	--with-dbm=ndbm
MBEDTLS_RUN_DEPENDS=	${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss
MBEDTLS_LIB_DEPENDS=	libmbedtls.so:security/mbedtls
MBEDTLS_CONFIGURE_ON=	--with-tls=mbedtls --with-ca-bundle=${LOCALBASE}/share/certs/ca-root-nss.crt
SLIB_DESC=		Create catalogue for SLIB port
# Gauche's slib module to use Aubrey Jaffer's SLIB
SLIB_BUILD_DEPENDS=	${LOCALBASE}/share/slib/require.scm:lang/slib
SLIB_CONFIGURE_ON=	--with-slib=${LOCALBASE}/share/slib
SLIB_CONFIGURE_OFF=	--with-slib=${WRKDIR}
SJIS_DESC=		Shift_JIS encoding support
SJIS_CONFIGURE_ON=	--enable-multibyte=sjis
THREADS_CONFIGURE_ON=	--enable-threads=pthreads
THREADS_CONFIGURE_OFF=	--enable-threads=no
UTF8_CONFIGURE_ON=	--enable-multibyte=utf-8

.include <bsd.port.options.mk>

.if !${PORT_OPTIONS:MEUCJP} && !${PORT_OPTIONS:MSJIS} && !${PORT_OPTIONS:MUTF8}
CONFIGURE_ARGS+=	--enable-multibyte=none
.endif

.if !${PORT_OPTIONS:MAXTLS} && !${PORT_OPTIONS:MMBEDTLS}
CONFIGURE_ARGS+=	--with-tls=none
.endif

post-patch:
# required for sparc64, no-op elsewhere
	@${REINPLACE_CMD} -e \
		'/^VPATH = /s,$$,/src,' ${WRKSRC}/gc/Makefile.in
# unbreak "make test" by using the same workaround as for OSX (darwin),
# apparently because we both use clang (XXX: what about gcc?)
	@${REINPLACE_CMD} -e \
		's,darwin,&|${OPSYS:tl},' ${WRKSRC}/test/scripts.scm

post-install:
	@${TOUCH} ${STAGEDIR}${PREFIX}/lib/gauche-${ABI_VERSION}/site/${CONFIGURE_TARGET}/.keepme
	@${MKDIR} ${STAGEDIR}${DATADIR}/${PORTVERSION}/lib/.packages
	@${TOUCH} ${STAGEDIR}${DATADIR}/${PORTVERSION}/lib/.packages/.keepme
	@${MKDIR} ${STAGEDIR}${DATADIR}/site/lib/.packages
	@${TOUCH} ${STAGEDIR}${DATADIR}/site/lib/.packages/.keepme
	@${MKDIR} ${STAGEDIR}${PREFIX}/share/gauche-${ABI_VERSION}/site/lib/.packages
	@${TOUCH} ${STAGEDIR}${PREFIX}/share/gauche-${ABI_VERSION}/site/lib/.packages/.keepme
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
	@${TOUCH} ${STAGEDIR}${DOCSDIR}/.keepme
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
	@${TOUCH} ${STAGEDIR}${EXAMPLESDIR}/.keepme
.for i in gauche-config gosh
	@${CHMOD} u+w ${STAGEDIR}${PREFIX}/bin/${i}
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${i}
	@${CHMOD} u-w ${STAGEDIR}${PREFIX}/bin/${i}
.endfor
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libgauche-${ABI_VERSION}.so.[0-9].*
.for i in gauche-config gosh *.so
	@${CHMOD} u+w ${STAGEDIR}${PREFIX}/lib/gauche-${ABI_VERSION}/${PORTVERSION}/${CONFIGURE_TARGET}/${i}
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/gauche-${ABI_VERSION}/${PORTVERSION}/${CONFIGURE_TARGET}/${i}
	@${CHMOD} u-w ${STAGEDIR}${PREFIX}/lib/gauche-${ABI_VERSION}/${PORTVERSION}/${CONFIGURE_TARGET}/${i}
.endfor

.include <bsd.port.mk>