Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Feb 2013 13:47:19 -0800
From:      Timothy Beyer <beyert@cs.ucr.edu>
To:        FreeBSD GNATS Submit <FreeBSD-gnats-submit@FreeBSD.org>
Cc:        Timothy Beyer <beyert@cs.ucr.edu>
Subject:   ports/176200: update port and fix build: graphics/ocaml-images
Message-ID:  <87vc9sgcd4.wl@fastmail.fm>
Resent-Message-ID: <201302162150.r1GLo0qq082601@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         176200
>Category:       ports
>Synopsis:       update port and fix build: graphics/ocaml-images
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 16 21:50:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Timothy Beyer
>Release:        FreeBSD 9.0-RELEASE-p3 i386
>Organization:
no organization
>Environment:
System: FreeBSD aeonserv.aeonnet 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #12: Mon Jul 23 14:37:57 PDT 2012     root@aeonserv.aeonnet:/usr/obj/usr/src/sys/CUSTOM  i386

>Description:

- Fix build of ocaml-images (tested to build advi program).

- Update to version 4.0.1, which is needed for newer versions of Active DVI

>How-To-Repeat:
apply patch and build port

>Fix:
    The included patch

--- ocaml-images.diff begins here ---
diff -urN ocaml-images.orig/Makefile ocaml-images/Makefile
--- ocaml-images.orig/Makefile	2013-02-05 07:47:07.000000000 -0800
+++ ocaml-images/Makefile	2013-02-16 13:22:25.000000000 -0800
@@ -2,28 +2,23 @@
 # $FreeBSD: ports/graphics/ocaml-images/Makefile,v 1.45 2013/02/05 15:47:07 svnexp Exp $
 
 PORTNAME=	images
-PORTVERSION=	3.0.2
-PORTREVISION=	8
-PORTEPOCH=	2
+PORTVERSION=	v4.0.1
+PORTEPOCH=	4
 CATEGORIES=	graphics
-MASTER_SITES=	ftp://ftp.inria.fr/INRIA/Projects/cristal/caml-light/bazar-ocaml/ \
-		http://caml.inria.fr/distrib/bazar-ocaml/
+MASTER_SITES=	https://bitbucket.org/camlspotter/camlimages/get/
 PKGNAMEPREFIX=	ocaml-
-DISTNAME=	camlimages-${PORTVERSION}
-EXTRACT_SUFX=	.tgz
+DISTNAME=	${PORTVERSION}
 
 MAINTAINER=	michael.grunewald@laposte.net
 COMMENT=	Objective Caml image processing library
 
-BUILD_DEPENDS=	${LOCALBASE}/share/aclocal/ocaml.m4:${PORTSDIR}/lang/ocaml-autoconf
+LICENSE=	LGPL20
+LICENSE_FILE=	${WRKSRC}/License.txt
+
+BUILD_DEPENDS=	omake:${PORTSDIR}/devel/omake
+
+WRKSRC=	${WRKDIR}/camlspotter-camlimages-c803efa9d5d3
 
-DEPRECATED=	Broken for more than 6 month
-EXPIRATION_DATE=	2013-03-05
-BROKEN=		does not compile
-
-USE_AUTOTOOLS=	aclocal autoheader automake autoconf
-ACLOCAL_ARGS=	-I . -I ${LOCALBASE}/share/aclocal
-AUTOMAKE_ARGS=	--add-missing
 USE_OCAML=	yes
 USE_OCAML_FINDLIB=	yes
 USE_OCAMLFIND_PLIST=	yes
@@ -31,11 +26,13 @@
 OCAML_PKGDIRS=	camlimages
 USE_OCAML_LDCONFIG=	yes
 CPPFLAGS+=	-I${LOCALBASE}/include
-CFLAGS+=	-I${LOCALBASE}/include/libpng15
 LDFLAGS+=	-L${LOCALBASE}/lib
-CONFIGURE_ARGS+=	--without-lablgtk
 MAKE_JOBS_UNSAFE=	yes
 
+MAKE_FLAGS+=	CPPFLAGS="${CXXFLAGS} -I${LOCALBASE}/include" \
+	CFLAGS="${CFLAGS} -I${LOCALBASE}/include -I${LOCALBASE}/include/X11" \
+	LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib"
+
 OPTIONS=	PNG "Enable PNG support" on \
 		JPEG "Enable JPEG support" on \
 		TIFF "Enable TIFF support" on \
