diff options
author | Alexander Kurtakov | 2018-09-11 05:55:20 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2018-09-11 05:56:51 +0000 |
commit | b2672e8a696ec09fd75d22aa0f2f00de085b22bb (patch) | |
tree | b53115e671c489900fcdcc6e58965191bd71225a | |
parent | a2de774e7d3cf3b08fc9771167a4a592f6560184 (diff) | |
download | eclipse.platform.swt-b2672e8a696ec09fd75d22aa0f2f00de085b22bb.tar.gz eclipse.platform.swt-b2672e8a696ec09fd75d22aa0f2f00de085b22bb.tar.xz eclipse.platform.swt-b2672e8a696ec09fd75d22aa0f2f00de085b22bb.zip |
Bug 530841 - [GTK2] Remove GTK 2.x support
Drop build support for GTK 2.
Change-Id: I9c1c359d4635a9e28cd46ac042acdf07f2fbbbe6
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
7 files changed, 21 insertions, 240 deletions
diff --git a/bundles/org.eclipse.swt.tools/gtk/dynamic_gtk2_vs_gtk3.py b/bundles/org.eclipse.swt.tools/gtk/dynamic_gtk2_vs_gtk3.py deleted file mode 100755 index c1fd71a9a8..0000000000 --- a/bundles/org.eclipse.swt.tools/gtk/dynamic_gtk2_vs_gtk3.py +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/python3 -#******************************************************************************* -# Copyright (c) 2016 The Eclipse Foundation and others. -# -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# Rolf Theunissen - initial version, adapted from dynamic_deprecated.py -#******************************************************************************* - -import sys -import re -from urllib.request import urlopen -from html.parser import HTMLParser - -API_GTK2_STABLE_URL = "https://developer.gnome.org/gtk2/stable/api-index-full.html" -API_GTK3_0_URL = "https://developer.gnome.org/gtk3/3.0/api-index-full.html" -API_GTK3_STABLE_URL = "https://developer.gnome.org/gtk3/stable/api-index-full.html" -API_GTK3_DEPRECATED_URL = "https://developer.gnome.org/gtk3/stable/api-index-deprecated.html" - -OS_FILE = "./../../org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c" -FUNCTION_LIST = [] -GTK2_FUNCTION_LIST = [] -GTK30_FUNCTION_LIST = [] -GTK3x_FUNCTION_LIST = [] -GTK3x_DEPR_FUNCTION_LIST = [] - -GTK2_GTK30_SHARED_FUNCTION_LIST = [] -GTK2_GTK3x_SHARED_FUNCTION_LIST = [] - -# This script is Python 3 only. -# -# USAGE OPTIONS: -# <no option specified>: prints list of deprecated dynamic functions to console. -# -f: writes the list of deprecated dynamic functions to a file called dynamic_deprecated_functions.txt. -# The file is in the same directory as the script - -def download_symbols(api_url): - # Fetch symbols from api_url - with urlopen(api_url) as url: - dep_file = url.read() - - return str(dep_file); - -def download_gtk2_stable_symbols(): - return download_symbols(API_GTK2_STABLE_URL); - -def download_gtk3_0_symbols(): - return download_symbols(API_GTK3_0_URL); - -def download_gtk3_stable_symbols(): - return download_symbols(API_GTK3_STABLE_URL); - -def download_gtk3_deprecated_symbols(): - return download_symbols(API_GTK3_DEPRECATED_URL); - -def populate_function_list(): - # Read os_custom.h from file - with open(OS_FILE) as f: - os_custom = f.read() - - return str(os_custom); - -def find_gtk_version_functions(custom_str, gtk2_str, gtk30_str, gtk3x_str, gtk3x_dpr_str): - regex = r"((GTK|GDK)_LOAD_FUNCTION\(fp, (\w+))+" - matchList = re.findall(regex, custom_str) - - # Search through list of regex matches, strip the "_LIB" and populate - # the dynamic function list. - for match in matchList: - function_name = match[2] - FUNCTION_LIST.append(function_name) - - # Check each dynamic function and see if it's deprecated: if so, populate - # the deprecated function list. - for func in FUNCTION_LIST: - func_tag = ">" + func + "<" - if func_tag in gtk2_str: - GTK2_FUNCTION_LIST.append(func) - if func_tag in gtk30_str: - GTK30_FUNCTION_LIST.append(func) - if func_tag in gtk3x_str: - GTK3x_FUNCTION_LIST.append(func) - if func_tag in gtk3x_dpr_str: - GTK3x_DEPR_FUNCTION_LIST.append(func) - return; - -def find_gtk2_and_gtk3_shared(): - for func in GTK2_FUNCTION_LIST: - if func in GTK30_FUNCTION_LIST: - GTK2_GTK30_SHARED_FUNCTION_LIST.append(func) - elif func in GTK30_FUNCTION_LIST: - GTK2_GTK3x_SHARED_FUNCTION_LIST.append(func) - - -if __name__ == "__main__": - gtk2functions = download_gtk2_stable_symbols() - gtk30functions = download_gtk3_0_symbols() - gtk3xfunctions = download_gtk3_stable_symbols() - gtk3xdeprecated = download_gtk3_deprecated_symbols() - - os_custom_str = populate_function_list() - - find_gtk_version_functions(os_custom_str, gtk2functions, gtk30functions, - gtk3xfunctions, gtk3xdeprecated) - - find_gtk2_and_gtk3_shared() - - # If the user specified the "-f" option, the output will be written to - # a file named "dynamic_deprecated_functions.txt" - if len(sys.argv) == 2 and "-f" in str(sys.argv): - with open("dynamic_gtk2x_gtk30_shared_functions.txt","w") as f: - for i in GTK2_GTK30_SHARED_FUNCTION_LIST: - if i in GTK3x_DEPR_FUNCTION_LIST: - f.write ("#") - f.write(i + "\n") - f.close() - with open("dynamic_gtk2x_gtk3x_shared_functions.txt","w") as f: - for i in GTK2_GTK3x_SHARED_FUNCTION_LIST: - if i in GTK3x_DEPR_FUNCTION_LIST: - f.write ("#") - f.write(i + "\n") - f.close() - # If no options are specified, print the list to console - else: - print ("# GTK2.x - GTK3.0 SHARED") - for i in GTK2_GTK30_SHARED_FUNCTION_LIST: - if i in GTK3x_DEPR_FUNCTION_LIST: - print("#" + i) - else: - print(i) - - print() - print ("# GTK2.x - GTK3.x SHARED") - for i in GTK2_GTK3x_SHARED_FUNCTION_LIST: - if i in GTK3x_DEPR_FUNCTION_LIST: - print("#" + i) - else: - print(i) - sys.exit(0) diff --git a/bundles/org.eclipse.swt.tools/gtk/install_sysdeps.sh b/bundles/org.eclipse.swt.tools/gtk/install_sysdeps.sh index e677ebbcfd..0b9fb087ca 100755 --- a/bundles/org.eclipse.swt.tools/gtk/install_sysdeps.sh +++ b/bundles/org.eclipse.swt.tools/gtk/install_sysdeps.sh @@ -39,12 +39,12 @@ func_configure_fedora () { func_echo_plus "Installing Java 8 development packages that include jni.h for JNI bindings. Update this script to '9' when java 9 comes out" sudo $INSTALL_CMD -y install java-1.8.0-openjdk-devel.x86_64 - func_echo_plus "Installing Gtk2 and Gtk3 development packages" - sudo $INSTALL_CMD -y install gtk3-devel gtk2-devel + func_echo_plus "Installing Gtk3 development packages" + sudo $INSTALL_CMD -y install gtk3-devel func_echo_plus "Installing X11 Development libraries. Someday when wayland takes over these will not be needed..." # Deals with error: "#include <X11/Intrinsic.h>, #include <X11/extensions/XTest.h>" build errors) - sudo $INSTALL_CMD -y install libXt-devel libXtst-devel + sudo $INSTALL_CMD -y install libXt-devel func_echo_plus "Install Mesa (OpenGL headers)" # Deals with error: "/usr/bin/ld: cannot find -lGLU collect2: error: ld returned 1 exit status" @@ -66,8 +66,8 @@ Consider updating this script for your distribution. In general, You should install the following packages: - C Development tools (usually comes in a 'group install') - java-*-openjdk-devel (depending on current version of java) - - gtk2-devel gtk3-devel - - libXt-devel libXts-devel + - gtk3-devel + - libXt-devel - mesa-libGLU-devel " diff --git a/bundles/org.eclipse.swt.tools/gtk/readme.md b/bundles/org.eclipse.swt.tools/gtk/readme.md index ca831337d6..5f8cfc8519 100644 --- a/bundles/org.eclipse.swt.tools/gtk/readme.md +++ b/bundles/org.eclipse.swt.tools/gtk/readme.md @@ -1,5 +1,5 @@ # About this folder -This folder contains gnome/gtk scripts to help SWT developers compile/analyze native code. +This folder contains gnome/gtk scripts to help SWT developers compile/analyze native code. The scripts in this folder are not used as part of the build process on a build server, but only during development work. diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh index a1e3f456b2..f9ab03d7a8 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh @@ -16,19 +16,10 @@ #******************************************************************************* HELP=" -Build Gtk2 or Gtk3 bindings and (optionally) copy them to binary repository. Paramaters (specified in this order): clean - delete *.o and *.so files from current folder. If this is the only paramater, do nothing else. But if other paramaters are given and this is the first one, then continue with other actions. -One of the following 3: --gtk2 : Build bindings with GTK2. --gtk3 : Build bindings with GTK3. --gtk-all : Build bindings with GTK2 as well as GTK3. Note, this flag triggers cleanups before each build - because a cleanup is required when buliding different GTK versions for linking to be done correctly. - During active development, if you only want to compile updated files, use -gtk2/-gtk3 flags instead, - however do not forget to do a cleanup in between gtk2/gtk3. - install - copy *.so libraries to binary repository. --print-outputdir-and-exit - This simply echos the OUTPUT folder where .so libs are copied to, @@ -36,14 +27,13 @@ install - copy *.so libraries to binary repository. -- Examples: Most commonly used: -./build.sh -gtk-all install -This will clean everything in your repository, build GTK2 and GTK3, then copy .so files to binary repository. +./build.sh install +This will clean everything in your repository, build and then copy .so files to binary repository. Also: ./build.sh - only build .so files, do not copy them across. Build according to what GTK_VERSION is set to. ./build.sh clean - clean working directory of *.o and *.so files. ./build.sh install - build.so files and copy to binary repository -./build.sh -gtk3 install - Build only updated files (or all), copy *.so libs to binary repository. Also note: Sometimes you might have to cleanup the binary repository manually as old *.so files are not automatically removed @@ -293,7 +283,7 @@ if [ "x${1}" = "xclean" ]; then shift # if there are no more other parameters, exit. - # don't exit if there are more paramaters. Useful for one-liners like: ./build.sh clean -gtk-all install + # don't exit if there are more paramaters. Useful for one-liners like: ./build.sh clean install if [ "$1" = "" ]; then exit $? fi @@ -325,41 +315,5 @@ func_build_gtk3 () { fi } -func_build_gtk2 () { - func_echo_plus "Building GTK2 bindings:" - export GTK_VERSION=2.0 - export BUILD_WEBKIT2EXTENSION="no"; - if [ ${MODEL} = 'x86_64' ]; then - # Bug 515155: Avoid memcpy@GLIBC_2.14 (old Linux compatibility) - SWT_PTR_CFLAGS="${SWT_PTR_CFLAGS} -fno-builtin-memmove" - fi - ${MAKE_TYPE} -f $MAKEFILE all $MAKE_CAIRO $MAKE_AWT "$@" - RETURN_VALUE=$? - if [ "$RETURN_VALUE" -eq 0 ]; then - func_echo_plus "GTK2 Build succeeded" - else - func_echo_error "GTK2 Build failed." - exit $RETURN_VALUE - fi -} - +func_build_gtk3 "$@" -if [ "$1" = "-gtk-all" ]; then - shift - func_echo_plus "Note: When building multiple GTK versions, a cleanup is required (and automatically performed) between them." - func_clean_up - func_build_gtk3 "$@" - func_clean_up - func_build_gtk2 "$@" -elif [ "$1" = "-gtk3" ]; then - shift - func_build_gtk3 "$@" -elif [ "$1" = "-gtk2" ]; then - shift - func_build_gtk2 "$@" -elif [ "${GTK_VERSION}" = "3.0" ]; then - func_build_gtk3 "$@" -elif [ "${GTK_VERSION}" = "2.0" -o "${GTK_VERSION}" = "" ]; then - export GTK_VERSION="2.0" - func_build_gtk2 "$@" -fi diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak index 55ab616041..61d71699d7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak @@ -27,17 +27,13 @@ endif include make_common.mak SWT_VERSION=$(maj_ver)$(min_ver) -GTK_VERSION?=2.0 +GTK_VERSION=3.0 # Define the various shared libraries to be build. WS_PREFIX = gtk SWT_PREFIX = swt AWT_PREFIX = swt-awt -ifeq ($(GTK_VERSION), 3.0) SWTPI_PREFIX = swt-pi3 -else -SWTPI_PREFIX = swt-pi -endif CAIRO_PREFIX = swt-cairo ATK_PREFIX = swt-atk WEBKIT_PREFIX = swt-webkit @@ -63,11 +59,7 @@ CAIROLIBS = `pkg-config --libs-only-L cairo` -lcairo # Do not use pkg-config to get libs because it includes unnecessary dependencies (i.e. pangoxft-1.0) GTKCFLAGS = `pkg-config --cflags gtk+-$(GTK_VERSION) gtk+-unix-print-$(GTK_VERSION)` -ifeq ($(GTK_VERSION), 3.0) GTKLIBS = `pkg-config --libs-only-L gtk+-$(GTK_VERSION) gthread-2.0` $(XLIB64) -L/usr/X11R6/lib -lgtk-3 -lgdk-3 -lcairo -lgthread-2.0 -else -GTKLIBS = `pkg-config --libs-only-L gtk+-$(GTK_VERSION) gthread-2.0` $(XLIB64) -L/usr/X11R6/lib -lgtk-x11-$(GTK_VERSION) -lgthread-2.0 -endif AWT_LFLAGS = -shared ${SWT_LFLAGS} AWT_LIBS = -L$(AWT_LIB_PATH) -ljawt @@ -192,7 +184,7 @@ atk_stats.o: atk_stats.c atk_structs.h atk_stats.h atk.h # WebKit lib # ifeq ($(BUILD_WEBKIT2EXTENSION),yes) -make_webkit: $(WEBKIT_LIB) make_webkit2extension #Webkit2 only used by gtk3. +make_webkit: $(WEBKIT_LIB) make_webkit2extension else make_webkit: $(WEBKIT_LIB) endif diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/makefile b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/makefile index 39451bdc33..63eef0c318 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/makefile +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/makefile @@ -4,16 +4,7 @@ # Build servers call build.sh directly. all: - ./build.sh -gtk-all install - -gtk3: - ./build.sh -gtk3 install - -gtk3-build-only: - ./build.sh -gtk3 - -gtk2: - ./build.sh -gtk2 install + ./build.sh install clean: ./build.sh clean diff --git a/bundles/org.eclipse.swt/buildSWT.xml b/bundles/org.eclipse.swt/buildSWT.xml index 1ea73e3cb7..ce834c8c36 100644 --- a/bundles/org.eclipse.swt/buildSWT.xml +++ b/bundles/org.eclipse.swt/buildSWT.xml @@ -62,15 +62,15 @@ <param name="fragment" value="org.eclipse.swt.cocoa.macosx.x86_64"/> </antcall> <antcall target="check_fragment_libraries"> - <param name="library_count" value="9"/> + <param name="library_count" value="8"/> <param name="fragment" value="org.eclipse.swt.gtk.linux.ppc64le"/> </antcall> <antcall target="check_fragment_libraries"> - <param name="library_count" value="9"/> + <param name="library_count" value="8"/> <param name="fragment" value="org.eclipse.swt.gtk.linux.x86"/> </antcall> <antcall target="check_fragment_libraries"> - <param name="library_count" value="9"/> + <param name="library_count" value="8"/> <param name="fragment" value="org.eclipse.swt.gtk.linux.x86_64"/> </antcall> <antcall target="check_fragment_libraries"> @@ -719,25 +719,10 @@ <param name="port" value="${port}"/> <param name="keyfile" value="${keyfile}"/> </antcall> - <antcall target="build_gtk3"/> <delete dir="${build_dir}" quiet="true"/> <antcall target="refresh_fragment"/> </target> - <target name="build_gtk3" depends="get_version" if="machine_gtk3"> - <exec executable="mkdir"> - <arg value="-p"/> - <arg value="${output_dir}/webkitextensions${swt_version}/"/> - </exec> - <antcall target="${build_task}"> - <param name="build_machine" value="${machine_gtk3}"/> - <param name="build_targets" value="install"/> - <param name="libs" value="*pi3*"/> - <param name="exports" value="export GTK_VERSION=3.0;"/> - <param name="gtk_version" value="3.0"/> - </antcall> - </target> - <target name="build_remote" depends="init_keyfile"> <property name="libs" value="*"/> <property name="exports" value=""/> @@ -787,7 +772,11 @@ </target> <target name="build_local"> - <property name="gtk_version" value="2.0" /> + <property name="gtk_version" value="3.0" /> + <exec executable="mkdir"> + <arg value="-p"/> + <arg value="${output_dir}/webkitextensions${swt_version}/"/> + </exec> <exec dir="${build_dir}" executable="sh" failonerror="true"> <arg line="build.sh"/> <env key="GTK_VERSION" value="${gtk_version}"/> |