Skip to content

Commit 08dd63b

Browse files
committed
Merge branch 'ibus_fcitx_merged' into auto_config
2 parents 9ebf77f + 4727f8d commit 08dd63b

4 files changed

Lines changed: 27 additions & 29 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,17 @@ jobs:
1111
strategy:
1212
matrix:
1313
# container: [ "ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04", "debian:11", "fedora:37", "fedora:38", "archlinux:latest" ]
14-
container: [ "ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "debian:11", "debian:12", "fedora:40", "fedora:41", "opensuse/tumbleweed" ]
14+
container: [ "ubuntu:22.04", "ubuntu:24.04", "debian:11", "debian:12", "fedora:40", "fedora:41", "opensuse/tumbleweed" ]
1515
# this list should be updated from time to time by consulting these pages:
1616
# https://releases.ubuntu.com/
1717
# https://wiki.debian.org/DebianReleases#Production_Releases
1818
# https://fedoraproject.org/wiki/Releases
1919
# https://en.wikipedia.org/wiki/OpenSUSE#Version_history
20-
ime: [ "ibus", "fcitx" ]
21-
# Some distributions doesn't have the required version of fcitx library, so we exclude them.
22-
exclude:
23-
- container: "ubuntu:20.04"
24-
ime: "fcitx"
2520
runs-on: "ubuntu-latest"
2621
container:
2722
image: ${{ matrix.container }}
2823
env:
2924
DIST: ${{ matrix.container }}
30-
IME: ${{ matrix.ime }}
3125
DEBIAN_FRONTEND: noninteractive
3226
steps:
3327
- name: install-git
@@ -64,7 +58,7 @@ jobs:
6458
- name: upload-artifacts
6559
uses: actions/upload-artifact@v4
6660
with:
67-
name: pkg-${{ steps.sanitizer.outputs.sanitized_container }}-${{ matrix.ime }}
61+
name: pkg-${{ steps.sanitizer.outputs.sanitized_container }}
6862
path: artifact
6963

7064
release:

CMakeLists.txt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ if(OS_LINUX)
6868

6969
option(ENABLE_IBUS "Enable IBus support" OFF)
7070
option(ENABLE_FCITX "Enable Fcitx support" OFF)
71+
option(ENABLE_BOTH "Enable both IBus and Fcitx support" OFF)
7172

72-
if((NOT ENABLE_IBUS) AND (NOT ENABLE_FCITX))
73-
message(FATAL_ERROR "Please set atleast ENABLE_IBUS or ENABLE_FCITX to be ON to build a backend")
73+
if((NOT ENABLE_IBUS) AND (NOT ENABLE_FCITX) AND (NOT ENABLE_BOTH))
74+
message(FATAL_ERROR "Please set atleast ENABLE_IBUS or ENABLE_FCITX or ENABLE_BOTH to be ON to build a backend")
7475
endif()
7576

7677
## Find iBus ##
@@ -83,6 +84,11 @@ if(OS_LINUX)
8384
find_package(Fcitx5Core 5.0.5 REQUIRED)
8485
endif()
8586

87+
if(ENABLE_BOTH)
88+
pkg_check_modules(IBUS REQUIRED ibus-1.0)
89+
find_package(Fcitx5Core 5.0.5 REQUIRED)
90+
endif()
91+
8692
## Find zstd ##
8793
pkg_check_modules(ZSTD REQUIRED libzstd)
8894
endif()
@@ -143,12 +149,18 @@ if(ENABLE_IBUS)
143149
set(CPACK_DEBIAN_PACKAGE_DEPENDS "ibus (>= 1.5.1)")
144150
set(CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.9.0, ibus >= 1.5.1, ibus-libs >= 1.5.1, libzstd >= 1.3.3")
145151
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/ibus" "/usr/share/ibus/component")
146-
else()
152+
elseif(ENABLE_FCITX)
147153
## FCITX
148154
set(CPACK_PACKAGE_NAME "fcitx-openbangla")
149155
set(CPACK_DEBIAN_PACKAGE_DEPENDS "fcitx5 (>= 5.0.5)")
150156
set(CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.9.0, libzstd >= 1.3.3, fcitx5 >= 5.0.5")
151157
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/lib64/fcitx5" "/usr/share/fcitx5" "/usr/share/fcitx5/inputmethod" "/usr/share/fcitx5/addon")
158+
elseif(ENABLE_BOTH)
159+
set(CPACK_PACKAGE_NAME "openbangla-keyboard")
160+
# set(CPACK_DEBIAN_PACKAGE_DEPENDS "ibus (>= 1.5.1)")
161+
# set(CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.9.0, libzstd >= 1.3.3")
162+
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/ibus" "/usr/share/ibus/component" "/usr/lib64/fcitx5"
163+
"/usr/share/fcitx5" "/usr/share/fcitx5/inputmethod" "/usr/share/fcitx5/addon")
152164
endif()
153165
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${PROJECT_VERSION}-$ENV{DIST}")
154166

src/engine/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ if (OS_LINUX)
1212
add_subdirectory(fcitx)
1313
endif()
1414

15+
if(ENABLE_BOTH)
16+
add_subdirectory(ibus)
17+
add_subdirectory(fcitx)
18+
endif()
19+
1520
## Include subdirectories
1621
add_subdirectory(riti)
1722
endif (OS_LINUX)

tools/build.sh

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
#! /bin/bash
22
RELEASE_VERSION=$(cat version.txt | head -n1)
33
# follow cmake PACKAGE_FILE_NAME directive in main repo
4-
RELEASE_STUB="${IME}-openbangla_${RELEASE_VERSION}-"
4+
RELEASE_STUB="openbangla-keyboard_${RELEASE_VERSION}-"
55

66
makeDeb () {
77
RELEASE_FILENAME="${RELEASE_STUB}${DIST}.deb"
8-
apt-get -y install build-essential pkg-config libibus-1.0-dev cmake libzstd-dev ninja-build curl qtbase5-dev qtbase5-dev-tools file
8+
apt-get -y install build-essential pkg-config libibus-1.0-dev libfcitx5core-dev cmake libzstd-dev ninja-build curl qtbase5-dev qtbase5-dev-tools file
99
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable
1010

11-
if [[ "${IME}" == "ibus" ]]; then
12-
cmake -H"$GITHUB_WORKSPACE" -B/build -GNinja -DCMAKE_INSTALL_PREFIX="/usr" -DENABLE_IBUS=ON -DCPACK_GENERATOR=DEB
13-
else
14-
apt-get -y install libfcitx5core-dev
15-
cmake -H"$GITHUB_WORKSPACE" -B/build -GNinja -DCMAKE_INSTALL_PREFIX="/usr" -DENABLE_FCITX=ON -DCPACK_GENERATOR=DEB
16-
fi
11+
cmake -H"$GITHUB_WORKSPACE" -B/build -GNinja -DCMAKE_INSTALL_PREFIX="/usr" -DENABLE_BOTH=ON -DCPACK_GENERATOR=DEB
1712

1813
ninja package -C /build
1914
RELEASE_FILE="/build/${RELEASE_FILENAME}"
@@ -24,11 +19,7 @@ makeRpmFedora () {
2419
dnf install -y --allowerasing @buildsys-build cmake ibus-devel fcitx5-devel libzstd-devel qt5-qtdeclarative-devel ninja-build curl
2520
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable
2621

27-
if [[ "${IME}" == "ibus" ]]; then
28-
cmake -H"$GITHUB_WORKSPACE" -B/build -GNinja -DCMAKE_INSTALL_PREFIX="/usr" -DENABLE_IBUS=ON -DCPACK_GENERATOR=RPM
29-
else
30-
cmake -H"$GITHUB_WORKSPACE" -B/build -GNinja -DCMAKE_INSTALL_PREFIX="/usr" -DENABLE_FCITX=ON -DCPACK_GENERATOR=RPM
31-
fi
22+
cmake -H"$GITHUB_WORKSPACE" -B/build -GNinja -DCMAKE_INSTALL_PREFIX="/usr" -DENABLE_BOTH=ON -DCPACK_GENERATOR=RPM
3223

3324
ninja package -C /build
3425
RELEASE_FILE="/build/${RELEASE_FILENAME}"
@@ -42,11 +33,7 @@ makeRpmOpenSuse () {
4233
zypper install -y libQt5Core-devel libQt5Widgets-devel libQt5Network-devel libzstd-devel cmake ninja ibus-devel fcitx5-devel gcc curl rpm-build
4334
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable
4435

45-
if [[ "${IME}" == "ibus" ]]; then
46-
cmake -H"$GITHUB_WORKSPACE" -B/build -GNinja -DCMAKE_INSTALL_PREFIX="/usr" -DENABLE_IBUS=ON -DCPACK_GENERATOR=RPM
47-
else
48-
cmake -H"$GITHUB_WORKSPACE" -B/build -GNinja -DCMAKE_INSTALL_PREFIX="/usr" -DENABLE_FCITX=ON -DCPACK_GENERATOR=RPM
49-
fi
36+
cmake -H"$GITHUB_WORKSPACE" -B/build -GNinja -DCMAKE_INSTALL_PREFIX="/usr" -DENABLE_BOTH=ON -DCPACK_GENERATOR=RPM
5037

5138
ninja package -C /build
5239
RELEASE_FILE="/build/${RELEASE_FILENAME}"

0 commit comments

Comments
 (0)