-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
136 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: CMake Build and Test | ||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- "**.cpp" | ||
- "**.h" | ||
- "**CMakeLists.txt" | ||
pull_request: | ||
branches: [main] | ||
paths: | ||
- "**.cpp" | ||
- "**.h" | ||
- "**CMakeLists.txt" | ||
|
||
jobs: | ||
build: | ||
name: Build and Test on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04] | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.16 | ||
- name: Install Fcitx5 dev packages | ||
run: sudo apt install -y fcitx5-modules-dev | ||
- name: Build and install Varnam | ||
run: | | ||
cd ../ | ||
git clone https://github.com/varnamproject/govarnam.git govarnam | ||
cd govarnam | ||
make | ||
sudo make install | ||
- name: Install Cmake | ||
run: sudo apt install -y cmake extra-cmake-modules pkgconf | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set reusable strings | ||
id: strings | ||
shell: bash | ||
run: | | ||
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | ||
- name: Configure Project | ||
run: > | ||
cmake -B ${{ steps.strings.outputs.build-output-dir }} | ||
-DCMAKE_BUILD_TYPE=Debug | ||
-DCMAKE_INSTALL_PREFIX=/usr | ||
-DVARNAM_DEBUG=ON | ||
-S ${{ github.workspace }} | ||
- name: Build | ||
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Debug | ||
- name: Test | ||
working-directory: ${{ steps.strings.outputs.build-output-dir }} | ||
run: ctest --build-config Debug |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
cmake_minimum_required(VERSION 3.25) | ||
|
||
project(fcitx5-varnam VERSION 0.0.2) | ||
|
||
find_package(ECM REQUIRED 1.0.0 REQUIRED) | ||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) | ||
|
||
include(FeatureSummary) | ||
include(GNUInstallDirs) | ||
include(ECMUninstallTarget) | ||
|
||
find_package(Fcitx5Core 5.0.2 REQUIRED) | ||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(varnam "govarnam" IMPORTED_TARGET REQUIRED) | ||
|
||
include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake") | ||
add_definitions(-DFCITX_GETTEXT_DOMAIN=\"fcitx5-varnam\" -D_GNU_SOURCE) | ||
fcitx5_add_i18n_definition() | ||
|
||
option(VARNAM_DEBUG "Enable debug logs" OFF) | ||
|
||
add_subdirectory(src) | ||
add_subdirectory(icons) | ||
|
||
install(FILES "com.varnamproject.Fcitx5.Addon.varnamfcitx.metainfo.xml.in" | ||
RENAME com.varnamproject.Fcitx5.Addon.varnamfcitx.metainfo.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo) | ||
|
||
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
install(DIRECTORY 48x48 DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor" | ||
PATTERN .* EXCLUDE | ||
PATTERN *~ EXCLUDE) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
set(varnam_fcitx_sources | ||
varnam_engine.cpp | ||
varnam_state.cpp | ||
varnam_candidate.cpp | ||
varnam_utils.cpp | ||
) | ||
|
||
add_library(varnamfcitx MODULE ${varnam_fcitx_sources}) | ||
target_link_libraries(varnamfcitx Fcitx5::Core Fcitx5::Config PkgConfig::varnam) | ||
|
||
if(VARNAM_DEBUG) | ||
target_compile_definitions(varnamfcitx PRIVATE DEBUG_MODE) | ||
endif() | ||
|
||
install(TARGETS varnamfcitx DESTINATION "${CMAKE_INSTALL_LIBDIR}/fcitx5") | ||
|
||
configure_file(varnamfcitx-addon.conf.in varnamfcitx-addon.conf) | ||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/varnamfcitx-addon.conf" RENAME varnamfcitx.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon") | ||
install(FILES "varnamfcitx.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/inputmethod") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters