Skip to content

Commit

Permalink
Merge pull request #188 from JFronny/ci-adwaita
Browse files Browse the repository at this point in the history
Extend windows-gtk workflow to also build a package with libadwaita
  • Loading branch information
jwharm authored Jan 11, 2025
2 parents a19acac + 0ee4d7c commit a43b9aa
Show file tree
Hide file tree
Showing 2 changed files with 229 additions and 12 deletions.
146 changes: 146 additions & 0 deletions .github/libadwaita-appstream.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
diff --git a/src/adw-about-dialog.c b/src/adw-about-dialog.c
index 235f77f4..d7471036 100644
--- a/src/adw-about-dialog.c
+++ b/src/adw-about-dialog.c
@@ -7,7 +7,6 @@

#include "config.h"
#include <glib/gi18n-lib.h>
-#include <appstream.h>

#include "adw-about-dialog.h"

@@ -429,12 +428,12 @@ legal_showing_cb (AdwAboutDialog *self)
self->legal_showing_idle_id = 0;
}

-static gboolean
+/*static gboolean
get_release_for_version (AsRelease *rel,
const char *version)
{
return !g_strcmp0 (as_release_get_version (rel), version);
-}
+}*/

static void
update_credits_legal_group (AdwAboutDialog *self)
@@ -2008,7 +2007,8 @@ AdwDialog *
adw_about_dialog_new_from_appdata (const char *resource_path,
const char *release_notes_version)
{
- AdwAboutDialog *self;
+ g_error("Appstream is not supported in this build");
+ /*AdwAboutDialog* self;
GFile *appdata_file;
char *appdata_uri;
AsMetadata *metadata;
@@ -2126,7 +2126,7 @@ adw_about_dialog_new_from_appdata (const char *resource_path,
}
}

- /* Handle deprecated SPDX IDs */
+ /* Handle deprecated SPDX IDs *//*
for (i = 0; i < G_N_ELEMENTS (license_aliases); i++) {
if (g_strcmp0 (license_aliases[i].spdx_id, project_license) == 0) {
adw_about_dialog_set_license_type (self, license_aliases[i].license);
@@ -2152,7 +2152,7 @@ adw_about_dialog_new_from_appdata (const char *resource_path,
g_free (application_id);
g_free (appdata_uri);

- return ADW_DIALOG (self);
+ return ADW_DIALOG (self);*/
}

/**
diff --git a/src/adw-about-window.c b/src/adw-about-window.c
index 2c17e129..c741283e 100644
--- a/src/adw-about-window.c
+++ b/src/adw-about-window.c
@@ -6,7 +6,6 @@

#include "config.h"
#include <glib/gi18n-lib.h>
-#include <appstream.h>

#include "adw-about-window.h"

@@ -421,12 +420,12 @@ legal_showing_cb (AdwAboutWindow *self)
g_idle_add_once ((GSourceOnceFunc) legal_showing_idle_cb, self);
}

-static gboolean
+/*static gboolean
get_release_for_version (AsRelease *rel,
const char *version)
{
return !g_strcmp0 (as_release_get_version (rel), version);
-}
+}*/

static void
update_credits_legal_group (AdwAboutWindow *self)
@@ -2022,7 +2021,8 @@ GtkWidget *
adw_about_window_new_from_appdata (const char *resource_path,
const char *release_notes_version)
{
- AdwAboutWindow *self;
+ g_error("Appstream is not supported in this build");
+ /*AdwAboutWindow* self;
GFile *appdata_file;
char *appdata_uri;
AsMetadata *metadata;
@@ -2140,7 +2140,7 @@ adw_about_window_new_from_appdata (const char *resource_path,
}
}

- /* Handle deprecated SPDX IDs */
+ /* Handle deprecated SPDX IDs *//*
for (i = 0; i < G_N_ELEMENTS (license_aliases); i++) {
if (g_strcmp0 (license_aliases[i].spdx_id, project_license) == 0) {
adw_about_window_set_license_type (self, license_aliases[i].license);
@@ -2166,7 +2166,7 @@ adw_about_window_new_from_appdata (const char *resource_path,
g_free (application_id);
g_free (appdata_uri);

- return GTK_WIDGET (self);
+ return GTK_WIDGET (self);*/
}

