Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,29 @@ jobs:
name: artifacts-linux-x86_64
path: libjpeg-turbo/build/.libs/libturbojpeg.so
if-no-files-found: error
build-windows-arm64-xcompile-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
- name: Build native code
run: |
./winarm64-xcompile-on-unix.sh
- uses: actions/upload-artifact@v3
if: failure()
with:
name: configure log
path: libjpeg-turbo/build/config.log
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: artifacts-windows-arm64
path: libjpeg-turbo/build_winarm/.libs/libturbojpeg-arm64.dll
if-no-files-found: error
build-windows-x86_64:
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -94,7 +117,7 @@ jobs:
path: libjpeg-turbo/build/**/turbojpeg.dll
if-no-files-found: error
build-package:
needs: [build-macos-x86_64, build-windows-x86_64, build-linux-x86_64]
needs: [build-macos-x86_64, build-windows-x86_64, build-linux-x86_64, build-windows-x86_64]
runs-on: ubuntu-latest
env:
gradle_commands: --stacktrace clean jar
Expand Down Expand Up @@ -157,5 +180,6 @@ jobs:
files: |
artifacts-macos-x86_64/*.dylib
artifacts-linux-x86_64/*.so
artifacts-windows-arm64/*.dll
artifacts-windows-x86_64/Debug/*.dll
libjpeg-turbo-java/*.jar
2 changes: 2 additions & 0 deletions jar-pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ mkdir -p META-INF/lib/osx_64
mv ../../artifacts-macos-x86_64/libturbojpeg.dylib META-INF/lib/osx_64/
mkdir -p META-INF/lib/linux_64
mv ../../artifacts-linux-x86_64/libturbojpeg.so META-INF/lib/linux_64/
mkdir -p META-INF/lib/windows_arm64
mv ../../artifacts-windows-arm64/libturbojpeg.dll META-INF/lib/windows_arm64/

# repack the jar file to include the native libraries
jar uvvf libjpeg-turbo*.jar META-INF/lib/*
21 changes: 21 additions & 0 deletions winarm64-xcompile-on-unix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
if [ ! -d "jdk" ]; then
# https://learn.microsoft.com/en-us/java/openjdk/download#openjdk-11
wget https://aka.ms/download-jdk/microsoft-jdk-11.0.21-windows-aarch64.zip -O jdk.zip
unzip jdk.zip
rm jdk.zip
mv jdk-11.0.21+9 jdk
fi
export JAVA_HOME="${PWD}/jdk"
export CPPFLAGS="-I${JAVA_HOME}/include -I${JAVA_HOME}/include/win32"
export CC="zig cc -target aarch64-windows"
export CXX="zig c++ -target aarch64-windows"
export AR="zig ar"
export RANLIB="zig ranlib"
cd libjpeg-turbo
autoreconf -fiv
mkdir build_winarm
cd build_winarm
../configure --with-java --host aarch64-windows
make
zig cc -target aarch64-windows .libs/libturbojpeg.a -shared -o .libs/libturbojpeg-arm64.dll