Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to GTK4 and drop X11 dependency #172

Merged
merged 24 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8f66473
feat!: removed deprecated GtkStatusIcon support
kanru Feb 3, 2024
1002c9a
feat(wip)!: use gtk4
kanru Feb 3, 2024
19680e8
feat(setup): use libadwaita
kanru Feb 3, 2024
362c7df
feat(setup)!: rewrite ibus-setup-chewing using libadwaita
kanru Feb 4, 2024
268da46
ci: run workflows in a fedora container
kanru Feb 4, 2024
acf4c6a
build: commit pot files
kanru Feb 4, 2024
a14c7d1
ci: install git for codecov
kanru Feb 4, 2024
62ea4d2
ci: find llvm-tools
kanru Feb 4, 2024
496270e
ci: test ibus-setup-chewing
kanru Feb 4, 2024
0141cd4
ci: test ibus-setup-chewing quite action
kanru Feb 4, 2024
b49cc99
build(coverage): make llvm profile file name unique
kanru Feb 5, 2024
0bc44f3
refactor: delete most unused code
kanru Feb 5, 2024
4120639
refactor: address deprecation warnings
kanru Feb 5, 2024
10b9a3b
ci(coverage): bump checkout to v4
kanru Feb 5, 2024
9865a60
refactor: delete another unused file
kanru Feb 5, 2024
8a85fcb
ci(coverage): run test with cmake preset
kanru Feb 5, 2024
99fdb2b
feat!: deprecate sync IM state back to capslock and remove X11 dep
kanru Feb 5, 2024
fff61d1
fix: using Shift_L or Shift_R as toggle key
kanru Feb 5, 2024
b306e33
fix: null check for gdk_seat_get_keyboard
kanru Feb 6, 2024
d7b74d7
ci: use headless wayland display to run test
kanru Feb 5, 2024
57c9c8b
ci: set XDG_RUNTIME_DIR
kanru Feb 5, 2024
a7a2dee
ci: install dbus-x11 for dbus-launch
kanru Feb 6, 2024
cc774e7
ci: use keyfile gsettings backend instead of dconf
kanru Feb 6, 2024
712697a
refactor: remove leftover todo comments
kanru Feb 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BasedOnStyle: LLVM
IndentWidth: 4
21 changes: 14 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: fedora:latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install build dependencies
run: sudo apt install -y libgtk-3-dev libibus-1.0-dev libx11-dev libchewing3-dev ibus gettext xvfb
run: sudo dnf -y install clang cmake gtk4-devel ibus-devel libadwaita-devel libX11-devel libchewing-devel ibus gettext xorg-x11-server-Xvfb dbus-x11 util-linux

- name: Build
run: |
Expand All @@ -26,20 +27,24 @@ jobs:

- name: Test
run: |
xvfb-run -a ctest --test-dir out/build/default --output-on-failure --verbose
glib-compile-schemas src/setup --targetdir=out/build/default/bin
xvfb-run -a cmake --build --preset default -t test --verbose

coverage:
runs-on: ubuntu-latest
container: fedora:latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install build dependencies
run: sudo apt install -y libgtk-3-dev libibus-1.0-dev libx11-dev libchewing3-dev ibus gettext xvfb
run: sudo dnf -y install clang cmake gtk4-devel ibus-devel libadwaita-devel libX11-devel libchewing-devel ibus gettext xorg-x11-server-Xvfb dbus-x11 util-linux

- name: Install llvm
run: |
sudo apt install -y llvm
sudo dnf -y install llvm rustup bzip2 git
rustup-init -y
source "$HOME/.cargo/env"
rustup component add llvm-tools

- name: Setup grcov
Expand All @@ -55,7 +60,9 @@ jobs:

- name: Test
run: |
xvfb-run -a ctest --test-dir out/build/c99-coverage --output-on-failure --verbose
source "$HOME/.cargo/env"
glib-compile-schemas src/setup --targetdir=out/build/c99-coverage/bin
xvfb-run -a cmake --build --preset c99-coverage -t test --verbose
./grcov . -s . -b . --keep-only 'src/*' --llvm -t lcov -o coverage.lcov

- name: Upload coverage reports to Codecov
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*.o
*.old
*.orig
*.pot
*.rej
*.rpm
*.so
Expand Down
16 changes: 4 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ enable_testing()
include(GNUInstallDirs)

option(GNOME_SHELL "Enable GNOME Shell support" ON)
option(GCONF2_SUPPORT "Enable GConf2 support" OFF)
option(GSETTINGS_SUPPORT "Enable GSettings support" ON)

find_package(PkgConfig REQUIRED)
pkg_check_modules(IBUS REQUIRED IMPORTED_TARGET ibus-1.0>=1.3)
Expand All @@ -49,17 +47,13 @@ add_compile_definitions(
)

pkg_check_modules(GLIB2 REQUIRED IMPORTED_TARGET glib-2.0)
pkg_check_modules(GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0)
pkg_check_modules(X11 REQUIRED IMPORTED_TARGET x11)
pkg_check_modules(GTK4 REQUIRED IMPORTED_TARGET gtk4)
pkg_check_modules(LIBADWAITA REQUIRED IMPORTED_TARGET libadwaita-1)

find_program(GLIB_COMPILE_RESOURCES NAMES glib-compile-resources REQUIRED)

set(CMAKE_C_STANDARD 99)
add_compile_definitions(_XOPEN_SOURCE)
if(GSETTINGS_SUPPORT)
add_compile_definitions(USE_GSETTINGS)
endif()
if(GCONF2_SUPPORT)
add_compile_definitions(USE_GCONF2)
endif()

# Directory that store ibus-chewing icons
add_compile_definitions(PRJ_ICON_DIR="${CMAKE_INSTALL_DATADIR}/ibus-chewing/icons")
Expand All @@ -72,8 +66,6 @@ add_compile_definitions(
PROJECT_SCHEMA_BASE=/desktop/ibus/engine
PROJECT_SCHEMA_SECTION=chewing
PROJECT_SCHEMA_DIR=/desktop/ibus/engine/chewing
PROJECT_GCONF2_SCHEMA_SECTION=Chewing
PROJECT_GCONF2_SCHEMA_DIR=/desktop/ibus/engine/Chewing
PROJECT_SCHEMA_PATH=/desktop/ibus/engine/chewing/
)

Expand Down
3 changes: 3 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"CMAKE_CXX_COMPILER": "/usr/bin/clang++",
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_C_FLAGS": "-fprofile-instr-generate -fcoverage-mapping"
},
"environment": {
"LLVM_PROFILE_FILE": "default_%p_%m.profraw"
}
},
{
Expand Down
1 change: 0 additions & 1 deletion INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Installation Instructions
gob >= 2.0.16
gtk >= 3
libchewing >= 0.5.1
libX11

1. Remove the old build cache:

Expand Down
237 changes: 0 additions & 237 deletions icons/ibus-chewing-chi-full.svg

This file was deleted.

Loading
Loading