[MLton-commit] r4262

Stephen Weeks MLton@mlton.org
Wed, 30 Nov 2005 10:39:13 -0800


Another FreeBSD patch from Geoff Mainland.

----------------------------------------------------------------------

U   mlton/trunk/bytecode/Makefile
U   mlton/trunk/package/freebsd/Makefile
A   mlton/trunk/package/freebsd/files/
A   mlton/trunk/package/freebsd/files/patch-bin::make-pdf-guide

----------------------------------------------------------------------

Modified: mlton/trunk/bytecode/Makefile
===================================================================
--- mlton/trunk/bytecode/Makefile	2005-11-30 03:05:54 UTC (rev 4261)
+++ mlton/trunk/bytecode/Makefile	2005-11-30 18:39:11 UTC (rev 4262)
@@ -16,6 +16,10 @@
 CFLAGS += -mtune=opteron -m32 
 endif 
 
+ifeq ($(TARGET_OS), freebsd)
+CFLAGS += -I/usr/local/include
+endif
+
 interpret.o: interpret.c interpret.h opcode.h
 	$(CC) $(CFLAGS) -c -O2 interpret.c
 

Modified: mlton/trunk/package/freebsd/Makefile
===================================================================
--- mlton/trunk/package/freebsd/Makefile	2005-11-30 03:05:54 UTC (rev 4261)
+++ mlton/trunk/package/freebsd/Makefile	2005-11-30 18:39:11 UTC (rev 4262)
@@ -23,7 +23,9 @@
 
 BUILD_DEPENDS=	bash:${PORTSDIR}/shells/bash
 .if !defined(NOPORTDOCS)
-BUILD_DEPENDS+= latex:${PORTSDIR}/print/teTeX
+BUILD_DEPENDS+=	gsed:${PORTSDIR}/textproc/gsed \
+		htmldoc:${PORTSDIR}/textproc/htmldoc \
+		latex:${PORTSDIR}/print/teTeX
 .endif
 LIB_DEPENDS=	gmp.6:${PORTSDIR}/math/libgmp4
 RUN_DEPENDS=	bash:${PORTSDIR}/shells/bash
@@ -46,9 +48,6 @@
 		PATH=${WRKSRC}/build/bin:${BOOT_WRKSRC}/bin:${PATH} \
 		PREFIX=${PREFIX}
 
-# XXX Temporary, until docs install is fixed in main Makefile
-NOPORTDOCS=	yes
-
 .if defined(NOPORTDOCS)
 INSTALL_TARGET=	install-no-docs
 .endif
@@ -61,6 +60,10 @@
 LIB_DEPENDS+=	c.5:${PORTSDIR}/misc/compat5x
 .endif
 
+.if ${OSVERSION} >= 503000
+LIB_DEPENDS+=	m.2:${PORTSDIR}/misc/compat4x
+.endif
+
 BOOT_EXTRACT=	--bzip2
 BOOT_SUF=	tbz
 BOOT_VER=	20041109
@@ -72,6 +75,14 @@
 		"s|lib=\'${LOCALBASE}/|lib=\'${BOOT_WRKSRC}/|" \
 	${BOOT_WRKSRC}/bin/mlton
 
+post-patch:
+	@${REINPLACE_CMD} -e \
+		"s|FLAGS += -I/usr/local/include|FLAGS += -I${LOCALBASE}/include|" \
+		${WRKSRC}/runtime/Makefile
+	@${REINPLACE_CMD} -e \
+		"s|CFLAGS += -I/usr/local/include|CFLAGS += -I${LOCALBASE}/include|" \
+		${WRKSRC}/bytecode/Makefile
+
 post-install:
 .for bin in mllex mlnlffigen mlprof mlton mlyacc
 	${CHOWN} ${SHAREOWN}:${SHAREGRP} ${PREFIX}/bin/${bin}	\
@@ -103,11 +114,11 @@
 	${MAKE} install
 	${MAKE} package
 	${MAKE} deinstall
-	pkg_add ${PKGREPOSITORY}/${PORTNAME}-${PORTVERSION}.tbz
+	pkg_add ${PORTNAME}-${PORTVERSION}.tbz
 	${MAKE} deinstall
 	${MAKE} reinstall
 	${MAKE} package
-	${CP} ${PKGREPOSITORY}/${PORTNAME}-${PORTVERSION}.tbz	\
+	${CP} ${PORTNAME}-${PORTVERSION}.tbz	\
 		${DISTDIR}/${PORTNAME}-${PORTVERSION}-${RELEASE}.i386-freebsd.tbz
 	${TAR} -cpf - Makefile distinfo pkg-descr pkg-plist | \
 		( ${MKDIR} ${PORTDIR} && cd ${PORTDIR} && ${TAR} -xpf - )
@@ -117,8 +128,7 @@
 PLIST=		${.CURDIR}/pkg-plist
 
 pkg-plist:
-# XXX Temporary, until docs install is fixed in main Makefile
-	cd ${WRKSRC} && ${GMAKE} install-no-docs
+	cd ${WRKSRC} && ${GMAKE} install
 	cd ${WRKSRC}/install/usr && \
 		${FIND} -d * \! -type d | ${GREP} -v man/man | \
 		${SORT} >${PLIST}

Added: mlton/trunk/package/freebsd/files/patch-bin::make-pdf-guide
===================================================================
--- mlton/trunk/package/freebsd/files/patch-bin::make-pdf-guide	2005-11-30 03:05:54 UTC (rev 4261)
+++ mlton/trunk/package/freebsd/files/patch-bin::make-pdf-guide	2005-11-30 18:39:11 UTC (rev 4262)
@@ -0,0 +1,20 @@
+--- bin/make-pdf-guide.orig	Wed Nov 30 00:44:19 2005
++++ bin/make-pdf-guide	Wed Nov 30 00:44:33 2005
+@@ -52,7 +52,7 @@
+ s;<td colspan = 3;<td align = right;
+ s;<img src=\"\(http://mlton.org[^>]*\)>;<img src="moin-www.png"><a href=\"\1>image</a>;g
+ EOF
+-	sed -f $script <$f >.tmp
++	gsed -f $script <$f >.tmp
+ 	mv .tmp $f
+ done
+ 
+@@ -127,7 +127,7 @@
+ ) >$book
+ 
+ echo 'Running htmldoc.'
+-htmldoc --batch $book
++htmldoc --batch $book || true
+ 
+ mv $pdf $src/doc/guide
+