aboutsummaryrefslogtreecommitdiff
path: root/x11-toolkits/ocaml-lablgtk2/Makefile
blob: 6a07a365a64764021ee9f80133ffffe1d8a8a8fd (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
# Created by: Rene Ladan <rene@FreeBSD.org>

PORTNAME=	lablgtk2
PORTVERSION=	2.18.11
PORTREVISION=	3
CATEGORIES=	x11-toolkits
PKGNAMEPREFIX=	ocaml-

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

LICENSE=	LGPL21
LICENSE_FILE=	${WRKSRC}/COPYING

USES=		gmake gnome pkgconfig
USE_GNOME=	cairo gdkpixbuf2 gtk20
USE_OCAML=	yes
USE_OCAML_FINDLIB=	yes
USE_OCAML_CAMLP4=	yes
USE_OCAML_LDCONFIG=	yes
USE_OCAML_WASH=		yes

HAS_CONFIGURE=	yes
ALL_TARGET=	all opt
MAKE_JOBS_UNSAFE=	yes

USE_GITHUB=	yes
GH_ACCOUNT=	garrigue
GH_PROJECT=	lablgtk

PORTSCOUT=	limit:^${PORTVERSION:R:R}

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

DOCSDIR=	${OCAML_DOCSDIR}/${PORTNAME}
PORTDOCS=	COPYING README
EXAMPLESDIR=	${OCAML_EXAMPLESDIR}/${PORTNAME}
PORTEXAMPLES=	*

OPTIONS_DEFINE=	DOCS EXAMPLES GTKGLAREA GTKSOURCEVIEW2 GTKSPELL LIBRSVG2
OPTIONS_DEFAULT=	GTKGLAREA GTKSOURCEVIEW2 GTKSPELL LIBRSVG2
OPTIONS_SUB=	yes

GTKGLAREA_DESC=	GtkGLArea support
GTKSOURCEVIEW2_DESC=	GtkSourceView 2 support
GTKSPELL_DESC=	GtkSpell support

GTKGLAREA_BUILD_DEPENDS=lablgl:graphics/ocaml-lablgl
GTKGLAREA_LIB_DEPENDS=	libgtkgl-2.0.so:x11-toolkits/gtkglarea2
GTKGLAREA_RUN_DEPENDS=	lablgl:graphics/ocaml-lablgl
GTKGLAREA_CONFIGURE_WITH=gl
GTKGLAREA_VARS=		EXAMPLES_SUBDIRS+=GL

GTKSOURCEVIEW2_CONFIGURE_WITH=gtksourceview2
GTKSOURCEVIEW2_USE=	GNOME=gtksourceview2
GTKSOURCEVIEW2_VARS=	EXAMPLES_SUBDIRS+=sourceview

GTKSPELL_LIB_DEPENDS=	libgtkspell.so:textproc/gtkspell
GTKSPELL_CONFIGURE_WITH=gtkspell

LIBRSVG2_CONFIGURE_WITH=rsvg
LIBRSVG2_USE=		GNOME=librsvg2
LIBRSVG2_VARS=		EXAMPLES_SUBDIRS+=rsvg

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

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,' \
		-e 's,(touch)( "\$$\(DESTDIR\)\$$\(OCAMLLDCONF\)"),${TRUE}\2,' \
		-e 's,(-ldconf )("\$$\(DESTDIR\)\$$\(OCAMLLDCONF\)"),\1ignore,' \
		${WRKSRC}/src/Makefile

post-install-DOCS-on:
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}

post-install-EXAMPLES-on:
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
	@cd ${WRKSRC}/examples && ${COPYTREE_SHARE} \
	"*.ml *.png *.rgb *.xpm text ${EXAMPLES_SUBDIRS}" \
		${STAGEDIR}${EXAMPLESDIR}

.include <bsd.port.mk>