Files
jellyfin-ffmpeg/builder/scripts.d/25-openssl.sh
T

95 lines
2.4 KiB
Bash
Raw Normal View History

2022-11-11 18:15:45 +08:00
#!/bin/bash
SCRIPT_REPO="https://github.com/openssl/openssl.git"
2026-05-28 10:55:08 +08:00
SCRIPT_COMMIT="openssl-3.6.2"
SCRIPT_TAGFILTER="openssl-3.6.*"
2022-11-11 18:15:45 +08:00
ffbuild_enabled() {
return 0
}
ffbuild_dockerbuild() {
git-mini-clone "$SCRIPT_REPO" "$SCRIPT_COMMIT" openssl
cd openssl
2023-10-16 19:45:33 +08:00
git submodule update --init --recursive --depth=1
2022-11-11 18:15:45 +08:00
local myconf=(
threads
zlib
no-shared
2023-10-16 19:45:33 +08:00
no-tests
no-apps
no-legacy
no-ssl3
2022-11-11 18:15:45 +08:00
enable-camellia
enable-ec
enable-srp
--prefix="$FFBUILD_PREFIX"
2023-10-16 19:45:33 +08:00
--libdir=lib
2022-11-11 18:15:45 +08:00
)
if [[ $TARGET == win64 ]]; then
myconf+=(
--cross-compile-prefix="$FFBUILD_CROSS_PREFIX"
mingw64
)
elif [[ $TARGET == win32 ]]; then
myconf+=(
--cross-compile-prefix="$FFBUILD_CROSS_PREFIX"
mingw
)
elif [[ $TARGET == linux64 ]]; then
myconf+=(
--cross-compile-prefix="$FFBUILD_CROSS_PREFIX"
linux-x86_64
)
elif [[ $TARGET == linuxarm64 ]]; then
myconf+=(
--cross-compile-prefix="$FFBUILD_CROSS_PREFIX"
linux-aarch64
)
2024-02-24 00:07:11 +08:00
elif [[ $TARGET == mac* ]]; then
if [ "$MACOS_BUILDER_CPU_ARCH" = "arm64" ] && [ "$TARGET" = "mac64" ]; then
myconf+=(
darwin64-x86_64
)
fi
2022-11-11 18:15:45 +08:00
else
echo "Unknown target"
return -1
fi
2023-10-16 19:45:33 +08:00
export CFLAGS="$CFLAGS -fno-strict-aliasing"
export CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
2024-03-04 20:09:00 +08:00
if [[ $TARGET == mac* ]]; then
gsed -i '/^my @disablables =/ s/$/"apps",/' Configure
else
2024-02-24 00:07:11 +08:00
# OpenSSL build system prepends the cross prefix itself
export CC="${CC/${FFBUILD_CROSS_PREFIX}/}"
export CXX="${CXX/${FFBUILD_CROSS_PREFIX}/}"
export AR="${AR/${FFBUILD_CROSS_PREFIX}/}"
export RANLIB="${RANLIB/${FFBUILD_CROSS_PREFIX}/}"
2023-10-16 19:45:33 +08:00
2024-02-24 00:07:11 +08:00
# Actually allow Configure to disable apps
sed -i '/^my @disablables =/ s/$/"apps",/' Configure
fi
2022-11-11 18:15:45 +08:00
./Configure "${myconf[@]}"
2024-02-24 00:07:11 +08:00
if [[ $TARGET == mac* ]]; then
gsed -i -e "/^CFLAGS=/s|=.*|=${CFLAGS}|" -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" Makefile
else
sed -i -e "/^CFLAGS=/s|=.*|=${CFLAGS}|" -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" Makefile
fi
2022-11-11 18:15:45 +08:00
2023-10-16 19:45:33 +08:00
make -j$(nproc) build_sw
2022-11-11 18:15:45 +08:00
make install_sw
}
2023-10-16 19:45:33 +08:00
ffbuild_configure() {
[[ $TARGET == win* ]] && return 0
echo --enable-openssl
}