Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-09-11 05:55:20 +0000
committerAlexander Kurtakov2018-09-11 05:56:51 +0000
commitb2672e8a696ec09fd75d22aa0f2f00de085b22bb (patch)
treeb53115e671c489900fcdcc6e58965191bd71225a /bundles/org.eclipse.swt.tools
parenta2de774e7d3cf3b08fc9771167a4a592f6560184 (diff)
downloadeclipse.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>
Diffstat (limited to 'bundles/org.eclipse.swt.tools')
-rwxr-xr-xbundles/org.eclipse.swt.tools/gtk/dynamic_gtk2_vs_gtk3.py145
-rwxr-xr-xbundles/org.eclipse.swt.tools/gtk/install_sysdeps.sh10
-rw-r--r--bundles/org.eclipse.swt.tools/gtk/readme.md2
3 files changed, 6 insertions, 151 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.

Back to the top