ports/93318: New port: x11-toolkits/swt32, Eclipse SWT 3.2M4 Support

Bill Dymek bdymek at ieee.org
Tue Feb 14 07:10:11 UTC 2006


>Number:         93318
>Category:       ports
>Synopsis:       New port: x11-toolkits/swt32, Eclipse SWT 3.2M4 Support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 14 07:10:09 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Bill Dymek
>Release:        FreeBSD 6.0-RELEASE-p4 amd64
>Organization:
>Environment:
System: FreeBSD ... 6.0-RELEASE-p4 FreeBSD 6.0-RELEASE-p4 #0: Fri Feb 3 22:28:36 EST 2006 ... amd64


        amd64
        Gtk
        GNOME 2.12+
        Cairo 1.0.2

        java version "1.5.0-p2"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-p2-root_14_jan_2006_01_34)
   
>Description:
This is a new port that builds the Eclipse SWT 3.2M4 (Stable) Java Gtk wrapper library.  This port, if accepted, can probably deprecate the swt31 port.  The new target jarfile is named swt32.jar, and will be paired automatically with the native code that is built as part of the default make target.  

Both this port and the swt31 port are based loosely on the Eclipse port.  This port should enable amd64 support for all SWT applications, such as Azureus.
(Azureus will need to be patched to have 'swt32.jar' in the CLASSPATH.)

My thanks to Panagiotis Astithas (the current swt31 maintainer) for providing input, and testing the make target on the i386 platform.

