-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjar-pack.sh
More file actions
executable file
·24 lines (20 loc) · 865 Bytes
/
jar-pack.sh
File metadata and controls
executable file
·24 lines (20 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
set -x
cd build/libs
# unpack the Java-only jar
jar xvvf libjpeg-turbo*.jar
# for each platform, create the lib directory suitable for
# https://github.com/scijava/native-lib-loader
# and move the corresponding library file
mkdir -p META-INF/lib/windows_64
mv ../../artifacts-windows-x86_64/Debug/turbojpeg.dll META-INF/lib/windows_64/
mkdir -p META-INF/lib/osx_arm64
mv ../../artifacts-macos-arm64/libturbojpeg.dylib META-INF/lib/osx_arm64/
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_arm64
mv ../../artifacts-linux-arm64/libturbojpeg.so META-INF/lib/linux_arm64/
mkdir -p META-INF/lib/linux_64
mv ../../artifacts-linux-x86_64/libturbojpeg.so META-INF/lib/linux_64/
# repack the jar file to include the native libraries
jar uvvf libjpeg-turbo*.jar META-INF/lib/*