Skip to content

Commit

Permalink
Merge pull request #7 from spacedriveapp/onnx-0.17
Browse files Browse the repository at this point in the history
Update onnx and pdfium
  • Loading branch information
HeavenVolkoff authored Feb 8, 2024
2 parents 4f362c4 + 1e8ab16 commit ae6cbd1
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 50 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- 'patches/**'
- 'scripts/**'
- 'Dockerfile'
- '.gitignore'
- '.github/workflows/release.yml'
branches:
- main
Expand All @@ -16,7 +15,6 @@ on:
- 'patches/**'
- 'scripts/**'
- 'Dockerfile'
- '.gitignore'
- '.github/workflows/release.yml'
workflow_dispatch:

Expand Down Expand Up @@ -59,7 +57,7 @@ jobs:
- name: Build native-deps
run: |
set -euxo pipefail
docker build --no-cache --build-arg TARGET=${{ matrix.settings.target }} -o . .
docker build --no-cache --build-arg TARGET=${{ matrix.settings.target }} --build-arg VERSION="$(echo ${{ github.ref }} | sed -E 's/refs\/tags\/v?//g' | sed -E 's/[^0-9.]//g')" -o . .
mv out/src.tar.xz ./native-deps-${{ matrix.settings.target }}-src.tar.xz
export XZ_OPT='-T0 -7'
tar -cJf "native-deps-${{ matrix.settings.target }}.tar.xz" -C out .
Expand Down
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
ARG OUT="/opt/out"
ARG TARGET="x86_64-linux-gnu"
ARG ZIG_VERSION="0.11.0"
ARG MESON_VERSION="1.3.0"
ARG CMAKE_VERSION="3.27.0"
ARG MESON_VERSION="1.3.1"
ARG CMAKE_VERSION="3.28.3"
ARG PATCHELF_VERSION="0.18.0"
ARG MACOS_SDK_VERSION="14.2"

Expand All @@ -14,8 +14,6 @@ FROM debian:bookworm as build-base

SHELL ["bash", "-euxo", "pipefail", "-c"]

COPY ./VERSION /srv/VERSION

# Configure apt to be docker friendly
ADD https://gist.githubusercontent.com/HeavenVolkoff/ff7b77b9087f956b8df944772e93c071/raw `
/etc/apt/apt.conf.d/99docker-apt-config
Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

5 changes: 3 additions & 2 deletions scripts/cc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,9 @@ case "${TARGET:-}" in
esac
;;
arm64* | aarch64*)
if [ "$assembler" -eq 1 ] && [ "$preprocessor" -eq 0 ]; then
# This is an workaround for zig not supporting some features when compiling arm assembler code
if [ "$preprocessor" -eq 0 ] && { [ $assembler -eq 1 ] || [ $assembler_file -eq 1 ]; }; then
# This is an workaround for zig not supporting passing explict features when compiling assembler code
# https://github.com/ziglang/zig/issues/10411
c_argv+=(-Xassembler "-march=armv8.2-a${features}")
else
case "${TARGET:-}" in
Expand Down
16 changes: 7 additions & 9 deletions scripts/create-framework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ case "$TARGET" in
;;
esac

_version="$(cat /srv/VERSION)"
if [ -z "$_version" ]; then
echo "Missing VERSION file" >&2
exit 1
if [ -z "${VERSION:-}" ]; then
VERSION="0.0.0"
fi

# Create Spacedrive.framework
Expand Down Expand Up @@ -79,7 +77,7 @@ cat <<EOF >"${OUT}/${_framework}/Versions/Current/Resources/Info.plist"
<key>CFBundleExecutable</key>
<string>Spacedrive</string>
<key>CFBundleGetInfoString</key>
<string>Spacedrive Native Dependencies ${_version}</string>
<string>Spacedrive Native Dependencies ${VERSION}</string>
<key>CFBundleIdentifier</key>
<string>com.spacedrive</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand All @@ -89,11 +87,11 @@ cat <<EOF >"${OUT}/${_framework}/Versions/Current/Resources/Info.plist"
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>${_version}</string>
<string>${VERSION}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${_version}</string>
<string>${VERSION}</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright (c) 2021-present Spacedrive Technology Inc.</string>
</dict>
Expand All @@ -108,9 +106,9 @@ cat <<EOF >"${OUT}/${_framework}/Versions/Current/Resources/version.plist"
<key>BuildVersion</key>
<string>1</string>
<key>CFBundleShortVersionString</key>
<string>${_version}</string>
<string>${VERSION}</string>
<key>CFBundleVersion</key>
<string>${_version}</string>
<string>${VERSION}</string>
<key>ProjectName</key>
<string>Spacedrive</string>
<key>SourceVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion stages/20-zlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ esac
echo "Download zlib..."
mkdir -p zlib

