Skip to content

Commit

Permalink
patch to remove so version; compare hap content (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj authored Jan 10, 2025
1 parent c270b73 commit a397560
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
- name: Build HAP
run: |
git apply --directory=entry/src/main/cpp/fcitx5 patches/fcitx5.patch
git apply --directory=entry/src/main/cpp/libime patches/libime.patch
# Install dependencies
ohpm install --all
Expand All @@ -108,6 +109,11 @@ jobs:
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3

compare:
if: ${{ github.ref != 'refs/heads/main' }}
needs: build
uses: ./.github/workflows/compare.yml

release:
needs: build
if: ${{ github.ref == 'refs/heads/main' }}
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/compare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Compare

on:
workflow_call:

jobs:
compare:
runs-on: ubuntu-latest
steps:
- name: Install bsdtar
run: |
sudo apt install -y libarchive-tools
sudo ln -sf /usr/bin/bsdtar /usr/bin/tar
- name: Download artifact
uses: actions/download-artifact@v4
with:
merge-multiple: true

- name: Compare content
run: |
for arch in arm64-v8a x86_64; do
wget -O release-$arch.hap https://github.com/fcitx-contrib/fcitx5-harmony/releases/download/latest/fcitx5-harmony-$arch.hap
tar tf release-$arch.hap > release-$arch.list
echo "## $arch comparison" >> summary.md
tar tf fcitx5-harmony-$arch.hap > $arch.list
diff -u release-$arch.list $arch.list > $arch.diff || true
if [[ -s $arch.diff ]]; then
echo '```diff' >> summary.md
cat $arch.diff >> summary.md
echo '```' >> summary.md
else
echo "No difference." >> summary.md
fi
done
- name: Find comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: "x86_64 comparison"

- name: Create or update comment
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.fc.outputs.comment-id }}
body-path: summary.md
edit-mode: replace
42 changes: 42 additions & 0 deletions patches/fcitx5.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,45 @@ index d3ab20d4..12d55b3e 100644
add_subdirectory(po)

if (ENABLE_TESTING_ADDONS)
diff --git a/src/lib/fcitx-config/CMakeLists.txt b/src/lib/fcitx-config/CMakeLists.txt
index b2f37acd..0cf72d7c 100644
--- a/src/lib/fcitx-config/CMakeLists.txt
+++ b/src/lib/fcitx-config/CMakeLists.txt
@@ -30,8 +30,7 @@ ecm_setup_version(PROJECT

add_library(Fcitx5Config ${FCITX_CONFIG_SOURCES})
set_target_properties(Fcitx5Config
- PROPERTIES VERSION ${Fcitx5Config_VERSION}
- SOVERSION ${Fcitx5Config_SOVERSION}
+ PROPERTIES
EXPORT_NAME Config
)
target_include_directories(Fcitx5Config PUBLIC
diff --git a/src/lib/fcitx-utils/CMakeLists.txt b/src/lib/fcitx-utils/CMakeLists.txt
index 9eb64046..d3d57501 100644
--- a/src/lib/fcitx-utils/CMakeLists.txt
+++ b/src/lib/fcitx-utils/CMakeLists.txt
@@ -121,8 +121,7 @@ ecm_setup_version(PROJECT

add_library(Fcitx5Utils ${FCITX_UTILS_SOURCES})
set_target_properties(Fcitx5Utils
- PROPERTIES VERSION ${Fcitx5Utils_VERSION}
- SOVERSION ${Fcitx5Utils_SOVERSION}
+ PROPERTIES
EXPORT_NAME Utils
)
target_include_directories(Fcitx5Utils PUBLIC
diff --git a/src/lib/fcitx/CMakeLists.txt b/src/lib/fcitx/CMakeLists.txt
index 927d1676..1a40ecea 100644
--- a/src/lib/fcitx/CMakeLists.txt
+++ b/src/lib/fcitx/CMakeLists.txt
@@ -67,8 +67,7 @@ ecm_setup_version(PROJECT

add_library(Fcitx5Core ${FCITX_CORE_SOURCES})
set_target_properties(Fcitx5Core
- PROPERTIES VERSION ${Fcitx5Core_VERSION}
- SOVERSION ${Fcitx5Core_SOVERSION}
+ PROPERTIES
EXPORT_NAME Core
)
target_include_directories(Fcitx5Core PUBLIC
41 changes: 41 additions & 0 deletions patches/libime.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git a/src/libime/core/CMakeLists.txt b/src/libime/core/CMakeLists.txt
index d51e732..14fe6b2 100644
--- a/src/libime/core/CMakeLists.txt
+++ b/src/libime/core/CMakeLists.txt
@@ -71,8 +71,7 @@ set(IMECore_SOVERSION 0)

add_library(IMECore ${LIBIME_SRCS})
set_target_properties(IMECore
- PROPERTIES VERSION ${IMECore_VERSION}
- SOVERSION ${IMECore_SOVERSION}
+ PROPERTIES
EXPORT_NAME Core
)
target_include_directories(IMECore PUBLIC
diff --git a/src/libime/pinyin/CMakeLists.txt b/src/libime/pinyin/CMakeLists.txt
index 96fcbbb..e18a5d0 100644
--- a/src/libime/pinyin/CMakeLists.txt
+++ b/src/libime/pinyin/CMakeLists.txt
@@ -34,8 +34,6 @@ set(IMEPinyin_SOVERSION 0)

add_library(IMEPinyin ${LIBIME_PINYIN_SRCS})
set_target_properties(IMEPinyin PROPERTIES
- VERSION ${IMEPinyin_VERSION}
- SOVERSION ${IMEPinyin_SOVERSION}
EXPORT_NAME Pinyin
)
target_include_directories(IMEPinyin PUBLIC
diff --git a/src/libime/table/CMakeLists.txt b/src/libime/table/CMakeLists.txt
index 620a6ee..5eea112 100644
--- a/src/libime/table/CMakeLists.txt
+++ b/src/libime/table/CMakeLists.txt
@@ -25,8 +25,7 @@ set(IMETable_SOVERSION 0)

add_library(IMETable ${LIBIME_TABLE_SRCS})
set_target_properties(IMETable
- PROPERTIES VERSION ${IMETable_VERSION}
- SOVERSION ${IMETable_SOVERSION}
+ PROPERTIES
EXPORT_NAME Table
)

0 comments on commit a397560

Please sign in to comment.