Skip to content

Commit af0d105

Browse files
committed
init
0 parents  commit af0d105

31 files changed

+1617
-0
lines changed

.github/workflows/ci.yml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
lint:
11+
runs-on: macos-13
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
submodules: true # needs fcitx5/.clang-format
16+
17+
- name: Install dependencies
18+
run: brew install clang-format swift-format
19+
20+
- name: Lint
21+
run: |
22+
find macosfrontend src -name '*.cpp' -o -name '*.h' | xargs clang-format -Werror --dry-run -style=file:fcitx5/.clang-format
23+
swift-format lint -rs src
24+
swiftlint --strict src
25+
26+
build:
27+
needs: lint
28+
runs-on: macos-13
29+
strategy:
30+
matrix:
31+
arch: [x86_64]
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
with:
36+
submodules: true
37+
38+
- uses: SwiftyLab/setup-swift@latest
39+
40+
- uses: actions/setup-python@v5
41+
with:
42+
python-version: '3.12'
43+
44+
- name: Install dependencies
45+
run: |
46+
brew install \
47+
fmt \
48+
extra-cmake-modules \
49+
ninja
50+
pip install "dmgbuild[badge_icons]"
51+
52+
- name: Build
53+
run: |
54+
cmake -B build -G Ninja \
55+
-DCMAKE_Swift_COMPILER=`which swiftc` \
56+
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} \
57+
-DCMAKE_BUILD_TYPE=Release
58+
cmake --build build
59+
sudo cmake --install build
60+
dmgbuild -s dmg/config.py Fcitx5 Fcitx5-${{ matrix.arch }}.dmg
61+
62+
- name: Upload artifact
63+
uses: actions/upload-artifact@v4
64+
with:
65+
path: |
66+
Fcitx5-${{ matrix.arch }}.dmg
67+
68+
release:
69+
needs: build
70+
if: ${{ github.ref == 'refs/heads/master' }}
71+
runs-on: ubuntu-latest
72+
steps:
73+
- name: Download artifact
74+
uses: actions/download-artifact@v4
75+
with:
76+
merge-multiple: true
77+
78+
- name: Create Nightly release
79+
if: ${{ github.ref == 'refs/heads/master' }}
80+
uses: 'marvinpinto/action-automatic-releases@latest'
81+
with:
82+
repo_token: ${{ secrets.GITHUB_TOKEN }}
83+
automatic_release_tag: latest
84+
prerelease: true
85+
title: "Nightly Build"
86+
files: |
87+
Fcitx5-x86_64.dmg

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
build
3+
*.dmg

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "fcitx5"]
2+
path = fcitx5
3+
url = https://github.com/fcitx/fcitx5

CMakeLists.txt

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
cmake_minimum_required(VERSION 3.27)
2+
3+
project(fcitx5-macos VERSION 0.1.0 LANGUAGES CXX Swift)
4+
5+
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
6+
7+
include(InitializeSwift)
8+
include(AddSwift)
9+
10+
set(CMAKE_CXX_STANDARD 17)
11+
12+
option(ENABLE_TEST "" OFF)
13+
option(ENABLE_COVERAGE "" OFF)
14+
option(ENABLE_ENCHANT "" OFF)
15+
option(ENABLE_X11 "" OFF)
16+
option(ENABLE_WAYLAND "" OFF)
17+
option(ENABLE_DBUS "" OFF)
18+
option(ENABLE_DOC "" OFF)
19+
option(ENABLE_SERVER "" OFF)
20+
option(ENABLE_KEYBOARD "" OFF)
21+
option(USE_SYSTEMD "" OFF)
22+
option(ENABLE_XDGAUTOSTART "" OFF)
23+
option(ENABLE_EMOJI "" OFF)
24+
option(ENABLE_LIBUUID "" OFF)
25+
26+
set(APP_INSTALL_PATH "/Library/Input Methods")
27+
set(CMAKE_INSTALL_PREFIX "${APP_INSTALL_PATH}/Fcitx5.app/Contents")
28+
# Reproducible
29+
set(CMAKE_INSTALL_LIBDATADIR "${CMAKE_INSTALL_PREFIX}/lib")
30+
add_subdirectory(fcitx5)
31+
32+
add_subdirectory(macosfrontend)
33+
34+
include_directories(include)
35+
add_subdirectory(src)
36+
add_subdirectory(dmg)

0 commit comments

Comments
 (0)