Skip to content

Commit

Permalink
Build GTK 4 binaries
Browse files Browse the repository at this point in the history
Currently the GTK4 binaries are not build as part of the build, this has
several drawbacks:

1) If anything is adjusted for GTK4 part it might break without notice
2) We have no GTK4 binaries by default

This enables *compilation* of the gtk4 parts to see at laest everything
can be compiled.
  • Loading branch information
laeubi committed Aug 28, 2024
1 parent 9248e1e commit 60dc09c
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Install Linux requirements
run: |
sudo apt-get update -qq
sudo apt-get install -qq -y libgtk-3-dev freeglut3-dev webkit2gtk-driver
sudo apt-get install -qq -y libgtk-3-dev libgtk-4-dev freeglut3-dev webkit2gtk-driver
if: ${{ matrix.config.native == 'gtk.linux.x86_64'}}
- name: Pull large static Windows binaries
run: |
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ kind: Pod
spec:
containers:
- name: "swtbuild"
image: "eclipse/platformreleng-centos-swt-build:8"
image: "eclipse/platformreleng-centos-swt-build:9"
imagePullPolicy: "Always"
resources:
limits:
Expand Down
2 changes: 0 additions & 2 deletions binaries/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,10 @@
</exec>
</then>
<else>
<property name="gtk_version" value="3.0" />
<exec dir="${build_dir}" executable="sh" failonerror="true">
<arg line="build.sh"/>
<env key="SWT_JAVA_HOME" value="${SWT_JAVA_HOME}"/>
<env key="OUTPUT_DIR" value="${project.basedir}"/>
<env key="GTK_VERSION" value="${gtk_version}"/>
<env key="MODEL" value="${arch}"/>
<arg line="install clean"/>
</exec>
Expand Down
31 changes: 19 additions & 12 deletions bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,9 @@ func_echo_plus "Building SWT/GTK+ for Architectures: $SWT_OS $SWT_ARCH"

func_build_gtk4 () {
export GTK_VERSION=4.0

func_echo_plus "Building GTK4 bindings:"
pkg-config --libs gtk+4.0
rpm -qi gtk4-devel
${MAKE_TYPE} -f $MAKEFILE all $MAKE_CAIRO $MAKE_AWT "${@}"
RETURN_VALUE=$? #make can return 1 or 2 if it fails. Thus need to cache it in case it's used programmatically somewhere.
if [ "$RETURN_VALUE" -eq 0 ]; then
Expand All @@ -261,8 +262,9 @@ func_build_gtk4 () {

func_build_gtk3 () {
export GTK_VERSION=3.0

func_echo_plus "Building GTK3 bindings:"
pkg-config --libs gtk+3.0
rpm -qi gtk3-devel
${MAKE_TYPE} -f $MAKEFILE all $MAKE_CAIRO $MAKE_AWT "${@}"
RETURN_VALUE=$? #make can return 1 or 2 if it fails. Thus need to cache it in case it's used programmatically somewhere.
if [ "$RETURN_VALUE" -eq 0 ]; then
Expand All @@ -273,22 +275,27 @@ func_build_gtk3 () {
fi
}

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_gtk4 "$@"
func_clean_up
func_build_gtk3 "$@"
elif [ "$1" = "-gtk4" ]; then
if [ "$1" = "-gtk4" ]; then
shift
func_build_gtk4 "$@"
elif [ "$1" = "-gtk3" ]; then
shift
func_build_gtk3 "$@"
elif [ "${GTK_VERSION}" = "4.0" ]; then
func_build_gtk4 "$@"
elif [ "${GTK_VERSION}" = "3.0" -o "${GTK_VERSION}" = "" ]; then
export GTK_VERSION="3.0"
elif [ "${GTK_VERSION}" = "3.0" ]; then
func_build_gtk3 "$@"
else
func_echo_plus "==== Building GTK3 + GTK 4 ===="
func_echo_plus "See below for installed GTK versions:"
dpkg --get-selections | grep libgtk
apt list --installed libgtk*
rpm -qa|grep gtk
func_build_gtk3 "$@"
shift
func_echo_plus "Note: When building multiple GTK versions, a cleanup is required (and automatically performed) between them."
func_clean_up
func_build_gtk4 "$@"
func_clean_up
func_build_gtk3 "$@"
fi
1 change: 1 addition & 0 deletions bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk3.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*
* Contributors:
* Syntevo - initial API and implementation
* DUMMY CHANGE
*******************************************************************************/

#ifndef INC_gtk3_H
Expand Down
2 changes: 1 addition & 1 deletion container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN chmod 555 /usr/local/bin/jenkins-slave && \
ENTRYPOINT [ "uid_entrypoint", "jenkins-slave" ]

RUN dnf -y update && dnf -y install \
java-openjdk maven webkit2gtk3-devel \
java-openjdk maven webkit2gtk3-devel libgtk-4-dev \
make gcc mesa-libGLU-devel mesa-libGL-devel \
libXt-devel procps-ng \
&& dnf clean all
Expand Down

0 comments on commit 60dc09c

Please sign in to comment.