/**
diff --git a/src/meson.build b/src/meson.build
index 03b6c248..b8ceeec2 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -313,20 +313,12 @@ gtk_min_version = '>= 4.15.2'

gio_dep = dependency('gio-2.0', version: glib_min_version)
gtk_dep = dependency('gtk4', version: gtk_min_version)
-appstream_dep = dependency('appstream',
- fallback : ['appstream', 'appstream_dep'],
- default_options : [
- 'systemd=false', 'apidocs=false', 'install-docs=false',
- 'stemming=false', 'svg-support=false', 'gir=false',
- ],
-)

libadwaita_deps = [
dependency('glib-2.0', version: glib_min_version),
dependency('fribidi'),
gio_dep,
gtk_dep,
- appstream_dep,
cc.find_library('m', required: false),
]

diff --git a/subprojects/appstream.wrap b/subprojects/appstream.wrap
deleted file mode 100644
index 4262a04b..00000000
--- a/subprojects/appstream.wrap
+++ /dev/null
@@ -1,5 +0,0 @@
-[wrap-git]
-directory = appstream
-url = https://github.com/ximion/appstream.git
-revision = main
-depth = 1
95 changes: 83 additions & 12 deletions .github/workflows/windows-gtk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,100 @@ on:
description: 'Upload artifacts as release'
required: true
type: boolean
tag:
description: 'The tag to clone'
gtktag:
description: 'The GTK tag to clone'
required: true
libadwaitatag:
description: 'The libadwaita tag to clone'
required: true

jobs:
build:
runs-on: windows-latest

steps:
- name: Clone
uses: actions/checkout@v4
with:
submodules: recursive
path: scripts
sparse-checkout: |
.github
- name: Install Dependencies
run: |
choco uninstall -y mingw strawberryperl cmake.install llvm
pip install meson ninja
- name: Clone pkgconf
uses: actions/checkout@v4
with:
repository: 'pkgconf/pkgconf'
submodules: recursive
path: pkgconf
- name: Build pkgconf
run: |
meson setup pkgconf\build pkgconf --prefix ${{ github.workspace }}\pkgdist -Dtests=disabled --vsenv
meson compile -C pkgconf\build
meson install -C pkgconf\build
cp pkgdist\bin\pkgconf.exe pkgdist\bin\pkg-config.exe
echo "${{ github.workspace }}\pkgdist\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Download winflexbison and gettext
run: |
curl -L https://github.com/lexxmark/winflexbison/releases/download/v2.5.25/win_flex_bison-2.5.25.zip -o win_flex_bison.zip
7z x win_flex_bison.zip -owin_flex_bison
echo "${{ github.workspace }}\win_flex_bison" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
curl -L https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.23-v1.17/gettext0.23-iconv1.17-static-64.zip -o gettext.zip
7z x gettext.zip -ogettext
echo "${{ github.workspace }}\gettext\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Clone GTK tree
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
ref: ${{ inputs.gtktag }}
repository: 'GNOME/gtk'
submodules: recursive
- name: Perform Build
path: gtk
- name: Build GTK
run: |
meson setup build --prefix ${{ github.workspace }}\dist --buildtype release -Db_pie=true -Dbuild-tests=false -Dmedia-gstreamer=disabled -Dvulkan=disabled --vsenv
meson compile -C build
meson install -C build
meson setup gtk\build gtk --pkg-config-path ${{ github.workspace }}\dist\lib\pkgconfig --build.pkg-config-path ${{ github.workspace }}\dist\lib\pkgconfig --prefix ${{ github.workspace }}\dist --buildtype release --vsenv -Db_pie=true -Dbuild-tests=false -Dmedia-gstreamer=disabled -Dvulkan=disabled
meson compile -C gtk\build
meson install -C gtk\build
cd dist\bin
7z a ..\..\natives.zip *.dll
7z a ..\..\executable.zip *.exe
cd ..\..
cp natives.zip natives-gtk.zip
cp executable.zip executable-gtk.zip
echo "${{ github.workspace }}\dist\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Clone gobject-introspection
uses: actions/checkout@v4
with:
repository: 'GNOME/gobject-introspection'
submodules: recursive
path: gobject-introspection
- name: Build gobject-introspection
run: |
meson setup gobject-introspection\build gobject-introspection --prefix ${{ github.workspace }}\dist --buildtype release --vsenv -Db_pie=true -Dglib2:introspection=enabled
meson compile -C gobject-introspection\build
meson install -C gobject-introspection\build
- name: Clone libadwaita tree
uses: actions/checkout@v4
with:
ref: ${{ inputs.libadwaitatag }}
repository: 'GNOME/libadwaita'
submodules: recursive
path: libadwaita
- name: Build libadwaita
run: |
git -C libadwaita apply ${{ github.workspace }}/scripts/.github/libadwaita-appstream.diff
meson setup libadwaita\build libadwaita --pkg-config-path ${{ github.workspace }}\dist\lib\pkgconfig --build.pkg-config-path ${{ github.workspace }}\dist\lib\pkgconfig --prefix ${{ github.workspace }}\dist --buildtype release --vsenv -Db_pie=true -Dvapi=false -Dexamples=false -Dtests=false -Dintrospection=disabled
meson compile -C libadwaita\build
meson install -C libadwaita\build
cd dist\bin
7z a ..\..\natives-adw.zip *.dll
7z a ..\..\executable-adw.zip *.exe
cd ..\..
- name: Finish up
run: |
cp pkgdist\bin\pkg-config.exe pkg-config.exe
- name: Library artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -47,14 +113,19 @@ jobs:
name: applications
path: |
dist\bin\*.exe
pkg-config.exe
- name: Generate Release
uses: "marvinpinto/action-automatic-releases@latest"
uses: softprops/action-gh-release@v2
if: ${{ inputs.release }}
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "libraries"
prerelease: false
title: "GTK Natives for ${{ inputs.tag }}"
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: "libraries"
name: "Natives for GTK ${{ inputs.gtktag }} and libadwaita ${{ inputs.libadwaitatag }}"
files: |
natives.zip
executable.zip
natives-gtk.zip
executable-gtk.zip
natives-adw.zip
executable-adw.zip
pkg-config.exe

0 comments on commit a43b9aa

Please sign in to comment.