Skip to content

Commit

Permalink
Fix zlib cross opts
Browse files Browse the repository at this point in the history
Signed-off-by: nyanmisaka <[email protected]>
  • Loading branch information
nyanmisaka committed Apr 20, 2024
1 parent 704b42d commit f8be12c
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,29 @@ UBUNTU_PORTS_ADDR=http://ports.ubuntu.com/ubuntu-ports/
prepare_extra_common() {
case ${ARCH} in
'amd64')
HOST_OPT=""
CC_OPT=""
CXX_OPT=""
AR_OPT=""
CROSS_OPT=""
CMAKE_TOOLCHAIN_OPT=""
MESON_CROSS_OPT=""
;;
'armhf')
CROSS_OPT="--host=armv7-linux-gnueabihf CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++"
HOST_OPT="--host=armv7-linux-gnueabihf"
CC_OPT="CC=arm-linux-gnueabihf-gcc"
CXX_OPT="CXX=arm-linux-gnueabihf-g++"
AR_OPT="AR=arm-linux-gnueabihf-gcc-ar"
CROSS_OPT="${HOST_OPT} ${CC_OPT} ${CXX_OPT}"
CMAKE_TOOLCHAIN_OPT="-DCMAKE_TOOLCHAIN_FILE=${SOURCE_DIR}/toolchain-${ARCH}.cmake"
MESON_CROSS_OPT="--cross-file=${SOURCE_DIR}/cross-${ARCH}.meson"
;;
'arm64')
CROSS_OPT="--host=aarch64-linux-gnu CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++"
HOST_OPT="--host=aarch64-linux-gnu"
CC_OPT="CC=aarch64-linux-gnu-gcc"
CXX_OPT="CXX=aarch64-linux-gnu-g++"
AR_OPT="AR=aarch64-linux-gnu-gcc-ar"
CROSS_OPT="${HOST_OPT} ${CC_OPT} ${CXX_OPT}"
CMAKE_TOOLCHAIN_OPT="-DCMAKE_TOOLCHAIN_FILE=${SOURCE_DIR}/toolchain-${ARCH}.cmake"
MESON_CROSS_OPT="--cross-file=${SOURCE_DIR}/cross-${ARCH}.meson"
;;
Expand Down Expand Up @@ -70,10 +82,9 @@ prepare_extra_common() {
git clone -b v1.3.1 --depth=1 https://github.com/madler/zlib.git
pushd zlib
./configure \
${CROSS_OPT} \
--prefix=${TARGET_DIR} \
--shared
make -j$(nproc) && make install && make install DESTDIR=${SOURCE_DIR}/zlib
make -j$(nproc) ${CC_OPT} ${AR_OPT} && make install && make install DESTDIR=${SOURCE_DIR}/zlib
echo "zlib${TARGET_DIR}/lib/libz.so* usr/lib/jellyfin-ffmpeg/lib" >> ${DPKG_INSTALL_LIST}
popd
popd
Expand Down

0 comments on commit f8be12c

Please sign in to comment.