curl_tar 'https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.1.5.tar.gz' zlib 1
curl_tar 'https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.1.6.tar.gz' zlib 1

# Patch cmake to disable armv6 assembly, it thinks we support it, but we don't
sed -i 's/HAVE_ARMV6_INLINE_ASM OR HAVE_ARMV6_INTRIN/HAVE_ARMV6_INLINE_ASM AND HAVE_ARMV6_INTRIN/' zlib/CMakeLists.txt
Expand Down
2 changes: 1 addition & 1 deletion stages/25-lzma.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
echo "Download lzma..."
mkdir -p lzma

curl_tar 'https://github.com/tukaani-project/xz/releases/download/v5.4.5/xz-5.4.5.tar.xz' lzma 1
curl_tar 'https://github.com/tukaani-project/xz/releases/download/v5.4.6/xz-5.4.6.tar.xz' lzma 1

case "$TARGET" in
*darwin*)
Expand Down
2 changes: 1 addition & 1 deletion stages/50-vulkan/45-vulkan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ esac
echo "Download vulkan..."
mkdir -p vulkan-headers

curl_tar 'https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.3.274.tar.gz' vulkan-headers 1
curl_tar 'https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/vulkan-sdk-1.3.275.0.tar.gz' vulkan-headers 1

VERSION="$(
sed -nr \
Expand Down
2 changes: 1 addition & 1 deletion stages/50-vulkan/55-spirv-cross.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ esac
echo "Download spirv..."
mkdir -p spirv

curl_tar 'https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz' spirv 1
curl_tar 'https://github.com/KhronosGroup/SPIRV-Cross/archive/refs/tags/vulkan-sdk-1.3.275.0.tar.gz' spirv 1

VERSION="$(
grep -Po 'set\(spirv-cross-abi-major\s+\K\d+' spirv/CMakeLists.txt
Expand Down
10 changes: 5 additions & 5 deletions stages/50-vulkan/60-placebo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ esac
echo "Download placebo..."
mkdir -p placebo

curl_tar 'https://github.com/haasn/libplacebo/archive/refs/tags/v6.338.1.tar.gz' placebo 1
curl_tar 'https://github.com/haasn/libplacebo/archive/refs/tags/v6.338.2.tar.gz' placebo 1

# Thrid party deps
curl_tar 'https://github.com/pallets/jinja/archive/refs/tags/3.1.2.tar.gz' placebo/3rdparty/jinja 1
curl_tar 'https://github.com/pallets/markupsafe/archive/refs/tags/2.1.3.tar.gz' placebo/3rdparty/markupsafe 1
curl_tar 'https://github.com/fastfloat/fast_float/archive/refs/tags/v5.3.0.tar.gz' placebo/3rdparty/fast_float 1
# Third party deps
curl_tar 'https://github.com/pallets/jinja/archive/refs/tags/3.1.3.tar.gz' placebo/3rdparty/jinja 1
curl_tar 'https://github.com/pallets/markupsafe/archive/refs/tags/2.1.5.tar.gz' placebo/3rdparty/markupsafe 1
curl_tar 'https://github.com/fastfloat/fast_float/archive/refs/tags/v6.1.0.tar.gz' placebo/3rdparty/fast_float 1

sed -i "s|windows.compile_resources(libplacebo_rc, depends: version_h,|windows.compile_resources(libplacebo_rc, depends: version_h, args: '/c65001',|" placebo/src/meson.build

Expand Down
39 changes: 20 additions & 19 deletions stages/99-ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,26 @@ curl_tar 'https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n6.1.1.tar.gz' ffmp

