aboutsummaryrefslogtreecommitdiffstats
path: root/devel/hs-tclhaskell-ghc/Makefile
blob: 76e0ef3ab1a2f24c401e96236a3904e5e7885d92 (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:    tclhaskell-ghc
# Date created:             2003-03-05
# Whom:                 Volker Stolz <stolz@i2.informatik.rwth-aachen.de>
#
# $FreeBSD$

PORTNAME=   tclhaskell
PORTVERSION=    1.2
PORTREVISION=   4
CATEGORIES= devel haskell tcl83
MASTER_SITES=   http://www.dcs.gla.ac.uk/~meurig/TclHaskell/
PKGNAMEPREFIX=  hs-
PKGNAMESUFFIX=  -${GHCDEP}
DISTNAME=   TclHaskell1_2

MAINTAINER= haskell@FreeBSD.org
COMMENT=    Tcl/Tk binding for Haskell

LIB_DEPENDS=    tk83.1:${PORTSDIR}/x11-toolkits/tk83
BUILD_DEPENDS=  ${GHC}:${PORTSDIR}/lang/${GHCDEP}
RUN_DEPENDS=    ${GHC}:${PORTSDIR}/lang/${GHCDEP}

.if defined(WITH_GHC5)
GHC=        ghc-5.04.3
GHCDEP=     ghc5
.else
GHC=        ghc-6.4.2
GHCDEP=     ghc
.endif

SUB_FILES=  pkg-install
SUB_LIST=   GHC_VERSION="${GHC_VERSION}"
WRKSRC=     ${WRKDIR}/TclHaskell1.2/src
USE_GMAKE=  YES

GHC_VERSION=    ${GHC:S/^ghc-//} # `${LOCALBASE}/bin/${GHC} --numeric-version`
GHC_LIB=    ${LOCALBASE}/lib/${GHC}
PLIST_SUB+= GHC_VERSION="${GHC_VERSION}"
PKGINSTALL= ${WRKDIR}/pkg-install
MAKE_ENV+=  INSTALL_DATA="${INSTALL_DATA}" \
        MKDIR="${MKDIR}" GHC="${GHC}"
MAKE_ARGS+= CC="${CC}" GHC="${GHC}" CC_OPTS="${CFLAGS}" \
        CC_INC="-I${X11BASE}/include -I${LOCALBASE}/include -I${LOCALBASE}/include/tcl8.3 -I${LOCALBASE}/include/tk8.3" \
        CCLIB="-L${X11BASE}/lib/X11 -L${LOCALBASE}/lib" \
        IMPORTS="${GHC_LIB}/imports/tclhaskell" TCLLIBS="-ltk83 -ltcl83" \
        TCL_REQ="-ltk83 -ltcl83" PREFIX="${GHC_LIB}"

pre-everything::
    @${ECHO}
    @${ECHO} "This port prefers lang/ghc6. To build this port with"
    @${ECHO} "the Glasgow Haskell Compiler 5.x, restart this build with"
    @${ECHO} "WITH_GHC5=YES."
    @${ECHO}

post-install:
    @${MKDIR} ${EXAMPLESDIR}/images
.for f in licence.txt demo
    ${FIND} ${WRKSRC}/../${f} -maxdepth 1 -type f -exec ${INSTALL_DATA} \{\} ${EXAMPLESDIR}/ \;
.endfor
    ${INSTALL_DATA} ${WRKSRC}/../demo/images/* ${EXAMPLESDIR}/images/
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
    @${INSTALL_DATA} ${WRKSRC}/../doc/* ${DOCSDIR}/
.endif
    PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} dummy POST-INSTALL

.include <bsd.port.mk>