From 06caa57f9a73bbe869586e17df1cdd08fe57077b Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 8 Jun 2021 17:26:36 -0400 Subject: Make a standalone hello world We want to test building against the installed GTK in ci, so lets add a standalone project. --- examples/hello-world.c | 46 -------------------------------------------- examples/hello/hello-world.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ examples/hello/meson.build | 10 ++++++++++ examples/meson.build | 1 - 4 files changed, 56 insertions(+), 47 deletions(-) delete mode 100644 examples/hello-world.c create mode 100644 examples/hello/hello-world.c create mode 100644 examples/hello/meson.build diff --git a/examples/hello-world.c b/examples/hello-world.c deleted file mode 100644 index f4c058e978..0000000000 --- a/examples/hello-world.c +++ /dev/null @@ -1,46 +0,0 @@ -#include - -static void -print_hello (GtkWidget *widget, - gpointer data) -{ - g_print ("Hello World\n"); -} - -static void -activate (GtkApplication *app, - gpointer user_data) -{ - GtkWidget *window; - GtkWidget *button; - GtkWidget *box; - - window = gtk_application_window_new (app); - gtk_window_set_title (GTK_WINDOW (window), "Window"); - gtk_window_set_default_size (GTK_WINDOW (window), 200, 200); - - box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_window_set_child (GTK_WINDOW (window), box); - - button = gtk_button_new_with_label ("Hello World"); - g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL); - g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_destroy), window); - gtk_box_append (GTK_BOX (box), button); - - gtk_widget_show (window); -} - -int -main (int argc, - char **argv) -{ - GtkApplication *app; - int status; - - app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE); - g_signal_connect (app, "activate", G_CALLBACK (activate), NULL); - status = g_application_run (G_APPLICATION (app), argc, argv); - g_object_unref (app); - - return status; -} diff --git a/examples/hello/hello-world.c b/examples/hello/hello-world.c new file mode 100644 index 0000000000..f4c058e978 --- /dev/null +++ b/examples/hello/hello-world.c @@ -0,0 +1,46 @@ +#include + +static void +print_hello (GtkWidget *widget, + gpointer data) +{ + g_print ("Hello World\n"); +} + +static void +activate (GtkApplication *app, + gpointer user_data) +{ + GtkWidget *window; + GtkWidget *button; + GtkWidget *box; + + window = gtk_application_window_new (app); + gtk_window_set_title (GTK_WINDOW (window), "Window"); + gtk_window_set_default_size (GTK_WINDOW (window), 200, 200); + + box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); + gtk_window_set_child (GTK_WINDOW (window), box); + + button = gtk_button_new_with_label ("Hello World"); + g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL); + g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_destroy), window); + gtk_box_append (GTK_BOX (box), button); + + gtk_widget_show (window); +} + +int +main (int argc, + char **argv) +{ + GtkApplication *app; + int status; + + app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE); + g_signal_connect (app, "activate", G_CALLBACK (activate), NULL); + status = g_application_run (G_APPLICATION (app), argc, argv); + g_object_unref (app); + + return status; +} diff --git a/examples/hello/meson.build b/examples/hello/meson.build new file mode 100644 index 0000000000..bd4cdd51e7 --- /dev/null +++ b/examples/hello/meson.build @@ -0,0 +1,10 @@ +project('hello', 'c', + version: '4.3.0', + meson_version: '>= 0.50.0', +) + +executable('hello', + [ 'hello-world.c' ], + dependencies: [ dependency('gtk4') ], + install: false +) diff --git a/examples/meson.build b/examples/meson.build index 22e74f34d4..ae007bc404 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -2,7 +2,6 @@ examples = [ 'builder', 'drawing', 'grid-packing', - 'hello-world', 'plugman', 'search-bar', 'sunny', -- cgit v1.2.1 From e5a6d4a1c8882efd0b3a0a591916b0e4e236d79f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 8 Jun 2021 17:39:34 -0400 Subject: ci: Test building against installed GTK This is meant to ensure that we e.g. install the right header files, and so on. --- .gitlab-ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f195a3374f..1b145a3c71 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -79,9 +79,14 @@ fedora-x86_64: script: - .gitlab-ci/show-info-linux.sh - meson subprojects update - - meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS} + - mkdir _install + - meson --prefix=${CI_PROJECT_DIR}/_install + ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} ${BACKEND_FLAGS} ${FEATURE_FLAGS} _build - - ninja -C _build + - meson compile -C _build + - meson install -C _build + - PKG_CONFIG_PATH=${CI_PROJECT_DIR}/_install/lib64/pkgconfig:${CI_PROJECT_DIR}/_install/share/pkgconfig meson setup _build_hello examples/hello + - meson compile -C _build_hello - .gitlab-ci/run-tests.sh _build x11 - .gitlab-ci/run-tests.sh _build wayland - .gitlab-ci/run-tests.sh _build broadway -- cgit v1.2.1 From 386002597ba0484e1a904ede8d3385f5deea45a8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 9 Jun 2021 07:35:25 -0400 Subject: ci: Collect hello build logs --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1b145a3c71..c279497ecb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,6 +60,7 @@ style-check-diff: - "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.png" - "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*/*.png" - "${CI_PROJECT_DIR}/_build/testsuite/css/output/*/*.syscap" + - "${CI_PROJECT_DIR}/_build_hello/meson-logs" cache: key: "$CI_JOB_NAME" paths: -- cgit v1.2.1 From 193903ce4a2b222f167bfe99743fe2b9c822726e Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 9 Jun 2021 07:10:13 -0400 Subject: ci: Update the image v32 of the image includes wayland-protocols 1.21, and other updates from Fedora 34. While we are at it, drop gtk-doc from the image, and drop the separate DOCS_IMAGE - no longer used. --- .gitlab-ci.yml | 5 ++--- .gitlab-ci/fedora.Dockerfile | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c279497ecb..026e5fe95c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,9 +24,8 @@ variables: BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true" FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled" MESON_TEST_TIMEOUT_MULTIPLIER: 3 - FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v31" + FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v32" FLATPAK_IMAGE: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master" - DOCS_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v31" .only-default: only: @@ -308,7 +307,7 @@ asan-build: allow_failure: true reference: - image: $DOCS_IMAGE + image: $FEDORA_IMAGE stage: docs needs: [] variables: diff --git a/.gitlab-ci/fedora.Dockerfile b/.gitlab-ci/fedora.Dockerfile index 4f2aece467..40c9850f52 100644 --- a/.gitlab-ci/fedora.Dockerfile +++ b/.gitlab-ci/fedora.Dockerfile @@ -38,7 +38,6 @@ RUN dnf -y install \ gstreamer1-plugins-good \ gstreamer1-plugins-bad-free-devel \ gstreamer1-plugins-base-devel \ - gtk-doc \ hicolor-icon-theme \ iso-codes \ itstool \ -- cgit v1.2.1