@@ -47,83 +44,119 @@
 
 .include <bsd.port.options.mk>
 
+SUPPORTED_NON_FORMATS=	graphics
+
 .if !defined(WITHOUT_PNG)
 LIB_DEPENDS+=	png15:${PORTSDIR}/graphics/png
-CONFIGURE_ARGS+=	--with-png
+CFLAGS+=	-I${LOCALBASE}/include/libpng15
+SUPPORTED_FORMATS+=	png
 .else
-CONFIGURE_ARGS+=	--without-png
+MAKE_FLAGS+=	SUPPORT_PNG=false HAVE_PNG=false SUPPORT_PNG=false
 .endif
 
 .if !defined(WITHOUT_JPEG)
 LIB_DEPENDS+=	jpeg.11:${PORTSDIR}/graphics/jpeg
-CONFIGURE_ARGS+=	--with-jpeg
+SUPPORTED_FORMATS+=	jpeg
 .else
-CONFIGURE_ARGS+=	--without-jpeg
+MAKE_FLAGS+=	HAVE_JPEG=false SUPPORT_JPEG=false
 .endif
 
 .if !defined(WITHOUT_TIFF)
 LIB_DEPENDS+=	tiff.4:${PORTSDIR}/graphics/tiff
-CONFIGURE_ARGS+=	--with-tiff
+SUPPORTED_FORMATS+=	tiff
 .else
-CONFIGURE_ARGS+=	--without-tiff
+MAKE_FLAGS+=	HAVE_TIFF=false SUPPORT_TIFF=false
 .endif
 
 .if !defined(WITHOUT_XPM)
 USE_XORG=	xpm
-CONFIGURE_ARGS+=	--with-xpm
+SUPPORTED_FORMATS+=	xpm
 .else
-CONFIGURE_ARGS+=	--without-xpm
+MAKE_FLAGS+=	HAVE_XPM=false SUPPORT_XPM=false
 .endif
 
 .if !defined(WITHOUT_GIF)
 LIB_DEPENDS+=	gif.5:${PORTSDIR}/graphics/giflib
-CONFIGURE_ARGS+=	--with-gif
+SUPPORTED_FORMATS+=	gif
 .else
-CONFIGURE_ARGS+=	--without-gif
+MAKE_FLAGS+=	HAVE_GIF=false SUPPORT_GIF=false
 .endif
 
 .if !defined(WITHOUT_FREETYPE)
 USE_FREETYPE=	yes
-CONFIGURE_ARGS+=	--with-freetype
+SUPPORTED_NON_FORMATS+=	freetype
 .else
-CONFIGURE_ARGS+=	--without-freetype
+MAKE_FLAGS+=	HAVE_FREETYPE=false SUPPORT_FREETYPE=false
 .endif
 
 .if defined(WITH_GS)
 USE_GHOSTSCRIPT=	yes
-CONFIGURE_ARGS+=	--with-gs
+SUPPORTED_FORMATS+=	ps
 .else
-CONFIGURE_ARGS+=	--without-gs
+MAKE_FLAGS+=	HAVE_PS=false SUPPORT_PS=false
 .endif
 
 .if defined(WITH_GTK2)
-CONFIGURE_ARGS+=	--with-lablgtk2
 BUILD_DEPENDS+=	lablgtk2:${PORTSDIR}/x11-toolkits/ocaml-lablgtk2
 RUN_DEPENDS+=	lablgtk2:${PORTSDIR}/x11-toolkits/ocaml-lablgtk2
+SUPPORTED_NON_FORMATS+=	lablgtk2
 .else
-CONFIGURE_ARGS+=	--without-lablgtk2
+MAKE_FLAGS+=	SUPPORT_LABLGTK2=false
 .endif
 
-GNU_CONFIGURE=	yes
-#USE_GMAKE=	yes
-
 #the default docsdir gets expanded to ${PREFIX}/share/doc/images
 #which isn't of much help when you are searching for the package docs
 DOCSDIR=	${PREFIX}/share/doc/${PKGNAMEPREFIX}${PORTNAME}
