View | Details | Raw Unified | Return to bug 244585 | Differences between
and this patch

Collapse All | Expand All

(-)swt414/Makefile (-43 / +12 lines)
Lines 1-77 Link Here
1
# Created by: Robert C. Noland III <rnoland@FreeBSD.org>
1
# Created by: Robert C. Noland III <rnoland@FreeBSD.org>
2
# $FreeBSD: head/x11-toolkits/swt/Makefile 518482 2019-11-26 21:46:12Z jkim $
2
# $FreeBSD: head/x11-toolkits/swt/Makefile 498679 2019-04-11 20:32:53Z antoine $
3
3
4
PORTNAME=	swt
4
PORTNAME=	swt
5
DISTVERSION=	4.7.3a
5
DISTVERSION=	4.14
6
CATEGORIES=	x11-toolkits devel java
6
CATEGORIES=	x11-toolkits devel java
7
MASTER_SITES=	http://archive.eclipse.org/eclipse/downloads/drops4/R-${DISTVERSION}-201803300640/
7
MASTER_SITES=	http://archive.eclipse.org/eclipse/downloads/drops4/R-${DISTVERSION}-201912100610/
8
DISTNAME=	swt-${DISTVERSION}-${DIST_EXT}
8
DISTNAME=	swt-${DISTVERSION}-${DIST_EXT}
9
DIST_EXT=	gtk-linux-x86_64
9
10
10
MAINTAINER=	ports@FreeBSD.org
11
MAINTAINER=	ports@FreeBSD.org
11
COMMENT=	Standard Widget Toolkit for Java
12
COMMENT=	Standard Widget Toolkit for Java
12
13
13
LICENSE=	EPL
14
LICENSE=	EPL
14
15
15
ONLY_FOR_ARCHS=	amd64 i386
16
ONLY_FOR_ARCHS=	amd64
16
BROKEN_i386=	missing distinfo
17
17
18
USES=		gl gnome pkgconfig zip:infozip xorg
18
LIB_DEPENDS=	libwebkit2gtk-4.0.so:www/webkit2-gtk3
19
USES=		gmake pkgconfig gnome zip:infozip
19
20
20
SWT_VERSION=	4763
21
SWT_VERSION=	4930r7
21
OUTPUT_JAR=	swt.jar
22
OUTPUT_JAR=	swt.jar
22
23
23
USE_GL=		glu gl
24
USE_GNOME=	gtk30
24
USE_GNOME=	gtk20
25
USE_JAVA=	yes
25
USE_JAVA=	yes
26
USE_XORG=	xtst
26
JAVA_VERSION=	1.8+
27
JAVA_OS=	native
27
JAVA_OS=	native
28
USE_ANT=	yes
28
USE_ANT=	yes
29
MAKE_ARGS+=	-Doutput.jar=${OUTPUT_JAR}
29
MAKE_ARGS+=	-Doutput.jar=${OUTPUT_JAR}
30
MAKEFILE=	make_freebsd.mak
30
MAKEFILE=	make_linux.mak
31
USE_LDCONFIG=	yes
31
USE_LDCONFIG=	yes
32
PLIST_SUB=	BUILD=${SWT_VERSION}
32
PLIST_SUB=	BUILD=${SWT_VERSION}
33
PLIST_FILES=	${JAVAJARDIR}/${OUTPUT_JAR} \
33
PLIST_FILES=	${JAVAJARDIR}/${OUTPUT_JAR}
34
		lib/libswt-atk-gtk-${SWT_VERSION}.so \
35
		lib/libswt-awt-gtk-${SWT_VERSION}.so \
36
		lib/libswt-gtk-${SWT_VERSION}.so \
37
		lib/libswt-glx-gtk-${SWT_VERSION}.so \
38
		lib/libswt-pi-gtk-${SWT_VERSION}.so
39
34
40
NO_WRKSUBDIR=	yes
35
NO_WRKSUBDIR=	yes
41
36
42
OPTIONS_DEFINE=	CAIRO
43
OPTIONS_DEFAULT=	CAIRO
44
45
.include <bsd.port.options.mk>
46
47
.if ${PORT_OPTIONS:MCAIRO}
48
LIB_DEPENDS+=	libcairo.so:graphics/cairo
49
PLIST_FILES+=	lib/libswt-cairo-gtk-${SWT_VERSION}.so
50
MAKE_CAIRO=	make_cairo
51
.endif
52
53
MAKE_ENV+=	MAKE_CAIRO=${MAKE_CAIRO} \
54
		MAKE_MOZILLA=${MAKE_MOZILLA} \
55
		JAVA_HOME=${JAVA_HOME}
56
57
.if (${ARCH} == "amd64")
58
DIST_EXT=	gtk-linux-x86_64
59
.else
60
DIST_EXT=	gtk-linux-x86
61
.endif
62
63
post-extract:
37
post-extract:
64
	@(cd ${WRKSRC} && ${UNZIP_CMD} -qo "*.zip")
38
	@(cd ${WRKSRC} && ${UNZIP_CMD} -qo "*.zip")
