aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cduce/Makefile
blob: 72f580e7067bf88c4dd4069baa8f280b4c5b9ae8 (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
# New ports collection makefile for:   cduce
# Date created:        Jun 9, 2005
# Whom:                Marwan Burelle <marwan.burelle@lri.fr>
#
# $FreeBSD$

PORTNAME=   cduce
PORTVERSION=    0.3.2
CATEGORIES= lang
MASTER_SITES=   http://www.cduce.org/download/

MAINTAINER= marwan.burelle@lri.fr
COMMENT=    An efficient XML centric functionnal programming language

LIB_DEPENDS=    pcre:${PORTSDIR}/devel/pcre-utf8
BUILD_DEPENDS=  ocamlc:${PORTSDIR}/lang/ocaml \
        ocamlfind:${PORTSDIR}/devel/ocaml-findlib \
        ${LOCALBASE}/lib/ocaml/site-lib/ulex/ulexing.a:${PORTSDIR}/devel/ocaml-ulex \
        ${LOCALBASE}/lib/ocaml/site-lib/pcre/pcre.a:${PORTSDIR}/devel/ocaml-pcre \
        ${LOCALBASE}/lib/ocaml/site-lib/netstring/netstring.a:${PORTSDIR}/www/ocaml-net

# Support for url via ftp/ocaml-ocurl
.if !defined(WITHOUT_OCURL)
BUILD_DEPENDS+= ${LOCALBASE}/lib/ocaml/site-lib/curl/curl.cmi:${PORTSDIR}/ftp/ocaml-ocurl
.endif

# Support for the PXP XML parser
.if defined(WITH_OCAML_EXPAT)
BUILD_DEPENDS+=${LOCALBASE}/lib/ocaml/site-lib/expat/expat.cmi:${PORTSDIR}/textproc/ocaml-expat
.else
BUILD_DEPENDS+=${LOCALBASE}/lib/ocaml/site-lib/pxp-engine/pxp_engine.cma:${PORTSDIR}/textproc/ocaml-pxp
.endif

# Configure : use ocamlopt and don't look for netclient or pxp_wlex
HAS_CONFIGURE=  yes
CONFIGURE_ARGS= --prefix=${PREFIX} --with-ocamlopt --without-netclient --without-pxp_wlex

# Be sure to not build ocurl support if WITHOUT_OCURL is defined,
# even if ocurl is present.
.if defined(WITHOUT_OCURL)
CONFIGURE_ARGS+=    --without-curl
.endif

# Be sure to build with PXP or expat but not both.
.if defined(WITH_OCAML_EXPAT)
CONFIGURE_ARGS+=    --with-expat --without-pxp
.else
CONFIGURE_ARGS+=    --without-expat --with-pxp
.endif

# Support for OCaml/CDuce interface
.if !defined(WITHOUT_MLIFACE)
CONFIGURE_ARGS+=    --mliface=${LOCALBASE}/lib/ocaml/compiler-lib
.endif

USE_GMAKE=  yes

ALL_TARGET= all

INSTALL_TARGET= install

MAKE_ENV=   OCAMLFIND_DESTDIR="${PREFIX}/lib/ocaml/site-lib"

.if !defined(NOPORTDOCS)
CONFIGURE_ARGS+=    --docdir=${PREFIX}/share/doc/${PORTNAME}
ALL_TARGET+=        doc
INSTALL_TARGET+=    install_doc
PORTDOCS=       *
.endif

MAN1=       cduce.1 cdo2ml.1 cduce_mktop.1

PKGDEINSTALL=   ${PKGINSTALL}
FINDLIB_PKGNAME=${PORTNAME}

PLIST_FILES=    bin/cduce

.if !defined(WITHOUT_MLIFACE)
PLIST_FILES+=   bin/cdo2ml bin/mlcduce_wrapper bin/cduce_mktop
.endif

post-install:
    @${FIND} ${PREFIX}/lib/ocaml/site-lib/${FINDLIB_PKGNAME} -type f | \
        ${SED} "s,^${PREFIX}/,," >> ${TMPPLIST}
    @${ECHO_CMD} "@dirrm lib/ocaml/site-lib/${FINDLIB_PKGNAME}" >> ${TMPPLIST}
    @${ECHO_CMD} "@unexec ocamlfind remove ${FINDLIB_PKGNAME} 2>/dev/null || true" >> ${TMPPLIST}
    @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.if defined(WITH_OCAML_EXPAT)
    @${ECHO_CMD} "****************************************************************"
    @${ECHO_CMD} "* You choose Expat as XML parser, you may encounter some error *"
    @${ECHO_CMD} "* when loading XML files with external DTD.                    *"
    @${ECHO_CMD} "****************************************************************"
.endif

pre-everything::
    @${ECHO} ""
    @${ECHO} "You may define the following build options:"
    @${ECHO} ""
    @${ECHO} "  WITHOUT_CURL        Disable url support via ftp/ocaml-ocurl (=> no url support)"
    @${ECHO} "  WITH_OCAML_EXPAT    Enable support for the Expat XML parser."
    @${ECHO} "  WITHOUT_MLIFACE     Disable building OCaml/CDuce interface."
    @${ECHO} ""

.include <bsd.port.mk>