-DOCSFILES=	CHANGES README LICENSE
+DOCSFILES=	Changes.txt README License.txt
 
 .if !defined(NOPORTDOCS)
 PORTDOCS=	${DOCSFILES} doc
 .endif
 
+MAKE_FLAGS+=	SUPPORTED_FORMATS="${SUPPORTED_FORMATS}" \
+	SUPPORTED_NON_FORMATS="${SUPPORTED_NON_FORMATS}" \
+	SUPPORTED_SUBPACKAGES="${SUPPORTED_FORMATS} ${SUPPORTED_NON_FORMATS}"
+
+post-extract:
+.if defined(WITHOUT_PNG)
+	@${REINPLACE_CMD} 's|HAVE_PNG = \$$(Check_header_library png, png.h, png_create_read_struct)|HAVE_PNG = false|g' ${WRKSRC}/OMakefile
+.endif
+.if defined(WITHOUT_JPEG)
+	@${REINPLACE_CMD} 's|HAVE_JPEG = \$$(Check_header_library jpeg, jpeglib.h, jpeg_read_header)|HAVE_JPEG = false|g' ${WRKSRC}/OMakefile
+.endif
+.if defined(WITHOUT_TIFF)
+	@${REINPLACE_CMD} 's|HAVE_TIFF = \$$(Check_header_library tiff, tiff.h, TIFFOpen)|HAVE_TIFF = false|g' ${WRKSRC}/OMakefile
+.endif
+.if defined(WITHOUT_XPM)
+	@${REINPLACE_CMD} 's|HAVE_XPM = \$$(Check_header_library Xpm, xpm.h, XpmReadFileToXpmImage)|HAVE_XPM = false|g' ${WRKSRC}/OMakefile
+.endif
+.if defined(WITHOUT_GIF)
+	@${REINPLACE_CMD} 's|HAVE_GIF = \$$(Check_header_library gif, gif_lib.h, DGifOpenFileName)|HAVE_GIF = false|g' ${WRKSRC}/OMakefile
+.endif
+.if defined(WITHOUT_FREETYPE)
+	@${REINPLACE_CMD} 's|SUPPORT_FREETYPE = \$$(Check_prog_in_path freetype-config)|SUPPORT_FREETYPE = false|g' ${WRKSRC}/OMakefile
+	@${REINPLACE_CMD} 's|PATH_FREETYPE_CONFIG = \$$(WHERE)|PATH_FREETYPE_CONFIG =|g' ${WRKSRC}/OMakefile
+.endif
+.if defined(WITHOUT_GS)
+	@${REINPLACE_CMD} 's|SUPPORT_PS = \$$(Check_prog_in_path gs)|SUPPORT_PS = false|g' ${WRKSRC}/OMakefile
+	@${REINPLACE_CMD} 's|PATH_GS = \$$(WHERE)|PATH_GS =|g' ${WRKSRC}/OMakefile
+.endif
+.if defined(WITHOUT_GTK2)
+	@${REINPLACE_CMD} 's|SUPPORT_LABLGTK2 = \$$(Check_ocamlfind_package lablgtk2)|SUPPORT_LABLGTK2 = false|g' ${WRKSRC}/OMakefile
+.endif
+
+do-build:
+	cd ${WRKSRC} && ${PREFIX}/bin/omake ${MAKE_FLAGS}
+
+do-install:
+	cd ${WRKSRC} && ${PREFIX}/bin/omake ${MAKE_FLAGS} ${INSTALL}
+
 post-install:
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}/doc
 	@(cd ${WRKSRC} && ${COPYTREE_SHARE} \* ${DOCSDIR}/doc '-name "*.jpg" -o -name "*.html"')
 	@${INSTALL_DATA} ${DOCSFILES:S,^,${WRKSRC}/,g} ${DOCSDIR}/
 .endif
-	@${ECHO_CMD} "lib/ocaml/stublibs/dllcamlimages.so" >> ${TMPPLIST}
-	@${ECHO_CMD} "lib/ocaml/stublibs/dllcamlimages_core.so" >> ${TMPPLIST}
 	@${ECHO_CMD} "@unexec ${RMDIR} %D/lib/ocaml/stublibs >/dev/null 2>&1 || ${TRUE}" >> ${TMPPLIST}
 
 .include <bsd.port.mk>