65
	@${RM} ${WRKSRC}/*.o ${WRKSRC}/*.so ${WRKSRC}/*.jar
39
	@${RM} ${WRKSRC}/*.o ${WRKSRC}/*.so ${WRKSRC}/*.jar
66
	@${CP} ${FILESDIR}/build.xml ${WRKSRC}/build.xml
40
	@${CP} ${FILESDIR}/build.xml ${WRKSRC}/build.xml
67
41
68
post-patch:
69
	${SED} -e 's|freebsd|dragonfly|g' ${WRKSRC}/make_freebsd.mak \
70
		> ${WRKSRC}/make_dragonfly.mak
71
72
do-install:
42
do-install:
73
	@${MKDIR} ${STAGEDIR}${JAVAJARDIR}
43
	@${MKDIR} ${STAGEDIR}${JAVAJARDIR}
74
	${INSTALL_LIB} ${WRKSRC}/libswt-*.so ${STAGEDIR}${PREFIX}/lib
75
	${INSTALL_DATA} ${WRKSRC}/${OUTPUT_JAR} ${STAGEDIR}${JAVAJARDIR}/
44
	${INSTALL_DATA} ${WRKSRC}/${OUTPUT_JAR} ${STAGEDIR}${JAVAJARDIR}/
76
45
77
.include <bsd.port.mk>
46
.include <bsd.port.mk>
(-)swt414/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1530093075
1
TIMESTAMP = 1583023230
2
SHA256 (swt-4.7.3a-gtk-linux-x86_64.zip) = 856005feff25de55f7d7b304d2cbed9dd24938c7b6d07ffd7413b8361a4753e3
2
SHA256 (swt-4.14-gtk-linux-x86_64.zip) = 442fdae96b0a75ffe3d753fd3394113630766050cd2390e92a83ade17ceac08b
3
SIZE (swt-4.7.3a-gtk-linux-x86_64.zip) = 6360885
3
SIZE (swt-4.14-gtk-linux-x86_64.zip) = 3898527
(-)swt414/files/build.xml (-3 / +4 lines)
Lines 9-22 Link Here
9
    Contributors:
9
    Contributors:
10
        IBM Corporation - initial API and implementation
10
        IBM Corporation - initial API and implementation
11
 -->
11
 -->
12
<project name="org.eclipse.swt.gtk.freebsd.x86_64" default="build.jar" basedir=".">
12
<project name="org.eclipse.swt.gtk.freebsd.amd64" default="build.jar" basedir=".">
13
13
14
	<target name="init">
14
	<target name="init">
15
		<property name="ws" value="gtk"/>
15
		<property name="ws" value="gtk"/>
16
		<property name="os" value="freebsd"/>
16
		<property name="os" value="freebsd"/>
17
		<property name="destination" value="${basedir}"/>
17
		<property name="destination" value="${basedir}"/>
18
                <property name="javac.verbose" value="false"/>
18
                <property name="javac.verbose" value="false"/>
19
                <property name="javac.debug" value="off"/>
19
                <property name="javac.debug" value="on"/>
20
		<property name="input.srcdir" value="${basedir}/org"/>
20
		<property name="input.srcdir" value="${basedir}/org"/>
21
		<property name="output.jar" value="${basedir}/swt.jar"/>
21
		<property name="output.jar" value="${basedir}/swt.jar"/>
22
		<property name="output.classes" value="${basedir}/classes"/>
22
		<property name="output.classes" value="${basedir}/classes"/>
Lines 38-49 Link Here
38
			<fileset dir="${output.classes}">
38
			<fileset dir="${output.classes}">
39
				<exclude name="**/*.java"/>
39
				<exclude name="**/*.java"/>
40
				<exclude name="**/*.o"/>
40
				<exclude name="**/*.o"/>
41
				<exclude name="**/*.so"/>
42
				<!-- exclude CVS archive -->
41
				<!-- exclude CVS archive -->
43
				<exclude name="**/CVS/**"/>
42
				<exclude name="**/CVS/**"/>
44
			</fileset>
43
			</fileset>
45
			<fileset dir="${basedir}">
44
			<fileset dir="${basedir}">
46
				<include name="**/version.txt"/>
45
				<include name="**/version.txt"/>
46
				<include name="**/*.css"/>
47
				<include name="**/*.so"/>
47
				<include name="**/*.properties"/>
48
				<include name="**/*.properties"/>
48
			</fileset>
49
			</fileset>
49
		</jar>
50
		</jar>
(-)swt414/files/patch-OS.java (-26 lines)
Lines 1-26 Link Here
1
--- org/eclipse/swt/internal/gtk/OS.java.orig	2018-03-01 07:35:24.000000000 +0100
2
+++ org/eclipse/swt/internal/gtk/OS.java	2018-06-27 11:17:53.291216000 +0200
3
@@ -20,19 +20,20 @@
4
 
