Skip to content

Commit a78f120

Browse files
committed
Mac fix
1 parent 1ac69a4 commit a78f120

File tree

1 file changed

+47
-28
lines changed

1 file changed

+47
-28
lines changed

build-ffmpeg

Lines changed: 47 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ download() {
9393

9494
make_dir "$DOWNLOAD_PATH/$TARGETDIR"
9595

96+
if [[ "$DOWNLOAD_FILE" == *"patch"* ]]; then
97+
return
98+
fi
99+
96100
if [ -n "$3" ]; then
97101
if ! tar -xvf "$DOWNLOAD_PATH/$DOWNLOAD_FILE" -C "$DOWNLOAD_PATH/$TARGETDIR" 2>/dev/null >/dev/null; then
98102
echo "Failed to extract $DOWNLOAD_FILE"
@@ -305,6 +309,17 @@ fi
305309
## build tools
306310
##
307311

312+
if build "giflib" "5.2.1"; then
313+
download "https://sourceforge.net/projects/giflib/files/giflib-5.2.1.tar.gz"
314+
if [[ "$OSTYPE" == "darwin"* ]]; then
315+
download "https://sourceforge.net/p/giflib/bugs/_discuss/thread/4e811ad29b/c323/attachment/Makefile.patch"
316+
execute patch "${PACKAGES}/giflib-5.2.1/Makefile" ${PACKAGES}/Makefile.patch""
317+
fi
318+
execute make -j $MJOBS
319+
execute make PREFIX="${WORKSPACE}" install
320+
build_done "giflib" "5.2.1"
321+
fi
322+
308323
if build "pkg-config" "0.29.2"; then
309324
download "https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz"
310325
execute ./configure --silent --prefix="${WORKSPACE}" --with-pc-path="${WORKSPACE}"/lib/pkgconfig --with-internal-glib
@@ -385,12 +400,12 @@ if $NONFREE_AND_GPL; then
385400
CONFIGURE_OPTIONS+=("--enable-openssl")
386401
fi
387402

388-
if build "cmake" "3.21.2"; then
389-
download "https://cmake.org/files/LatestRelease/cmake-3.21.2.tar.gz"
403+
if build "cmake" "3.22.0"; then
404+
download "https://github.com/Kitware/CMake/releases/download/v3.22.0/cmake-3.22.0.tar.gz"
390405
execute ./configure --prefix="${WORKSPACE}" --parallel="${MJOBS}" -- -DCMAKE_USE_OPENSSL=OFF
391406
execute make -j $MJOBS
392407
execute make install
393-
build_done "cmake" "3.21.2"
408+
build_done "cmake" "3.22.0"
394409
fi
395410

396411
##
@@ -408,15 +423,17 @@ if command_exists "python3"; then
408423
fi
409424
done
410425
fi
411-
if build "dav1d" "0.9.2"; then
412-
download "https://code.videolan.org/videolan/dav1d/-/archive/0.9.2/dav1d-0.9.2.tar.gz"
413-
make_dir build
414-
execute meson build --prefix="${WORKSPACE}" --buildtype=release --default-library=static --libdir="${WORKSPACE}"/lib
415-
execute ninja -C build
416-
execute ninja -C build install
417-
build_done "dav1d" "0.9.2"
426+
if command_exists "meson"; then
427+
if build "dav1d" "0.9.2"; then
428+
download "https://code.videolan.org/videolan/dav1d/-/archive/0.9.2/dav1d-0.9.2.tar.gz"
429+
make_dir build
430+
execute meson build --prefix="${WORKSPACE}" --buildtype=release --default-library=static --libdir="${WORKSPACE}"/lib
431+
execute ninja -C build
432+
execute ninja -C build install
433+
build_done "dav1d" "0.9.2"
434+
fi
435+
CONFIGURE_OPTIONS+=("--enable-libdav1d")
418436
fi
419-
CONFIGURE_OPTIONS+=("--enable-libdav1d")
420437
fi
421438

422439
if ! $MACOS_M1; then
@@ -738,12 +755,12 @@ fi
738755
## image library
739756
##
740757

741-
if build "libtiff" "4.3.0"; then
742-
download "https://download.osgeo.org/libtiff/tiff-4.3.0.tar.gz"
743-
execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static
758+
if build "libtiff" "4.2.0"; then
759+
download "https://download.osgeo.org/libtiff/tiff-4.2.0.tar.gz"
760+
execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static --disable-dependency-tracking --disable-lzma --disable-webp --disable-zstd --without-x
744761
execute make -j $MJOBS
745762
execute make install
746-
build_done "libtiff" "4.3.0"
763+
build_done "libtiff" "4.2.0"
747764
fi
748765
if build "libpng" "1.6.37"; then
749766
download "https://sourceforge.net/projects/libpng/files/libpng16/1.6.37/libpng-1.6.37.tar.gz/download?use_mirror=gigenet" "libpng-1.6.37.tar.gz"
@@ -755,21 +772,23 @@ if build "libpng" "1.6.37"; then
755772
build_done "libpng" "1.6.37"
756773
fi
757774

758-
if build "libwebp" "1.2.1"; then
759-
# libwebp can fail to compile on Ubuntu if these flags were left set to CFLAGS
760-
CPPFLAGS=
761-
download "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.1.tar.gz" "libwebp-1.2.1.tar.gz"
762-
execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static --disable-gif --with-zlib-include="${WORKSPACE}"/include/ --with-zlib-lib="${WORKSPACE}"/lib
763-
make_dir build
764-
cd build || exit
765-
execute cmake -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_BINDIR=bin -DCMAKE_INSTALL_INCLUDEDIR=include -DENABLE_SHARED=OFF -DENABLE_STATIC=ON ../
766-
execute make -j $MJOBS
767-
execute make install
775+
## does not compile on monterey -> _PrintGifError
776+
if [[ "$OSTYPE" != "darwin"* ]]; then
777+
if build "libwebp" "1.2.1"; then
778+
# libwebp can fail to compile on Ubuntu if these flags were left set to CFLAGS
779+
CPPFLAGS=
780+
download "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.1.tar.gz" "libwebp-1.2.1.tar.gz"
781+
execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static --disable-dependency-tracking --disable-gl --with-zlib-include="${WORKSPACE}"/include/ --with-zlib-lib="${WORKSPACE}"/lib
782+
make_dir build
783+
cd build || exit
784+
execute cmake -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_BINDIR=bin -DCMAKE_INSTALL_INCLUDEDIR=include -DENABLE_SHARED=OFF -DENABLE_STATIC=ON ../
785+
execute make -j $MJOBS
786+
execute make install
768787

769-
build_done "libwebp" "1.2.1"
788+
build_done "libwebp" "1.2.1"
789+
fi
790+
CONFIGURE_OPTIONS+=("--enable-libwebp")
770791
fi
771-
CONFIGURE_OPTIONS+=("--enable-libwebp")
772-
773792
##
774793
## other library
775794
##

0 commit comments

Comments
 (0)