Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLev Ufimtsev2016-08-11 19:55:58 +0000
committerEric Williams2016-08-15 14:54:44 +0000
commitf7d2c600ae4398eac4e8df3b5ab6405134d9f026 (patch)
tree1139629d20c67a59a71634bf431b380b543153d3 /bundles/org.eclipse.swt.tools
parentef789d5e376ba93868510e3416dce31bffc24241 (diff)
downloadeclipse.platform.swt-f7d2c600ae4398eac4e8df3b5ab6405134d9f026.tar.gz
eclipse.platform.swt-f7d2c600ae4398eac4e8df3b5ab6405134d9f026.tar.xz
eclipse.platform.swt-f7d2c600ae4398eac4e8df3b5ab6405134d9f026.zip
Bug 499577: Add install_sysdeps.sh to swt.tools
Change-Id: Ib21bafaccc14c2cc45bacb5a616a4a3a7de1bc0a Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=499577 Signed-off-by: Lev Ufimtsev <lufimtse@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt.tools')
-rwxr-xr-xbundles/org.eclipse.swt.tools/install_sysdeps.sh91
1 files changed, 91 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt.tools/install_sysdeps.sh b/bundles/org.eclipse.swt.tools/install_sysdeps.sh
new file mode 100755
index 0000000000..1a2505559f
--- /dev/null
+++ b/bundles/org.eclipse.swt.tools/install_sysdeps.sh
@@ -0,0 +1,91 @@
+#!/bin/bash
+# This script installs relevant system dependencies for ./build.sh to compile JNI bindings.
+# Each linux distribution has a different package manager, so the script has to be adapted
+# for each distribution.
+# To add your distribution:
+# 1) Identify your distribution ID via:
+# lsb_release -a
+# 2) Add a case to the case statment below.
+# 3) Add a function to handle your distribution.
+
+
+func_echo_plus () {
+ # Echo function that prints output in green to distinguish it from sub-shell output.
+ GREEN='\033[0;32m'
+ NC='\033[0m' # No Color
+ echo -e "${GREEN}${@}${NC}"
+}
+
+func_echo_error () {
+ # As above, but in red. Also pre-appends '***' to output.
+ RED='\033[0;31m'
+ NC='\033[0m' # No Color
+echo -e "${RED}*** ${@}${NC}"
+}
+
+func_configure_fedora () {
+ FEDORA_VERSION=$(cat /etc/system-release | cut -f3 -d" ")
+ if [ "$FEDORA_VERSION" -lt "21" ]; then
+ INSTALL_CMD="yum"
+ else
+ INSTALL_CMD="dnf"
+ fi
+
+
+ func_echo_plus "Installing C Development Tools"
+ set -x
+ sudo $INSTALL_CMD -y groups install "C Development Tools and Libraries"
+
+ 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 Gnome development packages"
+ sudo $INSTALL_CMD -y install libgnome-devel.x86_64 libgnomeui-devel.x86_64
+
+ 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
+
+ func_echo_plus "Install Mesa (OpenGL headers)"
+ # Deals with error: "/usr/bin/ld: cannot find -lGLU collect2: error: ld returned 1 exit status"
+ sudo $INSTALL_CMD -y install mesa-libGLU-devel
+
+ func_echo_plus "Done"
+}
+
+
+LINUX_DISTRO=$(cat /etc/system-release | cut -f1 -d" ")
+if [ "$LINUX_DISTRO" = "" ]; then
+ func_echo_error "Error, could not identify your distribution"
+ exit
+fi
+
+DISTRO_NOT_KNOWN_MSG="
+Currently the script doesn't know how to automatically configure your distro : $LINUX_DISTRO
+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)
+ - gtk3-devel gtk3-devel
+ - libgnome-devel libgnomeui-devel
+ - libXt-devel libXts-devel
+ - mesa-libGLU-devel
+"
+
+
+case "$LINUX_DISTRO" in
+"Fedora")
+ func_echo_plus "Fedora found. Installing packages..."
+ func_configure_fedora
+ ;;
+"YOUR_DISTRIBUTION")
+ echo "YOUR_DISTRIBUTION HERE"
+ ;;
+*)
+ func_echo_error "$DISTRO_NOT_KNOWN_MSG"
+ ;;
+esac
+

Back to the top