From 1269c2d423783c5a0ee5ef68e7e36270abc879af Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 2 Mar 2024 21:10:44 +0100 Subject: [PATCH 01/14] Avoid a heap allocation --- girara/session.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/girara/session.c b/girara/session.c index c2158dc..4049021 100644 --- a/girara/session.c +++ b/girara/session.c @@ -91,10 +91,9 @@ void css_template_fill_font(GiraraTemplate* csstemplate, const char* font) { g_free(size); } - const unsigned int font_weight = pango_font_description_get_weight(descr); - char* font_weight_str = g_strdup_printf("%u", font_weight); - girara_template_set_variable_value(csstemplate, "font-weight", font_weight_str); - g_free(font_weight_str); + char font_weight[G_ASCII_DTOSTR_BUF_SIZE]; + g_ascii_dtostr(font_weight, G_ASCII_DTOSTR_BUF_SIZE, pango_font_description_get_weight(descr)); + girara_template_set_variable_value(csstemplate, "font-weight", font_weight); pango_font_description_free(descr); } From d1737704e0f3fd78e61aa7f476da534a0fe5befd Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 3 Mar 2024 14:01:39 +0100 Subject: [PATCH 02/14] Revert "Avoid a heap allocation" This reverts commit 1269c2d423783c5a0ee5ef68e7e36270abc879af. --- girara/session.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/girara/session.c b/girara/session.c index 4049021..c2158dc 100644 --- a/girara/session.c +++ b/girara/session.c @@ -91,9 +91,10 @@ void css_template_fill_font(GiraraTemplate* csstemplate, const char* font) { g_free(size); } - char font_weight[G_ASCII_DTOSTR_BUF_SIZE]; - g_ascii_dtostr(font_weight, G_ASCII_DTOSTR_BUF_SIZE, pango_font_description_get_weight(descr)); - girara_template_set_variable_value(csstemplate, "font-weight", font_weight); + const unsigned int font_weight = pango_font_description_get_weight(descr); + char* font_weight_str = g_strdup_printf("%u", font_weight); + girara_template_set_variable_value(csstemplate, "font-weight", font_weight_str); + g_free(font_weight_str); pango_font_description_free(descr); } From 667cdb71ddc4b306d230146453c1b6e07a523ac7 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 1 Apr 2024 16:56:17 +0200 Subject: [PATCH 03/14] Require only glib 2.72 --- README.md | 2 +- meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 50c762e..5106a25 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Requirements The following dependencies are required: * `gtk3` (>= 3.24) -* `glib` (>= 2.74) +* `glib` (>= 2.72) The following dependencies are optional: diff --git a/meson.build b/meson.build index 1a3ef5a..0fc7c57 100644 --- a/meson.build +++ b/meson.build @@ -31,7 +31,7 @@ localedir = get_option('localedir') # required dependencies libm = cc.find_library('m', required: false) -glib = dependency('glib-2.0', version: '>=2.74') +glib = dependency('glib-2.0', version: '>=2.72') gtk3 = dependency('gtk+-3.0', version: '>=3.24') pango = dependency('pango', version: '>=1.50') From 4aed9c666ee1336a360206a36c60209297ee76c7 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 29 Apr 2024 22:54:00 +0200 Subject: [PATCH 04/14] CI: Remove gitlab CI --- .gitlab-ci.yml | 153 ------------------------------------------------- 1 file changed, 153 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 725fbc1..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,153 +0,0 @@ -stages: - - build - - test - -# Archlinux -build:archlinux: - tags: - - pwmt - stage: build - image: registry.pwmt.org/pwmt/gitlab-runner-images/archlinux:latest - script: - - mkdir -p build && cd build - - meson .. - - ninja - artifacts: - expire_in: 6 hours - paths: - - build - except: - - tags - -test:archlinux: - tags: - - pwmt - stage: test - image: registry.pwmt.org/pwmt/gitlab-runner-images/archlinux:latest - script: - - cd build - - ninja test - dependencies: - - build:archlinux - except: - - tags - -# Debian 12 (bookworm) -build:debian-bookworm: - tags: - - pwmt - stage: build - image: registry.pwmt.org/pwmt/gitlab-runner-images/debian:bookworm - script: - - mkdir -p build && cd build - - meson .. - - ninja - artifacts: - expire_in: 6 hours - paths: - - build - except: - - tags - -test:debian-bookworm: - tags: - - pwmt - stage: test - image: registry.pwmt.org/pwmt/gitlab-runner-images/debian:bookworm - script: - - cd build - - ninja test - dependencies: - - build:debian-bookworm - except: - - tags - -# Debian 13 (trixie) -build:debian-trixie: - tags: - - pwmt - stage: build - image: registry.pwmt.org/pwmt/gitlab-runner-images/debian:trixie - script: - - mkdir -p build && cd build - - meson .. - - ninja - artifacts: - expire_in: 6 hours - paths: - - build - except: - - tags - -test:debian-trixie: - tags: - - pwmt - stage: test - image: registry.pwmt.org/pwmt/gitlab-runner-images/debian:trixie - script: - - cd build - - ninja test - dependencies: - - build:debian-trixie - except: - - tags - -# Ubuntu 22.04 LTS (jammy) -build:ubuntu-jammy: - tags: - - pwmt - stage: build - image: registry.pwmt.org/pwmt/gitlab-runner-images/ubuntu:jammy - script: - - mkdir -p build && cd build - - meson .. - - ninja - artifacts: - expire_in: 6 hours - paths: - - build - except: - - tags - -test:ubuntu-jammy: - tags: - - pwmt - stage: test - image: registry.pwmt.org/pwmt/gitlab-runner-images/ubuntu:jammy - script: - - cd build - - ninja test - dependencies: - - build:ubuntu-jammy - except: - - tags - -# Ubuntu 24.04 LTS (noble) -# build:ubuntu-noble: -# tags: -# - pwmt -# stage: build -# image: registry.pwmt.org/pwmt/gitlab-runner-images/ubuntu:noble -# script: -# - mkdir -p build && cd build -# - meson .. -# - ninja -# artifacts: -# expire_in: 6 hours -# paths: -# - build -# except: -# - tags - -# test:ubuntu-noble: -# tags: -# - pwmt -# stage: test -# image: registry.pwmt.org/pwmt/gitlab-runner-images/ubuntu:noble -# script: -# - cd build -# - ninja test -# dependencies: -# - build:ubuntu-noble -# except: -# - tags From bc514883199af095acffa110d769e73adc614efb Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 26 Apr 2024 20:39:19 +0200 Subject: [PATCH 05/14] CI: add Github Actions --- .github/dependabot.yml | 6 ++++++ .github/workflows/build.yaml | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/build.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..759819d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..ce295fc --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,24 @@ +name: CI + +on: + push: + pull_request: + +env: + VERBOSE: 1 + +jobs: + build-test: + name: Test on Ubuntu 22.04 + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Install Linux dependencies + run: | + sudo apt-get -q update + sudo apt-get -q -y install check gettext libglib2.0-dev libgtk-3-dev libjson-glib-dev libpango1.0-dev meson ninja-build pkgconf xauth xvfb + - name: Build and test + uses: BSFishy/meson-build@v1.0.3 + with: + action: test + options: --verbose From f6d06766e57812254c04635e98a01976fd8761c2 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 30 Apr 2024 19:11:49 +0200 Subject: [PATCH 06/14] Switch to Github --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5106a25..8a302d3 100644 --- a/README.md +++ b/README.md @@ -51,4 +51,4 @@ refer to the meson documentation for platform specific dependencies. Bugs ---- -Please report bugs at https://git.pwmt.org/pwmt/girara. +Please report bugs at https://github.com/pwmt/girara. From 2fc5d67803241078b77f48e2610ccaea5aa2a433 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 30 Apr 2024 19:31:34 +0200 Subject: [PATCH 07/14] CI: push notifications to IRC --- .github/workflows/irc.yaml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/irc.yaml diff --git a/.github/workflows/irc.yaml b/.github/workflows/irc.yaml new file mode 100644 index 0000000..5f3bf0b --- /dev/null +++ b/.github/workflows/irc.yaml @@ -0,0 +1,35 @@ +name: "IRC Notifications" +on: [push, pull_request, create] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: irc push + uses: rectalogic/notify-irc@v1 + if: github.event_name == 'push' + with: + channel: "#pwmt" + server: "irc.oftc.net" + nickname: "gojira2" + message: | + [${{github.repository}}] ${{ github.actor }} pushed ${{ github.event.ref }} ${{ github.event.compare }} + ${{ join(github.event.commits.*.message) }} + - name: irc pull request + uses: rectalogic/notify-irc@v1 + if: github.event_name == 'pull_request' + with: + channel: "#pwmt" + server: "irc.oftc.net" + nickname: "gojira2" + message: | + [${{github.repository}}] ${{ github.actor }} opened PR ${{ github.event.pull_request.html_url }} + - name: irc tag created + uses: rectalogic/notify-irc@v1 + if: github.event_name == 'create' && github.event.ref_type == 'tag' + with: + channel: "#pwmt" + server: "irc.oftc.net" + nickname: "gojira2" + message: | + [${{github.repository}}] ${{ github.actor }} tagged ${{ github.event.ref }} From f16f7012a475cb8a9fff592c0ce15f80d1860349 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 30 Apr 2024 21:47:34 +0200 Subject: [PATCH 08/14] Revert "CI: push notifications to IRC" This reverts commit 2fc5d67803241078b77f48e2610ccaea5aa2a433. --- .github/workflows/irc.yaml | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 .github/workflows/irc.yaml diff --git a/.github/workflows/irc.yaml b/.github/workflows/irc.yaml deleted file mode 100644 index 5f3bf0b..0000000 --- a/.github/workflows/irc.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: "IRC Notifications" -on: [push, pull_request, create] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: irc push - uses: rectalogic/notify-irc@v1 - if: github.event_name == 'push' - with: - channel: "#pwmt" - server: "irc.oftc.net" - nickname: "gojira2" - message: | - [${{github.repository}}] ${{ github.actor }} pushed ${{ github.event.ref }} ${{ github.event.compare }} - ${{ join(github.event.commits.*.message) }} - - name: irc pull request - uses: rectalogic/notify-irc@v1 - if: github.event_name == 'pull_request' - with: - channel: "#pwmt" - server: "irc.oftc.net" - nickname: "gojira2" - message: | - [${{github.repository}}] ${{ github.actor }} opened PR ${{ github.event.pull_request.html_url }} - - name: irc tag created - uses: rectalogic/notify-irc@v1 - if: github.event_name == 'create' && github.event.ref_type == 'tag' - with: - channel: "#pwmt" - server: "irc.oftc.net" - nickname: "gojira2" - message: | - [${{github.repository}}] ${{ github.actor }} tagged ${{ github.event.ref }} From 49d3175ca8aa7ee6602c859e701041c3d45f0e9b Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 30 Apr 2024 23:05:44 +0200 Subject: [PATCH 09/14] CI: test on Debian trixie --- .github/workflows/build.yaml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ce295fc..c338bc9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,17 +8,15 @@ env: VERBOSE: 1 jobs: - build-test: - name: Test on Ubuntu 22.04 - runs-on: ubuntu-22.04 + build-test-debian-trixie: + name: Test on Debian trixie + runs-on: ubuntu-latest + container: ghcr.io/pwmt/github-actions-debian:trixie steps: - uses: actions/checkout@v4 - - name: Install Linux dependencies - run: | - sudo apt-get -q update - sudo apt-get -q -y install check gettext libglib2.0-dev libgtk-3-dev libjson-glib-dev libpango1.0-dev meson ninja-build pkgconf xauth xvfb - name: Build and test - uses: BSFishy/meson-build@v1.0.3 - with: - action: test - options: --verbose + - mkdir build + - cd build + - meson .. + - ninja --verbose + - ninja test --verbose From b6442ea706d50693c79d9058615732a48f7fd718 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 30 Apr 2024 23:08:30 +0200 Subject: [PATCH 10/14] CI: fix syntax error --- .github/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c338bc9..0057148 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,6 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build and test + run: | - mkdir build - cd build - meson .. From 58fdf49a0d9383c0aebefff7ea0afba694156169 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 30 Apr 2024 23:09:19 +0200 Subject: [PATCH 11/14] CI: fix syntax error --- .github/workflows/build.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0057148..94c658f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,11 +13,11 @@ jobs: runs-on: ubuntu-latest container: ghcr.io/pwmt/github-actions-debian:trixie steps: - - uses: actions/checkout@v4 - - name: Build and test - run: | - - mkdir build - - cd build - - meson .. - - ninja --verbose - - ninja test --verbose + - uses: actions/checkout@v4 + - name: Build and test + run: | + mkdir build + cd build + meson .. + ninja --verbose + ninja test --verbose From 3d1d4b602cb85a5a35a908e80bf243c5e9baf304 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 30 Apr 2024 23:11:18 +0200 Subject: [PATCH 12/14] CI: login to ghcr.io --- .github/workflows/build.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 94c658f..f632578 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,7 +11,11 @@ jobs: build-test-debian-trixie: name: Test on Debian trixie runs-on: ubuntu-latest - container: ghcr.io/pwmt/github-actions-debian:trixie + container: + image: ghcr.io/pwmt/github-actions-debian:trixie + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v4 - name: Build and test From 8c5c904928bb592388cf2234fb7db2f8d8778b2a Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 30 Apr 2024 23:22:35 +0200 Subject: [PATCH 13/14] CI: test on Ubuntu and Archlinux --- .github/workflows/build.yaml | 72 ++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f632578..d77a70f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -25,3 +25,75 @@ jobs: meson .. ninja --verbose ninja test --verbose + + build-test-debian-bookworm: + name: Test on Debian bookworm + runs-on: ubuntu-latest + container: + image: ghcr.io/pwmt/github-actions-debian:bookworm + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + - name: Build and test + run: | + mkdir build + cd build + meson .. + ninja --verbose + ninja test --verbose + + build-test-ubuntu-noble: + name: Test on Ubuntu noble + runs-on: ubuntu-latest + container: + image: ghcr.io/pwmt/github-actions-ubuntu:noble + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + - name: Build and test + run: | + mkdir build + cd build + meson .. + ninja --verbose + ninja test --verbose + + build-test-ubuntu-jammy: + name: Test on Ubuntu jammy + runs-on: ubuntu-latest + container: + image: ghcr.io/pwmt/github-actions-ubuntu:jammy + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + - name: Build and test + run: | + mkdir build + cd build + meson .. + ninja --verbose + ninja test --verbose + + build-test-archlinux: + name: Test on Archlinux + runs-on: ubuntu-latest + container: + image: ghcr.io/pwmt/github-actions-archlinux:latest + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + - name: Build and test + run: | + mkdir build + cd build + meson .. + ninja --verbose + ninja test --verbose From dca38cd9a56f870abdbe9b9b0c4f7b196534d0f0 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 1 May 2024 23:25:02 +0200 Subject: [PATCH 14/14] Version 0.4.4 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 0fc7c57..c19f0e2 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('girara', 'c', - version: '0.4.3', + version: '0.4.4', meson_version: '>=0.61', default_options: ['c_std=c17', 'warning_level=3'], )