Skip to content

Commit 0148101

Browse files
committed
Build GTK 4 binaries
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 least everything can be compiled.
1 parent d9d9bf0 commit 0148101

File tree

8 files changed

+31
-14
lines changed

8 files changed

+31
-14
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def runOnNativeBuildAgent(String platform, Closure body) {
1919
def final nativeBuildStageName = 'Build SWT-native binaries'
2020
if (platform == 'gtk.linux.x86_64') {
2121
podTemplate(inheritFrom: 'centos-latest' /* inhert general configuration */, containers: [
22-
containerTemplate(name: 'swtbuild', image: 'eclipse/platformreleng-centos-swt-build:8',
22+
containerTemplate(name: 'swtbuild', image: 'eclipse/platformreleng-debian-swtnativebuild:12',
2323
resourceRequestCpu:'1000m', resourceRequestMemory:'512Mi',
2424
resourceLimitCpu:'2000m', resourceLimitMemory:'4096Mi',
2525
alwaysPullImage: true, command: 'cat', ttyEnabled: true)

binaries/org.eclipse.swt.gtk.linux.aarch64/build.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ output.. = bin/
4545
pom.model.property.os=linux
4646
pom.model.property.ws=gtk
4747
pom.model.property.arch=aarch64
48+
pom.model.property.gtkVersion=3.0

binaries/org.eclipse.swt.gtk.linux.loongarch64/build.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ output.. = bin/
4545
pom.model.property.os=linux
4646
pom.model.property.ws=gtk
4747
pom.model.property.arch=loongarch64
48+
pom.model.property.gtkVersion=3.0

binaries/org.eclipse.swt.gtk.linux.ppc64le/build.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ output.. = bin/
4545
pom.model.property.os=linux
4646
pom.model.property.ws=gtk
4747
pom.model.property.arch=ppc64le
48+
pom.model.property.gtkVersion=3.0

binaries/org.eclipse.swt.gtk.linux.riscv64/build.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ output.. = bin/
4444
pom.model.property.os=linux
4545
pom.model.property.ws=gtk
4646
pom.model.property.arch=riscv64
47+
pom.model.property.gtkVersion=3.0

binaries/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<buildid>${buildId}</buildid>
3131
<maven.compiler.release>17</maven.compiler.release>
3232
<swtMainProject>${project.basedir}/../../bundles/org.eclipse.swt</swtMainProject>
33+
<gtkVersion>all</gtkVersion>
3334
</properties>
3435

3536
<modules>
@@ -136,7 +137,7 @@
136137
</exec>
137138
</then>
138139
<else>
139-
<property name="gtk_version" value="3.0" />
140+
<property name="gtk_version" value="${gtkVersion}" />
140141
<exec dir="${build_dir}" executable="sh" failonerror="true">
141142
<arg line="build.sh"/>
142143
<env key="SWT_JAVA_HOME" value="${SWT_JAVA_HOME}"/>

bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,9 @@ func_echo_plus "Building SWT/GTK+ for Architectures: $SWT_OS $SWT_ARCH"
254254

255255
func_build_gtk4 () {
256256
export GTK_VERSION=4.0
257-
258257
func_echo_plus "Building GTK4 bindings:"
258+
pkg-config --libs gtk+4.0
259+
rpm -qi gtk4-devel
259260
${MAKE_TYPE} -f $MAKEFILE all $MAKE_CAIRO $MAKE_AWT "${@}"
260261
RETURN_VALUE=$? #make can return 1 or 2 if it fails. Thus need to cache it in case it's used programmatically somewhere.
261262
if [ "$RETURN_VALUE" -eq 0 ]; then
@@ -268,8 +269,9 @@ func_build_gtk4 () {
268269

269270
func_build_gtk3 () {
270271
export GTK_VERSION=3.0
271-
272272
func_echo_plus "Building GTK3 bindings:"
273+
pkg-config --libs gtk+3.0
274+
rpm -qi gtk3-devel
273275
${MAKE_TYPE} -f $MAKEFILE all $MAKE_CAIRO $MAKE_AWT "${@}"
274276
RETURN_VALUE=$? #make can return 1 or 2 if it fails. Thus need to cache it in case it's used programmatically somewhere.
275277
if [ "$RETURN_VALUE" -eq 0 ]; then
@@ -280,22 +282,31 @@ func_build_gtk3 () {
280282
fi
281283
}
282284

283-
if [ "$1" = "-gtk-all" ]; then
284-
shift
285-
func_echo_plus "Note: When building multiple GTK versions, a cleanup is required (and automatically performed) between them."
286-
func_clean_up
287-
func_build_gtk4 "$@"
288-
func_clean_up
289-
func_build_gtk3 "$@"
290-
elif [ "$1" = "-gtk4" ]; then
285+
echo "Build with GTK_VERSION = ${GTK_VERSION}"
286+
287+
if [ "$1" = "-gtk4" ]; then
291288
shift
292289
func_build_gtk4 "$@"
293290
elif [ "$1" = "-gtk3" ]; then
294291
shift
295292
func_build_gtk3 "$@"
296293
elif [ "${GTK_VERSION}" = "4.0" ]; then
297294
func_build_gtk4 "$@"
298-
elif [ "${GTK_VERSION}" = "3.0" -o "${GTK_VERSION}" = "" ]; then
299-
export GTK_VERSION="3.0"
295+
elif [ "${GTK_VERSION}" = "3.0" ]; then
296+
func_build_gtk3 "$@"
297+
else
298+
if [ "$1" = "-gtk-all" ]; then
299+
shift
300+
fi
301+
func_echo_plus "==== Building GTK3 + GTK 4 ===="
302+
func_echo_plus "See below for installed GTK versions:"
303+
dpkg --get-selections | grep libgtk
304+
apt list --installed libgtk*
305+
rpm -qa|grep gtk
306+
func_echo_plus "Note: When building multiple GTK versions, a cleanup is required (and automatically performed) between them."
307+
func_clean_up
308+
func_build_gtk4 "$@"
309+
func_echo_plus "Note: When building multiple GTK versions, a cleanup is required (and automatically performed) between them."
310+
func_clean_up
300311
func_build_gtk3 "$@"
301312
fi

bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk3.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*
1111
* Contributors:
1212
* Syntevo - initial API and implementation
13+
* DUMMY CHANGE
1314
*******************************************************************************/
1415

1516
#ifndef INC_gtk3_H

0 commit comments

Comments
 (0)