88# 2) Add a case to the case statement below.
99# 3) Add a function to handle your distribution.
1010
11+ GREEN=' \033[0;32m'
12+ RED=' \033[0;31m'
13+ NC=' \033[0m' # No Color
1114
1215func_echo_plus () {
1316 # Echo function that prints output in green to distinguish it from sub-shell output.
14- GREEN=' \033[0;32m'
15- NC=' \033[0m' # No Color
1617 echo -e " ${GREEN}${@ }${NC} "
1718}
1819
1920func_echo_error () {
2021 # As above, but in red. Also pre-appends '***' to output.
21- RED=' \033[0;31m'
22- NC=' \033[0m' # No Color
23- echo -e " ${RED} *** ${@ }${NC} "
22+ echo -e " ${RED} *** ${@ }${NC} "
2423}
2524
2625func_configure_fedora () {
27- FEDORA_VERSION=$( cat /etc/system-release | cut -f3 -d" " )
28- if [ " $FEDORA_VERSION " -lt " 21" ]; then
29- INSTALL_CMD=" yum"
30- else
31- INSTALL_CMD=" dnf"
32- fi
33-
3426
3527 func_echo_plus " Installing C Development Tools"
36- set -x
37- sudo $INSTALL_CMD -y groups install " C Development Tools and Libraries"
38-
39- func_echo_plus " Installing Java 11 development packages that include jni.h for JNI bindings."
40- sudo $INSTALL_CMD -y install java-11-openjdk-devel.x86_64
28+ sudo dnf -y groups install " C Development Tools and Libraries"
4129
42- func_echo_plus " Installing Gtk3 development packages"
43- sudo $INSTALL_CMD -y install gtk3 -devel
30+ func_echo_plus " Installing Java development packages that include jni.h for JNI bindings. "
31+ sudo dnf -y install java-25-openjdk -devel
4432
45- func_echo_plus " Installing X11 Development libraries. Someday when wayland takes over these will not be needed..."
46- # Deals with error: "#include <X11/Intrinsic.h>, #include <X11/extensions/XTest.h>" build errors)
47- sudo $INSTALL_CMD -y install libXt-devel
33+ func_echo_plus " Installing Gtk development packages"
34+ sudo dnf -y install gtk3-devel gtk4-devel
4835
4936 func_echo_plus " Install Mesa (OpenGL headers)"
5037 # Deals with error: "/usr/bin/ld: cannot find -lGLU collect2: error: ld returned 1 exit status"
51- sudo $INSTALL_CMD -y install mesa-libGLU-devel
38+ sudo dnf -y install mesa-libGLU-devel
5239
5340 func_echo_plus " Done"
5441}
5542
5643
57- LINUX_DISTRO=$( cat /etc/system-release | cut -f1 -d" " )
58- if [ " $LINUX_DISTRO " = " " ]; then
59- func_echo_error " Error, could not identify your distribution"
60- exit
44+ if [ -f /etc/os-release ]; then
45+ . /etc/os-release
46+ LINUX_DISTRO=" $ID "
47+ else
48+ echo " Error: cannot identify distribution"
49+ exit 1
6150fi
6251
6352DISTRO_NOT_KNOWN_MSG="
@@ -66,14 +55,13 @@ Consider updating this script for your distribution.
6655In general, You should install the following packages:
6756 - C Development tools (usually comes in a 'group install')
6857 - java-*-openjdk-devel (depending on current version of java)
69- - gtk3-devel
70- - libXt-devel
58+ - gtk3-devel and gtk4-devel
7159 - mesa-libGLU-devel
7260"
7361
7462
7563case " $LINUX_DISTRO " in
76- " Fedora " )
64+ " fedora " )
7765 func_echo_plus " Fedora found. Installing packages..."
7866 func_configure_fedora
7967 ;;
@@ -85,10 +73,3 @@ case "$LINUX_DISTRO" in
8573 ;;
8674esac
8775
88-
89- # check if .classpath exists in swt project.
90- if [ -a " ../org.eclipse.swt/.classpath" ]; then
91- func_echo_plus " .classpath found, you are good to go" ;
92- else
93- func_echo_error " Warning: ../org.eclipse.swt/.classpath not found. Normally you rename ../org.eclipse.swt/.classpath_gtk to ../*/.classpath manually"
94- fi
0 commit comments