Bug 94058 - Add FFI support for lang/squeak
Summary: Add FFI support for lang/squeak
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Stefan Walter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-04 08:10 UTC by Takeshi MUTOH
Modified: 2006-06-08 18:03 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Takeshi MUTOH 2006-03-04 08:10:04 UTC
Currently, lang/squeak FFI plugin 
(See http://minnow.cc.gatech.edu/squeak/1414) support works not well.

If you has already install devel/libffi before installing lang/squeak,
FFI support is automatically activated. But pkg-plist is not care this
situation, so you can't deinstall cleanly.
Furthermore, configure script can't link libffi automatically, FFI
plugin can't work well.

Fix: Plese apply patch below.
Some portlint errors are reduced.



--
Takeshi MUTOH	<mutoh@openedu.org>--VlmzhVG4YUcuj9KVwrYAAZlRp1DA7FCq7kIZjttz7l1UMyxB
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

diff -ruN /usr/ports/lang/squeak/Makefile squeak/Makefile
--- /usr/ports/lang/squeak/Makefile	Mon Nov 29 10:25:32 2004
+++ squeak/Makefile	Sat Mar  4 15:40:53 2006
@@ -37,7 +37,6 @@
 ONLY_FOR_ARCHS= 	i386
 MAN1=			inisqueak.1 squeak.1
 USE_GMAKE=		yes
-USE_REINPLACE=		yes
 HAS_CONFIGURE=		yes
 
 # Don't set USE_ZIP as this breaks EXTRACT_CMD.
@@ -59,7 +58,8 @@
 INSTALL_WRKSRC=		${CONFIGURE_WRKSRC}
 CONFIGURE_SCRIPT=	../platforms/unix/config/configure
 CONFIGURE_ARGS+=	--libdir=${PREFIX}/share \
-			--without-quartz
+			--without-quartz \
+			LDFLAGS="-L${LOCALBASE}/lib" CPPFLAGS="-I${LOCALBASE}/include"
 # don't pass "-s" to install to avoid trying to strip a shell script
 CONFIGURE_ENV=
 
@@ -89,6 +89,15 @@
 CONFIGURE_ARGS+=        --enable-mpg-mmx
 .endif
 
+.if defined(WITH_FFI) && (${WITH_FFI}=="yes")
+LIB_DEPENDS+=		ffi.2:${PORTSDIR}/devel/libffi
+PLIST_FFI=
+EXT_PLUGINS+=		SqueakFFIPrims
+.else
+CONFIGURE_ARGS+=	--without-ffi
+PLIST_FFI=		"@comment feature not wanted - "
+.endif
+
 .ifdef (CC)
 MAKE_ARGS+=		CC="${CC}"
 .endif
@@ -101,7 +110,8 @@
 			PATCHNUMBER=${PATCHNUMBER}\
 			VMVERSION=${VMVERSION}\
 			PLIST_NPSQUEAK=${PLIST_NPSQUEAK}\
-			PLIST_X=${PLIST_X}
+			PLIST_X=${PLIST_X}\
+			PLIST_FFI=${PLIST_FFI}
 
 .include <bsd.port.pre.mk>
 
@@ -120,6 +130,8 @@
 	@${ECHO_MSG} "                        ^^^      (default: enabled)"
 	@${ECHO_MSG} "    WITH_X=            [yes|no]  X Windows support"
 	@${ECHO_MSG} "                        ^^^      (default: enabled)"
+	@${ECHO_MSG} "    WITH_FFI=          [yes|no]  FFI support"
+	@${ECHO_MSG} "                            ^^   (default: disabled)"
 	@${ECHO_MSG} " "
 	@${ECHO_MSG} "  additional make arguments"
 	@${ECHO_MSG} "    CC=<aString>"
@@ -129,10 +141,13 @@
 	@${ECHO_MSG} " "
 
 ##################################################
+post-patch:
+# Fix external plugins
+	@${ECHO_MSG} "EXTERNAL_PLUGINS = B3DAcceleratorPlugin UnixOSProcessPlugin XDisplayControlPlugin ${EXT_PLUGINS}" > ${WRKSRC}/src/plugins.ext
+
+##################################################
 pre-configure:
 	@${MKDIR} ${CONFIGURE_WRKSRC}
-	@cd ${WRKSRC}/platforms/unix/npsqueak && \
-		${REINPLACE_CMD} -e 's|include|include -I${X11BASE}/include|g' Makefile
 
 ##################################################
 post-configure:
@@ -145,8 +160,8 @@
 post-install:
 	(cd ${DISTDIR}/${DIST_SUBDIR} && ${INSTALL_DATA} SqueakV3.sources.gz ${PREFIX}/share/squeak/)
 	(cd ${PREFIX}/share/squeak && ${EXTRACT_CMD} -d SqueakV3.sources.gz)
-	(cd ${DISTDIR}/${DIST_SUBDIR} && unzip -u Squeak${IMAGEVERSION}-${PATCHNUMBER}-basic.zip -d ${WRKDIR})
-	(cd ${DISTDIR}/${DIST_SUBDIR} && unzip -u Squeak${IMAGEVERSION}-${PATCHNUMBER}-full.zip -d ${WRKDIR})
+	(cd ${DISTDIR}/${DIST_SUBDIR} && ${UNZIP_CMD} -u Squeak${IMAGEVERSION}-${PATCHNUMBER}-basic.zip -d ${WRKDIR})
+	(cd ${DISTDIR}/${DIST_SUBDIR} && ${UNZIP_CMD} -u Squeak${IMAGEVERSION}-${PATCHNUMBER}-full.zip -d ${WRKDIR})
 	(cd ${WRKDIR} && ${INSTALL_DATA} ReadMe.txt ${PREFIX}/share/squeak/)
 .for file in ${FILES_TO_GZIP}
 	(cd ${WRKDIR} && ${GZIP_CMD} ${file} && ${INSTALL_DATA} ${file}.gz ${PREFIX}/share/squeak/)
diff -ruN /usr/ports/lang/squeak/files/patch-platforms::unix::plugins::SqueakFFIPrims::Makefile.in squeak/files/patch-platforms::unix::plugins::SqueakFFIPrims::Makefile.in
--- /usr/ports/lang/squeak/files/patch-platforms::unix::plugins::SqueakFFIPrims::Makefile.in	Thu Jan  1 09:00:00 1970
+++ squeak/files/patch-platforms::unix::plugins::SqueakFFIPrims::Makefile.in	Sat Mar  4 14:58:46 2006
@@ -0,0 +1,11 @@
+--- platforms/unix/plugins/SqueakFFIPrims/Makefile.in.orig	Sun Mar 20 05:38:18 2005
++++ platforms/unix/plugins/SqueakFFIPrims/Makefile.in	Sun Feb 26 00:08:03 2006
+@@ -14,7 +14,7 @@
+ XINCLUDES	= [includes]
+ 
+ $(TARGET) : $(OBJS) Makefile
+-	$(LINK) $(TARGET) $(OBJS)
++	$(LINK) $(TARGET) $(OBJS) -lffi
+ 	$(RANLIB) $(TARGET)
+ 
+ [make_targets]
diff -ruN /usr/ports/lang/squeak/pkg-plist squeak/pkg-plist
--- /usr/ports/lang/squeak/pkg-plist	Sun Jan  8 03:37:39 2006
+++ squeak/pkg-plist	Sat Mar  4 14:58:00 2006
@@ -9,6 +9,7 @@
 %%PLIST_X%%share/squeak/%%VMVERSION%%/B3DAcceleratorPlugin
 share/squeak/%%VMVERSION%%/UnixOSProcessPlugin
 %%PLIST_X%%share/squeak/%%VMVERSION%%/XDisplayControlPlugin
+%%PLIST_FFI%%share/squeak/%%VMVERSION%%/SqueakFFIPrims
 %%PLIST_NPSQUEAK%%share/squeak/%%VMVERSION%%/npsqueak.so
 %%PLIST_NPSQUEAK%%share/squeak/%%VMVERSION%%/npsqueakrun
 share/squeak/%%VMVERSION%%/squeak
How-To-Repeat: 
Install devel/libffi before installing lang/squeak.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-03-04 08:20:08 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback
Comment 2 chris 2006-03-06 20:57:31 UTC
> Maintainer of lang/squeak,
>
> Please note that PR ports/94058 has just been submitted.
>
> If it contains a patch for an upgrade, an enhancement or a bug fix
> you agree on, reply to this email stating that you approve the patch
> and a committer will take care of it.

I agree on the patch! Thanks to the author!

> The full text of the PR can be found at:
>     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/94058
>
> --
> Edwin Groothuis
> edwin@FreeBSD.org

Chris Burkert
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2006-03-07 17:52:52 UTC
State Changed
From-To: feedback->open

Maintainer approved.
Comment 4 Stefan Walter freebsd_committer freebsd_triage 2006-05-16 17:09:53 UTC
Responsible Changed
From-To: freebsd-ports-bugs->stefan

Take.
Comment 5 Stefan Walter freebsd_committer freebsd_triage 2006-06-08 18:03:00 UTC
State Changed
From-To: open->closed

Committed, thanks!