freebsd-ports/graphics/ocaml-images/Makefile
John Marino 1c990c8f51 ocaml update 4/4: graphics/ocaml-images, update to version 4.0.1
Ocaml 4.00 can't build ocaml-images 3.0.1, so the solution is to update
the package to a newer version.  This arrived from dports, but it has
been heavily modified since then.  It has also been staged.  The
pkg-plist needs work because it doesn't support all the options if they
are turned off.  GTK2 has been left OFF by default since it pulls in
136 packages when enabled.

The Ocaml framework did not support staging at the time, so several
knobs were turned off, especially the "WASH" function which disrupted pkg
greatly.  The options were cleaned up in a modern way too.  An additional
patch was addded to make clang happy so this builds on FreeBSD 10 inside
poudriere.

Urged by: portmgr(bapt)
2014-03-26 17:54:08 +00:00

89 lines
2.4 KiB
Makefile

# Created by: ijliao
# $FreeBSD$
PORTNAME= images
PORTVERSION= 4.0.1
PORTEPOCH= 2
CATEGORIES= graphics
MASTER_SITES= https://bitbucket.org/camlspotter/camlimages/get/
PKGNAMEPREFIX= ocaml-
DISTNAME= v${PORTVERSION}
DIST_SUBDIR= ocaml-images
MAINTAINER= michael.grunewald@laposte.net
COMMENT= Objective Caml image processing library
BUILD_DEPENDS= ${LOCALBASE}/share/aclocal/ocaml.m4:${PORTSDIR}/lang/ocaml-autoconf
BUILD_DEPENDS+= omake:${PORTSDIR}/devel/omake
USE_OCAML= yes
USE_OCAML_FINDLIB= yes
OCAMLFIND_DESTDIR= ${STAGEDIR}${PREFIX}/${OCAML_SITELIBDIR}
OCAML_PKGDIRS= camlimages
OCAML_LDLIBS= ${OCAML_SITELIBDIR}/camlimages
OMAKESUBS+= -e s@%%INCLUDESPORTS%%@${LOCALBASE}/include@
OMAKESUBS+= -e s@%%INCLUDESX11%%@${LOCALBASE}/include/X11@
OMAKESUBS+= -e s@%%INCLUDESPNG%%@${LOCALBASE}/include/libpng15@
OMAKESUBS+= -e s@%%LDFLAGSPORTS%%@-L${LOCALBASE}/lib@
OMAKE= omake 'PREFIX=${STAGEDIR}${PREFIX}'
OMARGS= --dotomake .omake --force-dotomake
WRKSRC= ${WRKDIR}/camlspotter-camlimages-c803efa9d5d3
MAKE_JOBS_UNSAFE= yes
OPTIONS_DEFINE= PNG JPEG TIFF XPM GIF FREETYPE GHOSTSCRIPT GTK2 DOCS
OPTIONS_DEFAULT=PNG JPEG TIFF XPM GIF FREETYPE GHOSTSCRIPT
OPTIONS_SUB= yes
PNG_CONFIGURE_WITH= png
PNG_LIB_DEPENDS= libpng15.so:${PORTSDIR}/graphics/png
JPEG_CONFIGURE_WITH= jpeg
JPEG_LIB_DEPENDS= libjpeg.so:${PORTSDIR}/graphics/jpeg
TIFF_CONFIGURE_WITH= tiff
TIFF_LIB_DEPENDS= libtiff.so:${PORTSDIR}/graphics/tiff
XPM_CONFIGURE_WITH= xpm
GIF_CONFIGURE_WITH= gif
GIF_LIB_DEPENDS= libgif.so:${PORTSDIR}/graphics/giflib
FREETYPE_CONFIGURE_WITH=freetype
FREETYPE_LIB_DEPENDS= libttf.so:${PORTSDIR}/print/freetype
GHOSTSCRIPT_CONFIGURE_WITH= gs
GTK2_CONFIGURE_WITH= liblgtk2
GTK2_BUILD_DEPENDS= lablgtk2:${PORTSDIR}/x11-toolkits/ocaml-lablgtk2
GTK2_RUN_DEPENDS= lablgtk2:${PORTSDIR}/x11-toolkits/ocaml-lablgtk2
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MXPM}
USE_XORG= xpm
.endif
.if ${PORT_OPTIONS:MGHOSTSCRIPT}
USE_GHOSTSCRIPT= yes
.endif
do-configure:
@(cd ${WRKSRC} && ${REINPLACE_CMD} ${OMAKESUBS} OMakefile)
(cd ${WRKSRC} && ${OMAKE} ${OMARGS} configure)
do-build:
(cd ${WRKSRC} && ${OMAKE} ${OMARGS})
ocaml-findlib:
# Overriding ocaml-findlib target which does not support stage
# The consequence is that pkg-plist must be manually supported
do-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/${OCAML_LDLIBS}
(cd ${WRKSRC} && ${OMAKE} ${OMARGS} install)
.include <bsd.port.mk>