Skip to content

Commit b3b3751

Browse files
committed
Build for Linux ARM.
1 parent b6cc943 commit b3b3751

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ jobs:
77
build:
88
strategy:
99
matrix:
10-
os: [ubuntu-20.04, windows-2019, macOS-13]
10+
os: [ubuntu-20.04, windows-2019, macOS-13, ubuntu-22.04-arm]
1111
runs-on: ${{ matrix.os }}
1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1515
- name: Checkout textadept-build dependencies
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
with:
1818
repository: orbitalquark/textadept-build
1919
path: textadept-build
@@ -25,9 +25,9 @@ jobs:
2525
cmake --build build --config Release --target diff -j
2626
cmake --install build --config Release
2727
- name: Upload artifacts
28-
uses: actions/upload-artifact@v3
28+
uses: actions/upload-artifact@v4
2929
with:
30-
name: artifacts
30+
name: artifacts-${{ matrix.os }}
3131
path: |
3232
*.so
3333
*.dll
@@ -36,11 +36,11 @@ jobs:
3636
needs: build
3737
steps:
3838
- name: Checkout
39-
uses: actions/checkout@v3
39+
uses: actions/checkout@v4
4040
- name: Download artifacts
41-
uses: actions/download-artifact@v3
41+
uses: actions/download-artifact@v4
4242
with:
43-
name: artifacts
43+
merge-multiple: true
4444
- name: Package
4545
shell: bash
4646
run: |

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ set(diff_match_patch_zip 7f95b37e554453262e2bcda830724fc362614103.zip)
1717
FetchContent_Declare(diff_match_patch
1818
URL https://github.com/leutloff/diff-match-patch-cpp-stl/archive/${diff_match_patch_zip})
1919
FetchContent_MakeAvailable(diff_match_patch)
20-
set(lua_tgz lua-5.4.4.tar.gz)
20+
set(lua_tgz lua-5.4.7.tar.gz)
2121
set(lua_url file://${CMAKE_BINARY_DIR}/_deps/${lua_tgz})
2222
if(NOT EXISTS ${CMAKE_BINARY_DIR}/_deps/${lua_tgz})
2323
set(lua_url https://www.lua.org/ftp/${lua_tgz})
@@ -45,7 +45,11 @@ endif()
4545
# Install.
4646
install(TARGETS diff DESTINATION ${src})
4747
if(NOT (WIN32 OR APPLE))
48-
install(CODE "file(RENAME ${src}/libdiff.so ${src}/diff.so)")
48+
if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch")
49+
install(CODE "file(RENAME ${src}/libdiff.so ${src}/diff.so)")
50+
else()
51+
install(CODE "file(RENAME ${src}/libdiff.so ${src}/diffarm.so)")
52+
endif()
4953
elseif(APPLE)
5054
install(CODE "file(RENAME ${src}/libdiff.dylib ${src}/diffosx.so)")
5155
endif()

diff.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ int luaopen_diff(lua_State *L) { return (lua_pushcfunction(L, diff), 1); }
2828
// Platform-specific Lua library entry points.
2929
LUALIB_API int luaopen_file_diff_diff(lua_State *L) { return luaopen_diff(L); }
3030
LUALIB_API int luaopen_file_diff_diffosx(lua_State *L) { return luaopen_diff(L); }
31+
LUALIB_API int luaopen_file_diff_diffarm(lua_State *L) { return luaopen_diff(L); }
3132
}

init.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ if not rawget(_L, 'Compare Files') then
9797
end
9898

9999
local lib = 'file_diff.diff'
100-
if OSX then lib = lib .. 'osx' end
100+
if OSX then
101+
lib = lib .. 'osx'
102+
elseif LINUX and io.popen('uname -m'):read() == 'aarch64' then
103+
lib = lib .. 'arm'
104+
end
101105
local diff = require(lib)
102106
local DELETE, INSERT = 0, 1 -- C++: "enum Operation {DELETE, INSERT, EQUAL};"
103107

0 commit comments

Comments
 (0)