# Handbreak patches
for patch in \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A01-mov-read-name-track-tag-written-by-movenc.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A02-movenc-write-3gpp-track-titl-tag.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A03-mov-read-3gpp-udta-tags.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A04-movenc-write-3gpp-track-names-tags-for-all-available.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A05-dvdsubdec-fix-processing-of-partial-packets.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A06-dvdsubdec-return-number-of-bytes-used.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A07-dvdsubdec-use-pts-of-initial-packet.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A08-ccaption_dec-fix-pts-in-real_time-mode.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A09-matroskaenc-aac-extradata-updated.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A10-amfenc-Add-support-for-pict_type-field.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A11-amfenc-Fixes-the-color-information-in-the-ou.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A12-amfenc-HDR-metadata.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A13-libavcodec-amfenc-Fix-issue-with-missing-headers-in-.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A14-avcodec-add-ambient-viewing-environment-packet-side-.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A15-avformat-mov-add-support-for-amve-ambient-viewing-en.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A16-videotoolbox-dec-h264.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A17-libswscale-fix-yuv420p-to-p01xle-color-conversion-bu.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A18-qsv-fix-decode-10bit-hdr.patch' \
'https://github.com/HandBrake/HandBrake/raw/aa9e84d/contrib/ffmpeg/A19-ffbuild-common-use-gzip-n-flag-for-cuda.patch'; do
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A01-mov-read-name-track-tag-written-by-movenc.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A02-movenc-write-3gpp-track-titl-tag.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A03-mov-read-3gpp-udta-tags.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A04-movenc-write-3gpp-track-names-tags-for-all-available.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A05-dvdsubdec-fix-processing-of-partial-packets.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A06-dvdsubdec-return-number-of-bytes-used.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A07-dvdsubdec-use-pts-of-initial-packet.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A08-ccaption_dec-fix-pts-in-real_time-mode.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A09-matroskaenc-aac-extradata-updated.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A10-amfenc-Add-support-for-pict_type-field.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A11-amfenc-Fixes-the-color-information-in-the-ou.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A12-amfenc-HDR-metadata.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A13-libavcodec-amfenc-Fix-issue-with-missing-headers-in-.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A14-avcodec-add-ambient-viewing-environment-packet-side-.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A15-avformat-mov-add-support-for-amve-ambient-viewing-en.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A16-videotoolbox-dec-h264.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A17-libswscale-fix-yuv420p-to-p01xle-color-conversion-bu.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A18-qsv-fix-decode-10bit-hdr.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A19-ffbuild-common-use-gzip-n-flag-for-cuda.patch' \
'https://github.com/HandBrake/HandBrake/raw/f1258be/contrib/ffmpeg/A20-vf_scale_preserve_range.patch'; do
curl "$patch" | patch -F5 -lp1 -d ffmpeg -t
done

Expand Down
6 changes: 4 additions & 2 deletions stages/99-onnx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
echo "Download onnx..."
mkdir -p onnx

_version='1.16.3'
_version='1.17.0'

case "$TARGET" in
*windows*)
Expand Down Expand Up @@ -36,7 +36,7 @@ curl_tar "https://github.com/microsoft/onnxruntime/archive/refs/tags/v${_version
sed -i 's/defined(__ANDROID__)/defined(__ANDROID__) \&\& (defined(__APPLE__) || defined(__GLIBC__) || defined(PLATFORM_IS_BSD))/g' onnx/onnxruntime/core/platform/posix/stacktrace.cc

# Remove unused components
rm -r onnx/{.*,requirements*.txt,*swift,*.py,cgmanifests,dockerfiles,objectivec,ORT_icon_for_light_bg.png,rust,samples,java,docs,orttraining,js,csharp,winml,onnxruntime/{wasm,test,tool,python,core/flatbuffers/ort_flatbuffers_py,contrib_ops/{js,rocm,cuda}}}
rm -r onnx/{.*,requirements*.txt,*.py,cgmanifests,dockerfiles,objectivec,*.png,rust,samples,java,docs,orttraining,js,csharp,winml,onnxruntime/{wasm,test,tool,python,core/flatbuffers/ort_flatbuffers_py,contrib_ops/{js,rocm,cuda}}}

# Backup source
bak_src 'onnx'
Expand Down Expand Up @@ -97,6 +97,8 @@ case "$TARGET" in
args+=(
-Donnxruntime_USE_COREML=On
)
# Allow deprecated usage of ATOMIC_VAR_INIT by https://github.com/google/nsync
export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS"
;;
esac

Expand Down
2 changes: 1 addition & 1 deletion stages/99-pdfium.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
echo "Download pdfium..."
mkdir -p pdfium

_tag='chromium/6233'
_tag='chromium/6281'
case "$TARGET" in
x86_64-windows*)
_name='win-x64'
Expand Down

0 comments on commit ae6cbd1

Please sign in to comment.