aboutsummaryrefslogtreecommitdiffstats
path: root/lang/pure/bsd.pure.mk
blob: be2f154fb1866cde2d2a263dd078b4c17f0c321b (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
# ex:ts=8
#
# $FreeBSD$
#
# bsd.pure.mk - Support for the Pure language packages
#
# Author: Zhihao Yuan <lichray@gmail.com>
#
# USE_PURE      -   Set it to 'yes' to use libpure.so.
#                   Others are regarded as a list of *RUN_DEPENDS*
#                   to pure-* addons. For example,
# USE_PURE= ffi     makes the port depends on pure-ffi at runtime.
# USE_PURE_BUILD    -   Set it to 'yes' to change the addons in USE_PURE
#                       list to *BUILD_DEPENDS*.
# NO_PURE_EXAMPLES  -   Don't automatically install examples/.

.if !defined(PURE_include)

PURE_MAINTAINER=lichray@gmail.com
PURE_include=   bsd.pure.mk

MASTER_SITES?=  http://pure-lang.googlecode.com/files/
DIST_SUBDIR=    pure

USE_GMAKE=  yes

_PURE_audio_cat=    audio
_PURE_csv_cat=      textproc
_PURE_ffi_cat=      devel
_PURE_gen_cat=      devel
_PURE_gen_util=     pure-gen
_PURE_gl_cat=       graphics
_PURE_gl_fn=        GL
_PURE_gtk_cat=      x11-toolkits
_PURE_mpfr_cat=     math
_PURE_readline_cat= devel
_PURE_sockets_cat=  net
_PURE_sql3_cat=     databases
_PURE_tk_cat=       x11-toolkits
_PURE_xml_cat=      textproc

.ifdef _PURE_${PORTNAME}_cat
CATEGORIES=     _PURE_${PORTNAME}_cat
.endif

.if ${PORTNAME} != pure

.if ${USE_PURE} == yes
LIB_DEPENDS+=   pure.8:${PORTSDIR}/lang/pure
.else
. for dep in ${USE_PURE}
_PURE_LIBDIR=   ${LOCALBASE}/lib/pure
_PURE_PORTDIR=  ${PORTSDIR}/${_PURE_${dep}_cat}/pure-${dep}
.  ifdef _PURE_${dep}_cat
.   ifdef _PURE_${dep}_util
BUILD_DEPENDS+= ${_PURE_${dep}_util}:${_PURE_PORTDIR}
.   else
.    ifdef USE_PURE_BUILD
.     ifdef _PURE_${dep}_fn
BUILD_DEPENDS+= ${_PURE_LIBDIR}/${_PURE_${dep}_fn}.pure:${_PURE_PORTDIR}
.     else
BUILD_DEPENDS+= ${_PURE_LIBDIR}/${dep}.pure:${_PURE_PORTDIR}
.     endif
.    endif
.     ifdef _PURE_${dep}_fn
RUN_DEPENDS+=   ${_PURE_LIBDIR}/${_PURE_${dep}_fn}.pure:${_PURE_PORTDIR}
.     else
RUN_DEPENDS+=   ${_PURE_LIBDIR}/${dep}.pure:${_PURE_PORTDIR}
.     endif
.   endif
.  else
.   error pure-${dep} is not supported by "bsd.pure.mk"
.  endif
. endfor
.endif

.endif # PORTNAME != pure

MAKE_ARGS+= prefix=${PREFIX} mandir=${PREFIX}/man \
        CC=${CC} CFLAGS="${CFLAGS}" \
        CXX=${CXX} CXXFLAGS="${CXXFLAGS}" \
        CPPFLAGS+=-I${LOCALBASE}/include \
        LDFLAGS+=-L${LOCALBASE}/lib

.if ${PORTNAME:Mpure-*} !="" && !defined(NO_PURE_EXAMPLES)
PORTEXAMPLES=   *

post-install:
.if !defined(NOPORTEXAMPLES)
    @${MKDIR} ${EXAMPLESDIR}
    (cd ${WRKSRC}/examples/ && ${COPYTREE_SHARE} \* ${EXAMPLESDIR})
.endif

.endif

.endif #!defined(PURE_include)