diff -urN ocaml-images.orig/distinfo ocaml-images/distinfo
--- ocaml-images.orig/distinfo	2011-07-03 07:11:43.000000000 -0700
+++ ocaml-images/distinfo	2013-02-16 13:22:25.000000000 -0800
@@ -1,4 +1,2 @@
-SHA256 (ocaml-autoconf-1.0.tar.gz) = 67e85520f65c033c86e99e5438e51657e777579034570527c1b2c62096ecb004
-SIZE (ocaml-autoconf-1.0.tar.gz) = 11337
-SHA256 (camlimages-3.0.2.tgz) = db5aec421c89bea7b1bf55df6a674a0a6ac245f89c220c818e2e5d83f623662c
-SIZE (camlimages-3.0.2.tgz) = 1429138
+SHA256 (v4.0.1.tar.gz) = b40237c1505487049799a7af296eb3996b3fa08eab94415546f46d61355747c4
+SIZE (v4.0.1.tar.gz) = 2190274
diff -urN ocaml-images.orig/files/patch-configure.ac ocaml-images/files/patch-configure.ac
--- ocaml-images.orig/files/patch-configure.ac	2010-03-26 14:16:59.000000000 -0700
+++ ocaml-images/files/patch-configure.ac	1969-12-31 16:00:00.000000000 -0800
@@ -1,10 +0,0 @@
---- configure.ac.orig	2010-03-26 01:15:49.000000000 -0700
-+++ configure.ac	2010-03-26 01:15:52.000000000 -0700
-@@ -5,7 +5,6 @@
- 
- # Check ocaml
- AC_PROG_OCAML([3.08])
--AC_PROG_OCAML_TOOL(OCAMLMKLIB, ocamlmklib)
- AC_SUBST(OCAMLLIB)
- 
- # Check versions to build
diff -urN ocaml-images.orig/files/patch-src_gifwrite.c ocaml-images/files/patch-src_gifwrite.c
--- ocaml-images.orig/files/patch-src_gifwrite.c	2010-04-09 03:06:44.000000000 -0700
+++ ocaml-images/files/patch-src_gifwrite.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,11 +0,0 @@
---- ./src/gifwrite.c.orig	2010-04-09 03:01:01.000000000 -0700
-+++ ./src/gifwrite.c	2010-04-09 03:01:08.000000000 -0700
-@@ -25,7 +25,7 @@
- 
- #include <gif_lib.h>
- 
--int list_length( value list )
-+static int list_length( value list )
- {
-   CAMLparam1(list);
-   CAMLlocal1(l);
diff -urN ocaml-images.orig/files/patch-src_tiffread.c ocaml-images/files/patch-src_tiffread.c
--- ocaml-images.orig/files/patch-src_tiffread.c	2010-08-28 01:57:50.000000000 -0700
+++ ocaml-images/files/patch-src_tiffread.c	2013-02-16 13:22:25.000000000 -0800
@@ -1,13 +1,6 @@
---- src/tiffread.c.orig	2009-10-26 13:42:03.000000000 +0100
-+++ src/tiffread.c	2010-08-28 10:47:42.000000000 +0200
-@@ -20,15 +20,21 @@
- #include <caml/alloc.h>
- #include <caml/memory.h>
- #include <caml/fail.h>
-+#include "oversized.h"
- 
- /* These are defined in caml/config.h */
- #define int16 int16tiff
+--- src/tiffread.c.orig	2011-06-22 11:04:32.000000000 -0700
++++ src/tiffread.c	2013-02-09 18:06:06.000000000 -0800
+@@ -28,9 +28,14 @@
  #define uint16 uint16tiff
  #define int32 int32tiff
  #define uint32 uint32tiff
@@ -22,14 +15,3 @@
  extern value *imglib_error;
  
  value open_tiff_file_for_read( name )
-@@ -64,6 +70,10 @@
-     TIFFGetField(tif, TIFFTAG_YRESOLUTION, &yres);
-     TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &photometric);
- 
-+    if (oversized (imagewidth, imagelength)) {
-+	failwith_oversized("tiff");
-+    }
-+
-     if( imagesample == 3 && photometric == PHOTOMETRIC_RGB ){
-       if( imagebits != 8 ){
- 	failwith("Sorry, tiff rgb file must be 24bit-color");
--- ocaml-images.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87vc9sgcd4.wl>