summaryrefslogtreecommitdiff
path: root/x11/ocaml-graphics/Makefile
blob: d5b6af2decebe8f029ce9844fd1f2eeb7bf24101 (plain)
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
# $NetBSD: Makefile,v 1.36 2018/07/04 13:40:44 jperkin Exp $

.include "../../lang/ocaml/Makefile.common"
DISTINFO_FILE= ${PKGDIR}/../../lang/ocaml/distinfo
PATCHDIR= ${PKGDIR}/../../lang/ocaml/patches

PKGNAME=		${DISTNAME:S/ocaml/ocaml-graphics/}
PKGREVISION=	11

COMMENT+=		(graphics library)

CONFIGURE_ARGS+=	-x11include ${X11BASE}/include
CONFIGURE_ARGS+=	-x11lib ${X11BASE}/lib

BUILD_DIRS=		otherlibs/graph
BUILD_TARGET=		all
INSTALL_TARGET=		install

.include "../../mk/ocaml.mk"

.if ${OCAML_USE_OPT_COMPILER} == "yes"
BUILD_TARGET+=		allopt
INSTALL_TARGET+=	installopt
.endif

PLIST_VARS+=		natdynlib
.if (${MACHINE_ARCH} == "i386") || (${MACHINE_ARCH} == "x86_64")
.  if !empty(MACHINE_PLATFORM:MLinux-*-*) || \
      !empty(MACHINE_PLATFORM:MDarwin-*-*) || \
      !empty(MACHINE_PLATFORM:MFreeBSD-*-*) || \
      !empty(MACHINE_PLATFORM:MDragonFly-*-*) || \
      !empty(MACHINE_PLATFORM:MNetBSD-*-*)
PLIST.natdynlib=		yes
.  endif
.endif

PLIST_SRC=	${WRKDIR}/.PLIST_SRC

.if ${OPSYS} == "Darwin"
PLIST_SRC+=	${PKGDIR}/PLIST.stub
.endif

BUILDLINK_DEPMETHOD.ocaml=	full

SUBST_CLASSES+=		depend
SUBST_STAGE.depend=	pre-configure
SUBST_FILES.depend=	otherlibs/graph/.depend
SUBST_SED.depend=	-e 's,/usr/X11R6,${X11BASE},g'
SUBST_MESSAGE.depend=	Fixing .depend in otherlibs/graph.

SUBST_CLASSES+=		mklib
SUBST_STAGE.mklib=	pre-configure
SUBST_FILES.mklib=	otherlibs/Makefile.shared
SUBST_SED.mklib=	-e 's,^MKLIB=.*,MKLIB=ocamlmklib,g'
SUBST_MESSAGE.mklib=	Fixing MKLIB in otherlibs/Makefile.shared.

SUBST_CLASSES+=		comp
SUBST_STAGE.comp=	pre-configure
SUBST_FILES.comp=	otherlibs/Makefile
SUBST_SED.comp=		-e 's,^CAMLC=.*,CAMLC=ocamlc,g'
SUBST_SED.comp+=	-e '/^CAMLOPT=/{;N;s,^CAMLOPT=.*,CAMLOPT=ocamlopt,g;}'
SUBST_SED.comp+=	-e 's,^MKLIB=.*,MKLIB=ocamlmklib,g'
SUBST_MESSAGE.comp=	Fixing CAMLC OCAMLOPT MKLIB in otherlibs/Makefile.

SUBST_CLASSES+=		comp2
SUBST_STAGE.comp2=	pre-configure
SUBST_FILES.comp2=	otherlibs/graph/Makefile
SUBST_SED.comp2=	-e 's,..CAMLRUN..*ocamldep,ocamldep,g'
SUBST_MESSAGE.comp2=	Fixing ocamldep in otherlibs/graph/Makefile.

INSTALLATION_DIRS+=	lib/ocaml/stublibs

post-build:
	${CP} ${PKGDIR}/PLIST ${WRKDIR}/.PLIST_SRC

.include "../../x11/libX11/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"