aboutsummaryrefslogtreecommitdiffstats
path: root/lang/moscow_ml/Makefile
blob: 1912f26e65ead344b073147e076f9c75e30bc064 (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
# New ports collection makefile for:    moscow-ml
# Date created:         2 August 1998
# Whom:                 chuckr
#
# $FreeBSD$
#

PORTNAME=   moscow_ml
PORTVERSION=    2.01
CATEGORIES= lang
MASTER_SITES=   http://www.dina.kvl.dk/~sestoft/mosml/
DISTNAME=   mos201src

MAINTAINER= ports@FreeBSD.org
COMMENT=    Moscow ML, a lightweight implementation of Standard ML

LIB_DEPENDS=    gmp.6:${PORTSDIR}/math/libgmp4

RESTRICTED= Restrictions on for-profit distribution.

INSTALLS_SHLIB= yes
LDCONFIG_DIRS=  %%PREFIX%%/lib/mosml

ALL_TARGET= world MOSMLHOME=$(MOSMLHOME)
INSTALL_TARGET= install MOSMLHOME=$(MOSMLHOME)
WRKSRC=     ${WRKDIR}/mosml/src
USE_PERL5=  yes
USE_REINPLACE=  yes
MAKE_ENV+=  LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib" DOCSDIR="${DOCSDIR}"

PKGMESSAGE= ${WRKDIR}/pkgmessage

post-patch:
    ${FIND} ${WRKSRC} -name Makefile | ${XARGS} \
        ${REINPLACE_CMD} -e "s,-O2,${CFLAGS} -I${LOCALBASE}/include,"
    ${FIND} ${WRKDIR}/mosml/examples -name Makefile -o \
        -name Makefile.stub | ${XARGS} ${REINPLACE_CMD} \
        -e "s,^MOSMLHOME=.*,,"
    ${FIND} ${WRKDIR}/mosml/examples -name Makefile -o \
        -name Makefile.stub | ${XARGS} ${REINPLACE_CMD} -e \
        "s,^MOSMLTOOLS=.*,MOSMLTOOLS=camlrunm ${PREFIX}/libexec/mosml,"
    ${MKDIR} ${WRKDIR}/mosml/examples/ffi
    ${LN} -s ${WRKSRC}/dynlibs/crypt ${WRKDIR}/mosml/examples/ffi
    ${LN} -s ${WRKSRC}/dynlibs/interface ${WRKDIR}/mosml/examples/ffi
    ${REINPLACE_CMD} -e "s,/usr/local,${PREFIX}," \
        ${WRKSRC}/dynlibs/crypt/Makefile \
        ${WRKSRC}/dynlibs/interface/Makefile

post-install:
    ${INSTALL_DATA} ${WRKDIR}/mosml/copyrght/copyrght.att ${DOCSDIR}
    ${INSTALL_DATA} ${WRKDIR}/mosml/copyrght/copyrght.cl ${DOCSDIR}
    ${INSTALL_DATA} ${WRKDIR}/mosml/copyrght/gpl2 ${DOCSDIR}
    ${INSTALL_DATA} ${WRKDIR}/mosml/README ${DOCSDIR}
    ${SED} -e "s,%%PREFIX%%,${PREFIX},g" < ${FILESDIR}/README.FreeBSD \
        > ${PKGMESSAGE}
    ${INSTALL_DATA} ${PKGMESSAGE} ${DOCSDIR}/README.FreeBSD
    ${CHOWN} -R ${SHAREOWN}:${SHAREGRP} "${DOCSDIR}"
    ${MKDIR} ${EXAMPLESDIR}
    ${INSTALL_DATA} ${WRKDIR}/mosml/tools/Makefile.stub ${EXAMPLESDIR}
    cd ${WRKDIR}/mosml/examples && \
    ${TAR} -cf - --dereference \
       --exclude=\*.orig --exclude=\*.bak --exclude=\*.w32 * | \
       ${TAR} -xf - -C "${EXAMPLESDIR}"
    ${CHOWN} -R ${SHAREOWN}:${SHAREGRP} "${EXAMPLESDIR}"
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>