5
 public class OS extends C {
6
 	/** OS Constants */
7
-	public static final boolean IsAIX, IsSunOS, IsLinux, IsHPUX, IsWin32, BIG_ENDIAN;
8
+	public static final boolean IsAIX, IsSunOS, IsLinux, IsHPUX, IsWin32, BIG_ENDIAN, IsFreeBSD;
9
 	static {
10
 
11
 		/* Initialize the OS flags and locale constants */
12
 		String osName = System.getProperty ("os.name");
13
-		boolean isAIX = false, isSunOS = false, isLinux = false, isHPUX = false, isWin32 = false;
14
+		boolean isAIX = false, isSunOS = false, isLinux = false, isHPUX = false, isWin32 = false, isFreeBSD = false;
15
 		if (osName.equals ("Linux")) isLinux = true;
16
 		if (osName.equals ("AIX")) isAIX = true;
17
 		if (osName.equals ("Solaris")) isSunOS = true;
18
 		if (osName.equals ("SunOS")) isSunOS = true;
19
 		if (osName.equals ("HP-UX")) isHPUX = true;
20
 		if (osName.startsWith("Windows")) isWin32 = true;
21
-		IsAIX = isAIX;  IsSunOS = isSunOS;  IsLinux = isLinux;  IsHPUX = isHPUX; IsWin32 = isWin32;
22
+		if (osName.equals ("FreeBSD")) isFreeBSD = true;
23
+		IsAIX = isAIX;  IsSunOS = isSunOS;  IsLinux = isLinux;  IsHPUX = isHPUX; IsWin32 = isWin32;  IsFreeBSD = isFreeBSD;
24
 
25
 		byte[] buffer = new byte[4];
26
 		long /*int*/ ptr = OS.malloc(4);
(-)swt414/files/patch-build.sh (-75 / +58 lines)
Lines 1-84 Link Here
1
--- build.sh.orig	2018-03-01 07:35:22.000000000 +0100
1
--- build.sh.orig	2019-12-09 22:30:04 UTC
2
+++ build.sh	2018-06-27 11:24:43.371971000 +0200
2
+++ build.sh
3
@@ -115,9 +115,19 @@
3
@@ -72,7 +72,7 @@ echo -e "${RED}*** ${@}${NC}"
4
 			fi
4
 
5
 		fi
5
 cd `dirname $0`
6
 
7
-MAKE_TYPE=make
8
+MAKE_TYPE=gmake
9
 
10
 export CFLAGS='-O -Wall -fPIC'
11
 
12
@@ -86,21 +86,14 @@ case $OS in
13
 		MAKEFILE=make_win32.mak
6
 		;;
14
 		;;
7
+	"DragonFly")
15
 	*)
8
+		SWT_OS=dragonfly
16
-		SWT_OS=`uname -s | tr -s '[:upper:]' '[:lower:]'`
9
+		MAKEFILE=make_dragonfly.mak
17
+		SWT_OS=`uname -s | tr '[:upper:]' '[:lower:]'`
10
+		if uname -p > /dev/null 2>&1; then
18
 		MAKEFILE=make_linux.mak
11
+			MODEL=`uname -p`
12
+		fi
13
+		;;
14
 	"FreeBSD")
15
 		SWT_OS=freebsd
16
 		MAKEFILE=make_freebsd.mak
17
+		if uname -p > /dev/null 2>&1; then
18
+			MODEL=`uname -p`
19
+		fi
20
 		;;
19
 		;;
21
 	"Windows_NT")
20
 esac
22
 		SWT_OS=win32
23
@@ -469,10 +479,10 @@
24
 
21
 
22
 # Determine which CPU type we are building for
23
 if [ "${MODEL}" = "" ]; then
24
-	if uname -i > /dev/null 2>&1; then
25
-		MODEL=`uname -i`
26
-		if [ ${MODEL} = 'unknown' ]; then
27
-		  MODEL=`uname -m`
28
-		fi
29
-	else
30
 		MODEL=`uname -m`
31
-	fi
32
 fi
33
 case $MODEL in
34
 	"x86_64")
35
@@ -111,6 +104,11 @@ case $MODEL in
36
 		SWT_ARCH=x86
37
 		AWT_ARCH=i386
38
 		;;
39
+	"powerpc" | "powerpc64")
40
+		SWT_ARCH=ppc64
41
+		AWT_ARCH=ppc64
42
+		MODEL=`uname -p`
43
+		;;
44
 	*)
45
 		SWT_ARCH=$MODEL
46
 		AWT_ARCH=$MODEL
47
@@ -194,7 +192,7 @@ esac
25
 
48
 
49
 
26
 # For 64-bit CPUs, we have a switch
50
 # For 64-bit CPUs, we have a switch
27
-if [ ${MODEL} = 'x86_64' -o ${MODEL} = 'ppc64' -o ${MODEL} = 'ia64' -o ${MODEL} = 'sparcv9'  -o ${MODEL} = 's390x' -o ${MODEL} = 'ppc64le' -o ${MODEL} = 'aarch64' ]; then
51
-if [ ${MODEL} = 'x86_64' -o ${MODEL} = 'ia64' -o ${MODEL} = 's390x' -o ${MODEL} = 'ppc64le' -o ${MODEL} = 'aarch64' ]; then
28
+if [ ${MODEL} = 'x86_64' -o ${MODEL} = 'ppc64' -o ${MODEL} = 'ia64' -o ${MODEL} = 'sparcv9'  -o ${MODEL} = 's390x' -o ${MODEL} = 'ppc64le' -o ${MODEL} = 'aarch64'  -o ${MODEL} = 'amd64' ]; then
52
+if [ ${MODEL} = 'amd64' -o ${MODEL} = 'ia64' -o ${MODEL} = 's390x' -o ${MODEL} = 'ppc64le' -o ${MODEL} = 'aarch64' -o ${MODEL} = 'powerpc64' ]; then
29
 	SWT_PTR_CFLAGS=-DJNI64