>How-To-Repeat:
N/A  New Port.
>Fix:
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#       swt32
#       swt32/files
#       swt32/files/patch-make_freebsd.mak
#       swt32/files/patch-build.sh
#       swt32/files/patch-OS.java
#       swt32/files/patch-build.xml
#       swt32/Makefile
#       swt32/distinfo
#       swt32/pkg-descr
#
echo c - swt32
mkdir -p swt32 > /dev/null 2>&1
echo c - swt32/files
mkdir -p swt32/files > /dev/null 2>&1
echo x - swt32/files/patch-make_freebsd.mak
sed 's/^X//' >swt32/files/patch-make_freebsd.mak << 'END-of-swt32/files/patch-make_freebsd.mak'
X--- make_freebsd.mak.orig      Thu Feb  2 10:20:56 2006
X+++ make_freebsd.mak   Thu Feb  2 10:24:53 2006
X@@ -9,7 +9,7 @@
X #     IBM Corporation - initial API and implementation
X #*******************************************************************************
X
X-# Makefile for creating SWT libraries for Linux GTK
X+# Makefile for creating SWT libraries for FreeBSD GTK
X
X include make_common.mak
X
X@@ -72,7 +72,7 @@
X       -fPIC \
X       -I. \
X       -I$(JAVA_HOME)/include \
X-      -I$(JAVA_HOME)/include/linux \
X+      -I$(JAVA_HOME)/include/freebsd \
X       ${GECKO_INCLUDES} \
X       ${SWT_PTR_CFLAGS}
X MOZILLALIBS = -shared -s -Wl,--version-script=mozilla_exports -Bsymbolic \
X@@ -91,15 +91,16 @@
X CFLAGS = -O -Wall \
X               -DSWT_VERSION=$(SWT_VERSION) \
X               $(NATIVE_STATS) \
X-              -DLINUX -DGTK \
X+              -DFREEBSD -DGTK \
X               -I$(JAVA_HOME)/include \
X-              -I$(JAVA_HOME)/include/linux \
X-              -fPIC \
X+              -I$(JAVA_HOME)/include/freebsd \
X+                -fpic -fPIC \
X+                -I$(X11BASE)/include \
X               ${SWT_PTR_CFLAGS}
X-LIBS = -shared -fPIC -s
X+LIBS = -shared -fPIC -fpic -s
X
X
X-all: make_swt make_atk make_gnome make_glx
X+all: make_swt make_atk $(MAKE_GNOME) make_awt $(MAKE_MOZILLA) $(MAKE_CAIRO) make_glx
X
X #
X # SWT libs
X@@ -239,4 +240,4 @@
X # Clean
X #
X clean:
X-      rm -f *.o *.so
X+      rm -f *.o *.so *.jar
END-of-swt32/files/patch-make_freebsd.mak
echo x - swt32/files/patch-build.sh
sed 's/^X//' >swt32/files/patch-build.sh << 'END-of-swt32/files/patch-build.sh'
X--- build.sh.orig      2005-12-15 15:19:38.000000000 -0500
X+++ build.sh   2006-01-24 15:27:53.000000000 -0500
X@@ -12,10 +12,14 @@
X #     Tom Tromey (Red Hat, Inc.)
X #*******************************************************************************
X
X-cd `dirname $0`
X+#cd `dirname $0`
X
X if [ "${JAVA_HOME}" = "" ]; then
X       echo "Please set JAVA_HOME to point at a JRE."
X+else
X+      JAVA_HOME=`echo \$JAVA_HOME | sed 's/\/jre//g'`
X+      echo "JAVA_HOME=$JAVA_HOME"
X+      echo
X fi
X if [ "${CC}" = "" ]; then
X       CC=gcc
X@@ -31,6 +35,10 @@
X               SWT_OS=solaris
X               MAKEFILE=make_solaris.mak
X               ;;
X+      "FreeBSD")
X+              SWT_OS=freebsd
X+              MAKEFILE=make_freebsd.mak
X+              ;;
X       *)
X               SWT_OS=`uname -s | tr -s '[:upper:]' '[:lower:]'`
X               MAKEFILE=make_linux.mak
X@@ -61,7 +69,7 @@
X esac
X
X # For 64-bit CPUs, we have a switch
X-if [ ${MODEL} = 'x86_64' -o ${MODEL} = 'ppc64' -o ${MODEL} = 'ia64' ]; then
X+if [ ${MODEL} = 'x86_64' -o ${MODEL} = 'ppc64' -o ${MODEL} = 'ia64' -o ${MODEL} = 'amd64' ]; then
X       SWT_PTR_CFLAGS=-DSWT_PTR_SIZE_64
X       export SWT_PTR_CFLAGS
X       if [ -d /lib64 ]; then
X@@ -124,7 +132,8 @@
X fi
X
X if [ "x${1}" = "xclean" ]; then
X-      make -f $MAKEFILE clean
X+      gmake -f $MAKEFILE clean
X else
X-      make -f $MAKEFILE all $MAKE_GNOME $MAKE_CAIRO $MAKE_AWT $MAKE_MOZILLA ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9}
X+      gmake -f $MAKEFILE make_swt make_atk make_glx $MAKE_GNOME $MAKE_CAIRO $MAKE_AWT $MAKE_MOZILLA ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9}
X+
X fi
END-of-swt32/files/patch-build.sh
echo x - swt32/files/patch-OS.java
sed 's/^X//' >swt32/files/patch-OS.java << 'END-of-swt32/files/patch-OS.java'
X--- ./org/eclipse/swt/internal/gtk/OS.java.orig        Thu Dec 15 15:19:38 2005
X+++ ./org/eclipse/swt/internal/gtk/OS.java     Mon Jan 23 23:51:20 2006
X@@ -20,18 +20,20 @@
X       }
X
X       /** OS Constants */
X-      public static final boolean IsAIX, IsSunOS, IsLinux, IsHPUX;
X+      public static final boolean IsAIX, IsSunOS, IsLinux, IsHPUX, IsFreeBSD;
X       static {
X
X               /* Initialize the OS flags and locale constants */
X+              /* make bootstrap compatible with `uname -s` for FreeBSD */
X               String osName = System.getProperty ("os.name");
X-              boolean isAIX = false, isSunOS = false, isLinux = false, isHPUX = false;
X+              boolean isAIX = false, isSunOS = false, isLinux = false, isHPUX = false, isFreeBSD = false;
X               if (osName.equals ("Linux")) isLinux = true;
X+              if (osName.equals ("FreeBSD")) isFreeBSD = true;
X               if (osName.equals ("AIX")) isAIX = true;
X               if (osName.equals ("Solaris")) isSunOS = true;
X               if (osName.equals ("SunOS")) isSunOS = true;
X               if (osName.equals ("HP-UX")) isHPUX = true;
X-              IsAIX = isAIX;  IsSunOS = isSunOS;  IsLinux = isLinux;  IsHPUX = isHPUX;
X+              IsAIX = isAIX;  IsSunOS = isSunOS;  IsLinux = isLinux;  IsFreeBSD = isFreeBSD;  IsHPUX = isHPUX;
X       }
X
X       /** Constants */
END-of-swt32/files/patch-OS.java
echo x - swt32/files/patch-build.xml
sed 's/^X//' >swt32/files/patch-build.xml << 'END-of-swt32/files/patch-build.xml'
X--- build.xml.orig     Thu Dec 15 15:19:38 2005
X+++ build.xml  Wed Jan 25 01:01:08 2006
X@@ -1,55 +1,61 @@
X <?xml version="1.0" encoding="UTF-8"?>
X+<project name="org.eclipse.swt.gtk.freebsd.x86_64" default="build.jar" basedir=".">
X
X-<project default="build_gtk_lib" basedir="../../..">
X+      <target name="init">
X+              <property name="ws" value="gtk"/>
X+              <property name="os" value="freebsd"/>
X+              <property name="arch" value="x86_64"/>
X+              <property name="version.suffix" value="3.218"/>
X+              <property name="destination" value="${basedir}"/>
X+              <property name="path.java.home" value="${java.home}"/>
X+                <property name="javac.verbose" value="false"/>
X+                <property name="javac.debug" value="off"/>
X+              <property name="input.srcdir" value="${basedir}/org"/>
X+              <property name="output.jar" value="${basedir}/swt.jar"/>
X+              <property name="output.classes" value="${basedir}/classes"/>
X+      </target>
X+
X+      <target name="all" depends="build.jar"/>
X+
X+      <target name="build.classes" depends="init">
X+              <mkdir dir="${output.classes}"/>
X+              <!-- -source & -target taken from Eclipse 32M4 CVS build -->
X+              <javac  srcdir="${input.srcdir}" destdir="${output.classes}"
X+                      debug="${javac.debug}" verbose="${javac.verbose}"
X+                      source="1.3" target="1.2">
X+              </javac>
X+      </target>
X+
X+      <target name="build.jar" depends="build.nativeLibraries">
X+              <jar destfile="${output.jar}" index="false">
X+                      <fileset dir="${output.classes}">
X+                              <exclude name="**/*.java"/>
X+                              <exclude name="**/*.o"/>
X+                              <exclude name="**/*.so"/>
X+                              <!-- exclude CVS archive -->
X+                              <exclude name="**/CVS/**"/>
X+                      </fileset>
X+                      <fileset dir="${basedir}">
X+                              <include name="**/version.txt"/>
X+                      </fileset>
X+              </jar>
X+      </target>
X+
X+      <target name="clean" depends="init">
X+              <delete dir="${output.classes}"/>
X+              <delete file="${output.jar}"/>
X+              <exec  executable="sh" failonerror="true">
X+                      <env key="JAVA_HOME" value="${path.java.home}"/>
X+                      <arg value="build.sh"/>
X+                      <arg value="clean"/>
X+              </exec>
X+      </target>
X+
X+      <target name="build.nativeLibraries" depends="build.classes">
X+              <exec  executable="sh" failonerror="true">
X+                      <env key="JAVA_HOME" value="${path.java.home}"/>
X+                      <arg value="build.sh"/>
X+              </exec>
X+      </target>
X
X-<target name="init">
X-      <eclipse.refreshLocal resource="org.eclipse.swt" depth="infinite" />
X-      <eclipse.refreshLocal resource="org.eclipse.swt.tools" depth="infinite" />
X-      <eclipse.incrementalBuild project="org.eclipse.swt" kind="incr" />
X-</target>
X-
X-<!-- Build swt.so for GTK -->
X-<target name="build_gtk_lib" depends="init">
X-      <exec dir="./bin/library" executable="sh">
X-              <arg line="${basedir}/bin/library/build.sh"/>
X-              <arg line="install"/>
X-      </exec>
X-      <eclipse.refreshLocal resource="org.eclipse.swt.gtk.linux.x86" depth="infinite" />
X-</target>
X-
X-<!-- Build swt.so for PowerPC 32 bit GTK (no Mozilla)-->
X-<target name="build_ppc_gtk_lib" depends="init">
X-      <exec dir="./bin/library" executable="sh">
X-              <env key="MODEL" value="ppc"/>
X-              <arg line="${basedir}/bin/library/build.sh"/>
X-              <arg line="install"/>
X-      </exec>
X-      <eclipse.refreshLocal resource="org.eclipse.swt.gtk.linux.ppc" depth="infinite" />
X-</target>
X-
X-<!-- Build swt.so for Solaris GTK (no Mozilla) -->
X-<target name="build_solaris_gtk_lib" depends="init">
X-      <exec dir="./bin/library" executable="sh">
X-              <arg line="${basedir}/bin/library/build.sh"/>
X-              <arg line="install"/>
X-      </exec>
X-      <eclipse.refreshLocal resource="org.eclipse.swt.gtk.solaris.sparc" depth="infinite" />
X-</target>
X-
X-<!-- Build swt.so for GTK 64 -->
X-<target name="build_gtk64_lib" depends="init">
X-      <exec dir="./bin/library" executable="sh">
X-              <arg line="${basedir}/bin/library/build.sh"/>
X-              <arg line="install"/>
X-      </exec>
X-      <eclipse.refreshLocal resource="org.eclipse.swt.gtk.linux.x86_64" depth="infinite" />
X-</target>
X-
X-<target name="clean">
X-      <exec dir="./bin/library" executable="sh">
X-              <arg line="${basedir}/bin/library/build.sh"/>
X-              <arg line="clean"/>
X-      </exec>
X-</target>
X-
X-</project>
X\ No newline at end of file
X+</project>
END-of-swt32/files/patch-build.xml
echo x - swt32/Makefile
sed 's/^X//' >swt32/Makefile << 'END-of-swt32/Makefile'
X# New ports collection makefile for:   swt
X# Date created:                                2005-12-15
X# Whom:                                        past at ebs.gr
X#
X# $FreeBSD $
X#
X
XPORTNAME=      swt
XPORTVERSION=   3.2M4
XCATEGORIES=    x11-toolkits devel java
XMASTER_SITES=  ${MASTER_SITE_ECLIPSE}
XMASTER_SITE_SUBDIR=    S-${PORTVERSION}-200512151506
X
XMAINTAINER=    freebsd-eclipse at freebsd.org
XCOMMENT=       Standard Widget Toolkit for Java
X
XBUILD_DEPENDS+= ant:${PORTSDIR}/devel/apache-ant
XANT=            ant
X
XOUTPUT_JAR=    swt32.jar
XSWT_VERSION=   3218
XNO_WRKSUBDIR=  yes
XONLY_FOR_ARCHS=        i386 amd64
XUSE_GMAKE=     yes
XUSE_ZIP=       yes
XMAKEFILE=      make_freebsd.mak
XINSTALLS_SHLIB=        yes
XPLIST_SUB=     BUILD=${SWT_VERSION}
XPLIST_FILES=   %%JAVAJARDIR%%/${OUTPUT_JAR} \
X               lib/libswt-atk-gtk-%%BUILD%%.so \
X               lib/libswt-awt-gtk-%%BUILD%%.so \
X               lib/libswt-gtk-%%BUILD%%.so \
X               lib/libswt-glx-gtk-%%BUILD%%.so \
X               lib/libswt-pi-gtk-%%BUILD%%.so
X
XUSE_JAVA=      yes
XUSE_REINPLACE= yes
XJAVA_VERSION=  1.4+
XJAVA_OS=       native
X
X.if !defined(WITHOUT_MOZILLA)
XPLIST_FILES+=  lib/libswt-mozilla-gtk-%%BUILD%%.so
XMAKE_MOZILLA=  make_mozilla
X.if defined(WITH_MOZILLA) && ${WITH_MOZILLA} != "mozilla"
XBROWSER=       ${WITH_MOZILLA}
XBUILD_DEPENDS+=        ${BROWSER}:${PORTSDIR}/www/${BROWSER}
X.else
XBUILD_DEPENDS+=        mozilla:${PORTSDIR}/www/mozilla
XBROWSER=       mozilla
X.endif
X.else
XBROWSER=
XMAKE_MOZILLA=
X.endif
X
X.if defined(WITHOUT_CAIRO)
XMAKE_CAIRO=
X.else
XLIB_DEPENDS=   cairo.2:${PORTSDIR}/graphics/cairo
XMAKE_CAIRO=    make_cairo
XPLIST_FILES+=  lib/libswt-cairo-gtk-%%BUILD%%.so
X.endif
X
X.if defined(WITHOUT_GNOMEVFS)
XMAKE_GNOME=
XUSE_GNOME=     gtk20 pkgconfig
X.else
XMAKE_GNOME=    make_gnome
XUSE_GNOME=     gtk20 gnomevfs2 libgnome libgnomeui pkgconfig
XPLIST_FILES+=  lib/libswt-gnome-gtk-%%BUILD%%.so
X.endif
X
X.include <bsd.port.pre.mk>
X
X.if (${ARCH} == "amd64")
XWRK-EXT=       gtk-linux-x86_64
XDISTNAME=      swt-${PORTVERSION}-${WRK-EXT}
X.else
XWRK-EXT=       gtk-linux-x86
XDISTNAME=      swt-${PORTVERSION}-${WRK-EXT}
X.endif
X
XMAKE_ENV+=     BROWSER="${BROWSER}" \
X               JAVA_HOME="${JAVA_HOME}" \
X               MAKE_GNOME=${MAKE_GNOME} \
X               MAKE_MOZILLA=${MAKE_MOZILLA} \
X               MAKE_CAIRO=${MAKE_CAIRO} \
X               MACHINE_ARCH=${MACHINE_ARCH}
X
XWRKSRC= ${WRKDIR}/swt-I20051215-1506-${WRK-EXT}
X
Xpost-extract:
X       @echo ${WRKSRC}
X       @(cd ${WRKSRC} && ${UNZIP_CMD} -qo "*.zip")
X       @${CP} ${WRKSRC}/make_linux.mak ${WRKSRC}/make_freebsd.mak
X
Xdo-build:
X       @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${ANT} -Doutput.jar=${OUTPUT_JAR} clean all)
X
Xdo-install:
X       ${MKDIR} ${JAVAJARDIR}
X       ${INSTALL_DATA} ${WRKSRC}/libswt-*.so ${PREFIX}/lib
X       ${INSTALL_DATA} ${WRKSRC}/${OUTPUT_JAR} ${JAVAJARDIR}/
X
X.include <bsd.port.post.mk>
END-of-swt32/Makefile
echo x - swt32/distinfo
sed 's/^X//' >swt32/distinfo << 'END-of-swt32/distinfo'
XMD5 (swt-3.2M4-gtk-linux-x86_64.zip) = f2ee0e6c203ef7736d213febc775b999
XSHA256 (swt-3.2M4-gtk-linux-x86_64.zip) = 6c5596befdb8953c6aaaf9c2acf31d67612604cf4d12581b92eb822cf0c27c5e
XSIZE (swt-3.2M4-gtk-linux-x86_64.zip) = 2922260
XMD5 (swt-3.2M4-gtk-linux-x86.zip) = 72c1aaa9a1afb5557c8afed53b0957a6
XSHA256 (swt-3.2M4-gtk-linux-x86.zip) = 477383f3299a5ab08a505e0c170a0f83abefe1e6de4c720ac567cebbbf4d3133
XSIZE (swt-3.2M4-gtk-linux-x86.zip) = 2863571
X
END-of-swt32/distinfo
echo x - swt32/pkg-descr
sed 's/^X//' >swt32/pkg-descr << 'END-of-swt32/pkg-descr'
XSWT is the software component that delivers native widget functionality
Xfor the Eclipse platform in an operating system independent manner.
X
XThis port provides SWT without requiring a full download and build of
XEclipse.
X
XWWW:   http://www.eclipse.org/swt/
END-of-swt32/pkg-descr
exit

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list