aboutsummaryrefslogtreecommitdiffstats
path: root/lang/swi-pl/Makefile
blob: 96dc2e8d12a891016e80eda09492ff3b27fbfd9e (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
# Created by: Michael Butschky <butsch@computi.erols.com>
# $FreeBSD$

PORTNAME=   swi-pl
PORTVERSION=    7.6.2
CATEGORIES= lang
MASTER_SITES=   http://www.swi-prolog.org/download/stable/src/
DISTNAME=   swipl-${PORTVERSION}

MAINTAINER= johans@FreeBSD.org
COMMENT=    Edinburgh-style Prolog compiler

LICENSE=    BSD2CLAUSE

LIB_DEPENDS=    libgmp.so:math/gmp \
        libodbc.so:databases/unixODBC \
        libfontconfig.so:x11-fonts/fontconfig \
        libfreetype.so:print/freetype2

BROKEN_mips=        fails to link: libswipl.so: undefined reference to '__sync_sub_and_fetch_4'
BROKEN_mips64=      fails to link: libswipl.so: undefined reference to '__sync_sub_and_fetch_4'
BROKEN_powerpc64=   fails to compile: pce_principal.pl:155: Shared object "pl2xpce" not found, required by "swipl"

SWIPLDIR=   ${PORTNAME:C/-//}-${PORTVERSION}

NOPRECIOUSMAKEVARS= yes
USE_XORG=   ice sm x11 xext xft xinerama xpm xt 

USES=       libedit gmake jpeg libarchive pathfix pkgconfig \
        readline shebangfix ssl
MAKE_JOBS_UNSAFE=   yes
GNU_CONFIGURE=  yes
CONFIGURE_ENV=  ARCH=${ARCH}-${OPSYS:tl}
CONFIGURE_TARGET=   ${ARCH}-${OPSYS:tl}
CONFIGURE_ARGS= --with-world --without-jpl --enable-shared
MAKE_ARGS=  DISABLE_PKGS=jpl \
        ac_cv_lib_ossp_uuid_uuid_create=no \
        ac_cv_lib_uuid_uuid_create=no

SHEBANG_LANG=   swipl
swipl_OLD_CMD=  /usr/bin/swipl
swipl_CMD=  ${LOCALBASE}/bin/swipl
SHEBANG_FILES=  library/dialect/sicstus/swipl-lfr.pl \
        packages/http/examples/demo_inetd

PLIST_SUB=  DISTNAME=${SWIPLDIR} ARCH=${ARCH} OS=${OPSYS:tl} \
        VER=${PORTVERSION}

.include <bsd.port.pre.mk>

.if (${ARCH} == armv6 || ${ARCH} == armv7 || ${ARCH} == i386 || ${ARCH} == powerpc)
PLIST_SUB+= BITS=32
.else
PLIST_SUB+= BITS=64
.endif

.if (${ARCH} == amd64)
ARCH=       x86_64
.endif

post-configure:
.if ${ARCH} != i386
    @${REINPLACE_CMD} -e '/^CMFLAGS=/s/$$/ -fPIC/' \
        ${WRKSRC}/packages/Dialect.defs
.endif
    @{ ${ECHO} "#define HAVE_DLOPEN 1";  ${ECHO} "#define HAVE_DLADDR 1"; }\
        >> ${WRKSRC}/src/config.h

post-patch:
    @${REINPLACE_CMD} -e 's!^mandir=@mandir@!mandir=${MANPREFIX}/man!' \
        -e '/-o $$@ $$(PLOBJ)/s/$$/ $$(LIBS)/' \
        ${WRKSRC}/src/Makefile.in \
        ${WRKSRC}/packages/xpce/src/Makefile.in
    @${REINPLACE_CMD} -e '/EXAMPLEEXE/s/INSTALL_PROGRAM/INSTALL_SCRIPT/' \
        ${WRKSRC}/packages/http/Makefile.in \
        ${WRKSRC}/packages/pldoc/Makefile.in
    @${REINPLACE_CMD} -e 's/malloc\.h/stdlib.h/' \
        ${WRKSRC}/packages/cpp/SWI-cpp.h

post-install:
    @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/xpce-client \
        ${STAGEDIR}${PREFIX}/lib/${SWIPLDIR}/lib/${ARCH}-${OPSYS:tl}/pl2xpce.so

.include <bsd.port.post.mk>