53
 	SWT_PTR_CFLAGS=-DJNI64
30
 	if [ -d /lib64 ]; then
54
 	if [ -d /lib64 ]; then
31
-		XLIB64=-L/usr/X11R6/lib64
55
 		XLIB64=-L/usr/X11R6/lib64
32
+		XLIB64=-L${LOCALBASE}/lib64
56
@@ -205,6 +203,11 @@ if [ ${MODEL} = 'x86_64' -o ${MODEL} = 'ia64' -o ${MOD
33
 		export XLIB64
57
 		XLIB64="${XLIB64} -L/usr/lib64"
58
 		SWT_LFLAGS=-m64
59
 		export SWT_LFLAGS
60
+	fi
61
+	if [ ${SWT_OS} = "freebsd" ]
62
+	then
63
+		SWT_PTR_CFLAGS="${SWT_PTR_CFLAGS} -m64"
64
+		export SWT_LFLAGS=-m64
34
 	fi
65
 	fi
35
 	if [ ${MODEL} = 'ppc64' -o ${MODEL} = 'ppc64le' ]; then
66
 	export SWT_PTR_CFLAGS
36
@@ -517,37 +527,24 @@
37
 	export SWT_LFLAGS SWT_PTR_CFLAGS
38
 fi
67
 fi
39
 
40
-
41
+if [ x${MAKE_CAIRO} = "xmake_cairo" ]; then
42
 if [ x`pkg-config --exists cairo && echo YES` = "xYES" ]; then
43
 	func_echo_plus "Cairo found, compiling SWT support for the cairo graphics library."
44
 	MAKE_CAIRO=make_cairo
45
 else
46
 	func_echo_error "Cairo not found: Advanced graphics support using cairo will not be compiled."
47
 fi
48
+fi
49
 
50
-if [ -z "${MOZILLA_INCLUDES}" -a -z "${MOZILLA_LIBS}" -a ${SWT_OS} != 'solaris' ]; then
51
-	if [ x`pkg-config --exists mozilla-xpcom && echo YES` = "xYES" ]; then
52
-		MOZILLA_INCLUDES=`pkg-config --cflags mozilla-xpcom`
53
-		MOZILLA_LIBS=`pkg-config --libs mozilla-xpcom`
54
-		export MOZILLA_INCLUDES
55
-		export MOZILLA_LIBS
56
-		MAKE_MOZILLA=make_mozilla
57
-	elif [ x`pkg-config --exists firefox-xpcom && echo YES` = "xYES" ]; then
58
-		MOZILLA_INCLUDES=`pkg-config --cflags firefox-xpcom`
59
-		MOZILLA_LIBS=`pkg-config --libs firefox-xpcom`
60
-		export MOZILLA_INCLUDES
61
-		export MOZILLA_LIBS
62
-		MAKE_MOZILLA=make_mozilla
63
-	elif [ x`pkg-config --exists libxul && echo YES` = "xYES" ]; then
64
-		XULRUNNER_INCLUDES=`pkg-config --cflags libxul`
65
-		XULRUNNER_LIBS=`pkg-config --libs libxul`
66
-		export XULRUNNER_INCLUDES
67
-		export XULRUNNER_LIBS
68
-		MAKE_MOZILLA=make_xulrunner
69
-	else
70
-		func_echo_error "None of the following libraries were found:  Mozilla/XPCOM, Firefox/XPCOM, or XULRunner/XPCOM:"
71
-		func_echo_error "   >> Mozilla embedding support will not be compiled."
72
-	fi
73
+if [ x${MAKE_MOZILLA} = "xmake_xulrunner" ]; then
74
+	echo "Using libxul for gecko support"
75
+	XULRUNNER_INCLUDES=`pkg-config --cflags libxul libxul-embedding`
76
+	XULRUNNER_LIBS=`pkg-config --libs libxul libxul-embedding`
77
+	export XULRUNNER_INCLUDES
78
+	export XULRUNNER_LIBS
79
+else
80
+	echo "None of the following libraries were found:  XULRunner/XPCOM"
81
+	echo "    *** Mozilla embedding support will not be compiled."
82
 fi
83
 
84
 # Find AWT if available
(-)swt414/files/patch-make__linux.mak (+46 lines)
Line 0 Link Here
1
--- make_linux.mak.orig	2019-12-09 22:30:04 UTC
2
+++ make_linux.mak
3
@@ -101,16 +101,18 @@ ATK_OBJECTS = swt.o atk.o atk_structs.o atk_custom.o a
4
 WEBKIT_OBJECTS = swt.o webkitgtk.o webkitgtk_structs.o webkitgtk_stats.o webkitgtk_custom.o
5
 GLX_OBJECTS = swt.o glx.o glx_structs.o glx_stats.o
6
 
7
+port_prefix=`pkg-config --variable=prefix gtk+-3.0`
8
 CFLAGS := $(CFLAGS) \
9
 		-DSWT_VERSION=$(SWT_VERSION) \
10
 		$(NATIVE_STATS) \
11
 		$(SWT_DEBUG) \
12
 		$(SWT_WEBKIT_DEBUG) \
13
-		-DLINUX -DGTK \
14
+		-DFREEBSD -DGTK \
15
+		-I$(port_prefix)/include \
16
 		-I$(JAVA_HOME)/include \
17
-		-I$(JAVA_HOME)/include/linux \
18
+		-I$(JAVA_HOME)/include/freebsd \
19
 		${SWT_PTR_CFLAGS}
20
-LFLAGS = -shared -fPIC ${SWT_LFLAGS}
21
+LFLAGS = -shared -fPIC -m64 ${SWT_LFLAGS} -L$(port_prefix)/lib
22
 
23
 ifndef NO_STRIP
24
 	# -s = Remove all symbol table and relocation information from the executable.
25
@@ -217,7 +219,10 @@ webkitgtk_custom.o: webkitgtk_custom.c
26
 make_webkit2extension: $(WEBKIT_EXTENSION_LIB)
27
 
28
 $(WEBKIT_EXTENSION_LIB) : webkitgtk_extension.o
29
+	@-[ -d $(WEBEXTENSION_DIR) ] || mkdir -v $(WEBEXTENSION_DIR)  # If folder does not exist, make it.
30
 	$(CC) $(LFLAGS) -o $@ $^ $(WEBKIT_EXTENSION_LFLAGS)
31
+	-mv $(WEBKIT_EXTENSION_LIB) $(WEBEXTENSION_DIR)/
32
+	
33
 
34
 webkitgtk_extension.o : webkitgtk_extension.c
35
 	$(CC) $(CFLAGS) $(WEBKIT_EXTENSION_CFLAGS) ${SWT_PTR_CFLAGS} -fPIC -c $^
36
@@ -253,10 +258,6 @@ install: all
37
 	cp $(ALL_SWT_LIBS) $(OUTPUT_DIR)
38
 ifeq ($(BUILD_WEBKIT2EXTENSION),yes)
39
 	@# Copy webextension into it's own folder, but create folder first.
40
-	@# CAREFULLY delete '.so' files inside webextension*. Then carefully remove the directories. 'rm -rf' seemed too risky of an approach.
41
-	@-[ "$$(ls -d $(OUTPUT_DIR)/$(WEBEXTENSION_BASE_DIR)*/*.so)" ] && rm -v `ls -d $(OUTPUT_DIR)/$(WEBEXTENSION_BASE_DIR)*/*.so`
42
-	@-[ "$$(ls -d $(OUTPUT_DIR)/$(WEBEXTENSION_BASE_DIR)*)" ] && rmdir -v `ls -d $(OUTPUT_DIR)/$(WEBEXTENSION_BASE_DIR)*`
43
-
44
 	@# Copying webextension is not critical for build to succeed, thus we use '-'. SWT can still function without a webextension.
45
 	@-[ -d $(OUTPUT_DIR)/$(WEBEXTENSION_DIR) ] || mkdir -v $(OUTPUT_DIR)/$(WEBEXTENSION_DIR)  # If folder does not exist, make it.
46
 	-cp $(WEBKIT_EXTENSION_LIB) $(OUTPUT_DIR)/$(WEBEXTENSION_DIR)/
(-)swt414/files/patch-make_freebsd.mak (-129 lines)
Lines 1-129 Link Here
1
--- make_freebsd.mak.orig	2018-03-01 07:35:22.000000000 +0100
2
+++ make_freebsd.mak	2018-06-27 11:33:21.105457000 +0200
3
@@ -9,7 +9,7 @@
4
 #     IBM Corporation - initial API and implementation
5
 #*******************************************************************************
6
 
7
-# Makefile for creating SWT libraries for Linux GTK
8
+# Makefile for creating SWT libraries for FreeBSD GTK
9
 
10
 include make_common.mak
11
 
12
@@ -43,7 +43,7 @@
13
 
14
 # Do not use pkg-config to get libs because it includes unnecessary dependencies (i.e. pangoxft-1.0)
15
 GTKCFLAGS = `pkg-config --cflags gtk+-2.0 gtk+-unix-print-$(GTK_VERSION)`
16
-GTKLIBS = `pkg-config --libs-only-L gtk+-2.0 gthread-2.0` -lgtk-x11-2.0 -lgthread-2.0 -L/usr/X11R6/lib $(XLIB64) -lXtst
17
+GTKLIBS = `pkg-config --libs-only-L gtk+-2.0 gthread-2.0` -lgtk-x11-2.0 -lgthread-2.0 -L$(LOCALBASE)/lib $(XLIB64) -lXtst
18
 
19
 AWT_LFLAGS = -shared
20
 AWT_LIBS = -L$(AWT_LIB_PATH) -ljawt
21
@@ -51,7 +51,8 @@
22
 ATKCFLAGS = `pkg-config --cflags atk gtk+-2.0 gtk+-unix-print-$(GTK_VERSION)`
23
 ATKLIBS = `pkg-config --libs-only-L atk gtk+-2.0` -latk-1.0 -lgtk-x11-2.0
24
 
25
-GLXLIBS = -L/usr/X11R6/lib -lGL -lGLU -lm
26
+GLXCFLAGS = -I$(LOCALBASE)/include
27
+GLXLIBS = -L$(LOCALBASE)/lib -lGL -lGLU -lm
28
 
29
 # Uncomment for Native Stats tool
30
 #NATIVE_STATS = -DNATIVE_STATS
31
@@ -70,14 +71,24 @@
32
 	-I$(JAVA_HOME)/include/freebsd \
33
 	${SWT_PTR_CFLAGS}
34
 MOZILLALFLAGS = -shared -Wl,--version-script=mozilla_exports -Bsymbolic
35
-	
36
+MOZILLAEXCLUDES = -DNO__1XPCOMGlueShutdown \
37
+	-DNO__1XPCOMGlueStartup \
38
+	-DNO__1XPCOMGlueLoadXULFunctions \
39
+	-DNO_memmove__ILorg_eclipse_swt_internal_mozilla_nsDynamicFunctionLoad_2I \
40
+	-DNO_memmove__JLorg_eclipse_swt_internal_mozilla_nsDynamicFunctionLoad_2J \
41
+	-DNO_nsDynamicFunctionLoad_1sizeof \
42
+	-DNO__1Call__IIIIII \
43
+	-DNO__1Call__JJJJJI \
44
+	-DNO_nsDynamicFunctionLoad
45
+XULRUNNEREXCLUDES = -DNO__1NS_1InitXPCOM2
46
+
47
 SWT_OBJECTS = swt.o c.o c_stats.o callback.o
48
 AWT_OBJECTS = swt_awt.o
49
 SWTPI_OBJECTS = swt.o os.o os_structs.o os_custom.o os_stats.o
50
 CAIRO_OBJECTS = swt.o cairo.o cairo_structs.o cairo_stats.o
51
 ATK_OBJECTS = swt.o atk.o atk_structs.o atk_custom.o atk_stats.o
52
 MOZILLA_OBJECTS = swt.o xpcom.o xpcom_custom.o xpcom_structs.o xpcom_stats.o
53
-XULRUNNER_OBJECTS = swt.o xpcomxul.o xpcomxul_custom.o xpcomxul_structs.o xpcomxul_stats.o xpcomxulglue.o xpcomxulglue_stats.o
54
+XULRUNNER_OBJECTS = swt.o xpcomxul.o xpcomxul_custom.o xpcomxul_structs.o xpcomxul_stats.o
55
 XPCOMINIT_OBJECTS = swt.o xpcominit.o xpcominit_structs.o xpcominit_stats.o
56
 GLX_OBJECTS = swt.o glx.o glx_structs.o glx_stats.o
57
 
58
@@ -85,17 +96,18 @@
59
 		-DSWT_VERSION=$(SWT_VERSION) \
60
 		$(NATIVE_STATS) \
61
 		-DFREEBSD -DGTK \
62
+		-I$(LOCALBASE)/include \
63
 		-I$(JAVA_HOME)/include \
64
 		-I$(JAVA_HOME)/include/freebsd \
65
 		-fPIC \
66
 		${SWT_PTR_CFLAGS}
67
 LFLAGS = -shared -fPIC
68
 
69
-ifndef NO_STRIP
70
-	AWT_LFLAGS := $(AWT_LFLAGS) -s
71
-	MOZILLALFLAGS := $(MOZILLALFLAGS) -s
72
-	LFLAGS := $(LFLAGS) -s
73
-endif
74
+.ifndef NO_STRIP
75
+AWT_LFLAGS := $(AWT_LFLAGS) -s
76
+MOZILLALFLAGS := $(MOZILLALFLAGS) -s
77
+LFLAGS := $(LFLAGS) -s
78
+.endif
79
 
80
 all: make_swt make_atk make_glx
81
 
82
@@ -173,16 +185,16 @@
83
 	$(CXX) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALFLAGS) ${MOZILLA_LIBS}
84
 
85
 xpcom.o: xpcom.cpp
86
-	$(CXX) $(MOZILLACFLAGS) ${MOZILLA_INCLUDES} -c xpcom.cpp
87
+	$(CXX) $(MOZILLACFLAGS) $(MOZILLAEXCLUDES) ${MOZILLA_INCLUDES} -c xpcom.cpp
88
 
89
 xpcom_structs.o: xpcom_structs.cpp
90
-	$(CXX) $(MOZILLACFLAGS) ${MOZILLA_INCLUDES} -c xpcom_structs.cpp
91
+	$(CXX) $(MOZILLACFLAGS) $(MOZILLAEXCLUDES) ${MOZILLA_INCLUDES} -c xpcom_structs.cpp
92
 	
93
 xpcom_custom.o: xpcom_custom.cpp
94
-	$(CXX) $(MOZILLACFLAGS) ${MOZILLA_INCLUDES} -c xpcom_custom.cpp
95
+	$(CXX) $(MOZILLACFLAGS) $(MOZILLAEXCLUDES) ${MOZILLA_INCLUDES} -c xpcom_custom.cpp
96
 
97
 xpcom_stats.o: xpcom_stats.cpp
98
-	$(CXX) $(MOZILLACFLAGS) ${MOZILLA_INCLUDES} -c xpcom_stats.cpp
99
+	$(CXX) $(MOZILLACFLAGS) $(MOZILLAEXCLUDES) ${MOZILLA_INCLUDES} -c xpcom_stats.cpp
100
 
101
 #
102
 # XULRunner lib
103
@@ -193,22 +205,16 @@
104
 	$(CXX) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
105
 
106
 xpcomxul.o: xpcom.cpp
107
-	$(CXX) -o xpcomxul.o $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcom.cpp
108
+	$(CXX) -o xpcomxul.o $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom.cpp
109
 
110
 xpcomxul_structs.o: xpcom_structs.cpp
111
-	$(CXX) -o xpcomxul_structs.o $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcom_structs.cpp
112
+	$(CXX) -o xpcomxul_structs.o $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom_structs.cpp
113
 	
114
 xpcomxul_custom.o: xpcom_custom.cpp
115
-	$(CXX) -o xpcomxul_custom.o $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcom_custom.cpp
116
+	$(CXX) -o xpcomxul_custom.o $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom_custom.cpp
117
 
118
 xpcomxul_stats.o: xpcom_stats.cpp
119
-	$(CXX) -o xpcomxul_stats.o $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcom_stats.cpp
120
-
121
-xpcomxulglue.o: xpcomglue.cpp
122
-	$(CXX) -o xpcomxulglue.o $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcomglue.cpp
123
-
124
-xpcomxulglue_stats.o: xpcomglue_stats.cpp
125
-	$(CXX) -o xpcomxulglue_stats.o $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcomglue_stats.cpp
126
+	$(CXX) -o xpcomxul_stats.o $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom_stats.cpp
127
 
128
 #
129
 # XPCOMInit lib
(-)swt414/files/patch-org_eclipse_swt_internal_Library.java (+16 lines)
Line 0 Link Here
1
--- org/eclipse/swt/internal/Library.java.orig	2019-12-09 22:30:06 UTC
2
+++ org/eclipse/swt/internal/Library.java
3
@@ -69,12 +69,12 @@ static {
4
 static String arch() {
5
 	String osArch = System.getProperty("os.arch"); //$NON-NLS-1$
6
 	if (osArch.equals ("i386") || osArch.equals ("i686")) return "x86"; //$NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$
7
-	if (osArch.equals ("amd64")) return "x86_64"; //$NON-NLS-1$ $NON-NLS-2$
8
 	return osArch;
9
 }
10
 
11
 static String os() {
12
 	String osName = System.getProperty("os.name"); //$NON-NLS-1$
13
+	if (osName.equals ("FreeBSD")) return "freebsd"; //$NON-NLS-1$ $NON-NLS-2$
14
 	if (osName.equals ("Linux")) return "linux"; //$NON-NLS-1$ $NON-NLS-2$
15
 	if (osName.equals ("Mac OS X")) return "macosx"; //$NON-NLS-1$ $NON-NLS-2$
16
 	if (osName.startsWith ("Win")) return "win32"; //$NON-NLS-1$ $NON-NLS-2$
(-)swt414/files/patch-org_eclipse_swt_internal_gtk_OS.java (+13 lines)
Line 0 Link Here
1
--- org/eclipse/swt/internal/gtk/OS.java.orig	2019-12-09 22:30:06 UTC
2
+++ org/eclipse/swt/internal/gtk/OS.java
3
@@ -60,8 +60,8 @@ public class OS extends C {
4
 
5
 		/* Initialize the OS flags and locale constants */
6
 		String osName = System.getProperty ("os.name");
7
-		boolean isLinux = false, isWin32 = false;
8
-		if (osName.equals ("Linux")) isLinux = true;
9
+		boolean isLinux = osName.equals ("Linux") || osName.equals ("FreeBSD");
10
+		boolean isWin32 = false;
11
 		if (osName.startsWith("Windows")) isWin32 = true;
12
 		IsLinux = isLinux;  IsWin32 = isWin32;
13
 
(-)swt414/files/patch-org_eclipse_swt_internal_gtk_swt__functional__gtk__3__20.css (+17 lines)
Line 0 Link Here
1
--- org/eclipse/swt/internal/gtk/swt_functional_gtk_3_20.css.orig	2020-03-01 01:03:01 UTC
2
+++ org/eclipse/swt/internal/gtk/swt_functional_gtk_3_20.css
3
@@ -0,0 +1,13 @@
4
+@binding-set SWTTreeViewBinding {
5
+	bind "Left" { "expand-collapse-cursor-row" (0,0,0)};
6
+	bind "Right" { "expand-collapse-cursor-row" (0,1,0)};
7
+}
8
+
9
+treeview {
10
+	-gtk-key-bindings: SWTTreeViewBinding;
11
+}
12
+
13
+scrolledwindow undershoot.top, scrolledwindow undershoot.right,
14
+	scrolledwindow undershoot.bottom, scrolledwindow undershoot.left {
15
+	background-image: none;
16
+}
17
\ No newline at end of file
(-)swt414/files/patch-org_eclipse_swt_internal_gtk_swt__functional__gtk__pre__3__20.css (+17 lines)
Line 0 Link Here
1
--- org/eclipse/swt/internal/gtk/swt_functional_gtk_pre_3_20.css.orig	2020-03-01 01:03:01 UTC
2
+++ org/eclipse/swt/internal/gtk/swt_functional_gtk_pre_3_20.css
3
@@ -0,0 +1,13 @@
4
+/* These CSS fixes have 'functinal' impact, no visual impact. E.g allow keyboard navigation in trees etc.. */
5
+.undershoot.top, .undershoot.right, .undershoot.bottom, .undershoot.lef	{
6
+	background-image: none;
7
+}
8
+
9
+@binding-set SWTTreeViewBinding {
10
+	bind "Left" { "expand-collapse-cursor-row" (0,0,0)};
11
+	bind "Right" {"expand-collapse-cursor-row" (0,1,0)};
12
+}
13
+
14
+GtkTreeView {
15
+	gtk-key-bindings: SWTTreeViewBinding;
16
+}
17
\ No newline at end of file
(-)swt414/files/patch-org_eclipse_swt_internal_gtk_swt__theming__fixes__gtk__3__20.css (+28 lines)
Line 0 Link Here
1
--- org/eclipse/swt/internal/gtk/swt_theming_fixes_gtk_3_20.css.orig	2020-03-01 01:03:01 UTC
2
+++ org/eclipse/swt/internal/gtk/swt_theming_fixes_gtk_3_20.css
3
@@ -0,0 +1,25 @@
4
+toolbar {
5
+	padding-top: 2px;
6
+	padding-bottom: 2px;
7
+}
8
+
9
+toolbar button {
10
+	padding: 2px;
11
+}
12
+
13
+toolbar button.popup {
14
+	padding: 0px;
15
+}
16
+
17
+toolbar toolbutton button {
18
+	padding: 0px 0px 0px 0px;
19
+}
20
+
21
+entry {
22
+	min-height: 26px;
23
+}
24
+
25
+tab {
26
+	padding-left: 6px;
27
+	padding-right: 6px;
28
+}
(-)swt414/files/patch-org_eclipse_swt_internal_gtk_swt__theming__fixes__gtk__3__24__5.css (+6 lines)
Line 0 Link Here
1
--- org/eclipse/swt/internal/gtk/swt_theming_fixes_gtk_3_24_5.css.orig	2020-03-01 01:03:01 UTC
2
+++ org/eclipse/swt/internal/gtk/swt_theming_fixes_gtk_3_24_5.css
3
@@ -0,0 +1,3 @@
4
+button {
5
+	padding: 4px 8px;
6
+}
(-)swt414/files/patch-org_eclipse_swt_internal_gtk_swt__theming__fixes__gtk__pre__3__20.css (+19 lines)
Line 0 Link Here
1
--- org/eclipse/swt/internal/gtk/swt_theming_fixes_gtk_pre_3_20.css.orig	2020-03-01 01:03:01 UTC
2
+++ org/eclipse/swt/internal/gtk/swt_theming_fixes_gtk_pre_3_20.css
3
@@ -0,0 +1,15 @@
4
+/* These have an impact on visual aspects of SWT. Padding etc.. 
5
+   There should not be hard-coded color fixes because this can break dark variants of themes.
6
+   Instead either use OS.setDarkThemePreferred() if your theme has dark version or style manually via api */
7
+GtkToolbar {
8
+	padding-top: 2px;
9
+	padding-bottom: 2px;
10
+}
11
+
12
+GtkToolbar GtkButton {
13
+	padding: 2px 4px 2px 4px;
14
+}
15
+
16
+GtkToolbar GtkMenuButton {
17
+	padding: 1px 0px 1px 0px;
18
+}
19
\ No newline at end of file
(-)swt414/files/patch-os.c (-20 lines)
Lines 1-20 Link Here
1
--- os.c.orig	2008-12-31 16:16:39.000000000 -0500
2
+++ os.c	2008-12-31 16:20:29.000000000 -0500
3
@@ -18036,11 +18036,16 @@
4
 	jintLong rc = 0;
5
 	OS_NATIVE_ENTER(env, that, realpath_FUNC);
6
 	if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
7
-	if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
8
+	if (arg1) {
9
+	    if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
10
+	} else
11
+	    lparg1 = malloc(PATH_MAX);
12
 	rc = (jintLong)realpath((const char *)lparg0, (char *)lparg1);
13
 fail:
14
 	if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
15
 	if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
16
+	if (!arg1 && lparg1 && rc == 0)
17
+	    free(lparg1);
18
 	OS_NATIVE_EXIT(env, that, realpath_FUNC);
19
 	return rc;
20
 }

Return to bug 244585