aboutsummaryrefslogtreecommitdiffstats
path: root/x11-toolkits/ocaml-lablgtk2/Makefile
blob: 405e00da3498e5d704da6962062347c0669445cd (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Created by: Rene Ladan
# $FreeBSD$

PORTNAME=   lablgtk2
PORTVERSION=    2.16.0
CATEGORIES= x11-toolkits
MASTER_SITES=   http://forge.ocamlcore.org/frs/download.php/979/ \
        LOCAL/bf
PKGNAMEPREFIX=  ocaml-
DISTNAME=   lablgtk-${PORTVERSION}

MAINTAINER= bf@FreeBSD.org
COMMENT=    An Objective Caml interface to GTK+ 2.x

LICENSE=    LGPL21

USE_GMAKE=  yes
USE_GNOME=  gtk20
USE_OCAML=  yes
USE_OCAML_FINDLIB=  yes
USE_OCAMLFIND_PLIST=    yes
USE_OCAML_LDCONFIG= yes
USE_OCAML_WASH=     yes

OPTIONS_DEFINE =    GLADE GNOMECANVAS GNOMEUI GTKGLAREA GTKSOURCEVIEW2 GTKSPELL \
            LIBRSVG2
OPTIONS_DEFAULT =   ${OPTIONS_DEFINE}

GNOMECANVAS_DESC=   GnomeCanvas support
GNOMEUI_DESC=       GNOME 2 UI support
GTKGLAREA_DESC=     GtkGLArea support
GTKSOURCEVIEW2_DESC=    GtkSourceView 2 support
GTKSPELL_DESC=      GtkSpell support
#GNOMEPANEL_DESC=   GNOME Panel support

HAS_CONFIGURE=  yes
ALL_TARGET= all opt
MAKE_JOBS_UNSAFE=   yes

CONFIGURE_ARGS= --prefix=${PREFIX} --with-libdir=${PREFIX}/${OCAML_LIBDIR} \
        --without-gtksourceview
CONFIGURE_ENV=  CAMLP4O="camlp4 pa_o.cmo pa_op.cmo pr_dump.cmo"

PATTERN=    [[:space:]]*(do|then)?[[:space:]]*)cp([[:space:]]

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MDOCS}
DOCSDIR=    ${OCAML_DOCSDIR}/${PORTNAME}
PORTDOCS=   COPYING README
.endif

.if ${PORT_OPTIONS:MEXAMPLES}
EXAMPLESDIR=    ${OCAML_EXAMPLESDIR}/${PORTNAME}
PORTEXAMPLES=   *
.endif

.if ${PORT_OPTIONS:MGTKGLAREA}
CONFIGURE_ARGS+=    --with-gl
BUILD_DEPENDS+= lablgl:${PORTSDIR}/graphics/ocaml-lablgl
RUN_DEPENDS+=   lablgl:${PORTSDIR}/graphics/ocaml-lablgl
LIB_DEPENDS+=   gtkgl-2.0:${PORTSDIR}/x11-toolkits/gtkglarea2
EXAMPLES_SUBDIRS+=  GL
.else
CONFIGURE_ARGS+=    --without-gl
.endif

.if ${PORT_OPTIONS:MGLADE}
CONFIGURE_ARGS+=    --with-glade
USE_GNOME+= libglade2
PLIST_SUB+= GLADE=""
EXAMPLES_SUBDIRS+=  glade
.else
CONFIGURE_ARGS+=    --without-glade
PLIST_SUB+= GLADE="@comment "
.endif

.if ${PORT_OPTIONS:MGNOMEUI}
CONFIGURE_ARGS+=    --with-gnomeui
USE_GNOME+= libgnomeui
.else
CONFIGURE_ARGS+=    --without-gnomeui
.endif

.if ${PORT_OPTIONS:MGNOMECANVAS}
CONFIGURE_ARGS+=    --with-gnomecanvas
USE_GNOME+= libgnomecanvas
EXAMPLES_SUBDIRS+=  canvas
.else
CONFIGURE_ARGS+=    --without-gnomecanvas
.endif

.if ${PORT_OPTIONS:MLIBRSVG2}
CONFIGURE_ARGS+=    --with-rsvg
USE_GNOME+= librsvg2
EXAMPLES_SUBDIRS+=  rsvg
.else
CONFIGURE_ARGS+=    --without-rsvg
.endif

#.if ${PORT_OPTIONS:MGNOMEPANEL}
#CONFIGURE_ARGS+=   --with-panel
#USE_GNOME+=    gnomepanel
#EXAMPLES_SUBDIRS+= panel
#.else
CONFIGURE_ARGS+=    --without-panel
#.endif

.if ${PORT_OPTIONS:MGTKSOURCEVIEW2}
CONFIGURE_ARGS+=    --with-gtksourceview2
USE_GNOME+= gtksourceview2
EXAMPLES_SUBDIRS+=  sourceview
.else
CONFIGURE_ARGS+=    --without-gtksourceview2
.endif

.if ${PORT_OPTIONS:MGTKSPELL}
LIB_DEPENDS+=   gtkspell:${PORTSDIR}/textproc/gtkspell
CONFIGURE_ARGS+=    --with-gtkspell
.else
CONFIGURE_ARGS+=    --without-gtkspell
.endif

post-patch:
    @${REINPLACE_CMD} -E \
        -e 's|^(CFLAGS[[:space:]]*\+=[[:space:]]*-O)|\1 ${CFLAGS}|' \
        -e 's,^(${PATTERN}+.*INSTALLDIR),\1\$${BSD_INSTALL_DATA} \3,' \
        -e 's,^(${PATTERN}+.*BINDIR),\1\$${BSD_INSTALL_SCRIPT} \3,' \
        -e 's,^(${PATTERN}+.*LIBDIR),\1\$${BSD_INSTALL_DATA} \3,' \
        ${WRKSRC}/src/Makefile

post-install:
.if ${PORT_OPTIONS:MDOCS}
    @${MKDIR} ${DOCSDIR}
    @cd ${WRKSRC} ; ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
.endif
.if ${PORT_OPTIONS:MEXAMPLES}
    @${MKDIR} ${EXAMPLESDIR}
    @cd ${WRKSRC}/examples ; ${COPYTREE_SHARE} \
    "*.ml *.png *.rgb *.xpm text ${EXAMPLES_SUBDIRS}" ${EXAMPLESDIR}
.endif

.include <bsd.port.mk>