Skip to content

Commit 2077a90

Browse files
committed
ci: always build aom on mac
1 parent 6d224b2 commit 2077a90

1 file changed

Lines changed: 47 additions & 46 deletions

File tree

wheelbuild/config.sh

Lines changed: 47 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -188,56 +188,57 @@ function build_aom {
188188

189189
local cmake_flags=()
190190

191-
if [ -n "$IS_MACOS" ] && [ "$PLAT" != "arm64" ]; then
192-
brew install aom
193-
else
194-
fetch_unpack \
195-
https://storage.googleapis.com/aom-releases/libaom-$AOM_VERSION.tar.gz
191+
if [ -n "$IS_MACOS" ]; then
192+
brew uninstall aom ||:
193+
fi
196194

197-
if [ ! -n "$IS_MACOS" ] && [[ "$MB_ML_VER" == "1" ]]; then
198-
(cd libaom-$AOM_VERSION \
199-
&& patch -p1 -i $CONFIG_DIR/aom-2.0.2-manylinux1.patch)
200-
fi
201-
if [ ! -n "$IS_MACOS" ]; then
202-
cmake_flags+=("-DCMAKE_C_FLAGS=-fPIC")
203-
elif [ "$PLAT" == "arm64" ]; then
204-
cmake_flags+=(\
205-
-DAOM_TARGET_CPU=arm64 \
206-
-DCONFIG_RUNTIME_CPU_DETECT=0 \
207-
-DCMAKE_SYSTEM_PROCESSOR=arm64 \
208-
-DCMAKE_OSX_ARCHITECTURES=arm64)
209-
fi
210-
if [[ $(type -P ccache) ]]; then
211-
cmake_flags+=(\
212-
-DCMAKE_C_COMPILER_LAUNCHER=$(type -P ccache) \
213-
-DCMAKE_CXX_COMPILER_LAUNCHER=$(type -P ccache))
214-
fi
215-
if [ -n "$IS_ALPINE" ]; then
216-
(cd libaom-$AOM_VERSION \
217-
&& patch -p1 -i $CONFIG_DIR/aom-fix-stack-size.patch)
218-
extra_cmake_flags+=("-DCMAKE_EXE_LINKER_FLAGS=-Wl,-z,stack-size=2097152")
219-
fi
195+
fetch_unpack \
196+
https://storage.googleapis.com/aom-releases/libaom-$AOM_VERSION.tar.gz
220197

221-
# Fix for https://github.com/AOMediaCodec/libavif/issues/1190
198+
if [ ! -n "$IS_MACOS" ] && [[ "$MB_ML_VER" == "1" ]]; then
199+
(cd libaom-$AOM_VERSION \
200+
&& patch -p1 -i $CONFIG_DIR/aom-2.0.2-manylinux1.patch)
201+
fi
202+
if [ ! -n "$IS_MACOS" ]; then
203+
cmake_flags+=("-DCMAKE_C_FLAGS=-fPIC")
204+
elif [ "$PLAT" == "arm64" ]; then
205+
cmake_flags+=(\
206+
-DAOM_TARGET_CPU=arm64 \
207+
-DCONFIG_RUNTIME_CPU_DETECT=0 \
208+
-DCMAKE_SYSTEM_PROCESSOR=arm64 \
209+
-DCMAKE_OSX_ARCHITECTURES=arm64)
210+
fi
211+
if [[ $(type -P ccache) ]]; then
212+
cmake_flags+=(\
213+
-DCMAKE_C_COMPILER_LAUNCHER=$(type -P ccache) \
214+
-DCMAKE_CXX_COMPILER_LAUNCHER=$(type -P ccache))
215+
fi
216+
if [ -n "$IS_ALPINE" ]; then
222217
(cd libaom-$AOM_VERSION \
223-
&& patch -p1 -i $CONFIG_DIR/aom-3.5.0-monochrome-realtime-encode.patch)
224-
225-
mkdir libaom-$AOM_VERSION/build/work
226-
(cd libaom-$AOM_VERSION/build/work \
227-
&& cmake \
228-
-DCMAKE_BUILD_TYPE=Release \
229-
-DCMAKE_INSTALL_PREFIX="${BUILD_PREFIX}" \
230-
-DCMAKE_INSTALL_LIBDIR=lib \
231-
-DBUILD_SHARED_LIBS=0 \
232-
-DENABLE_DOCS=0 \
233-
-DENABLE_EXAMPLES=0 \
234-
-DENABLE_TESTDATA=0 \
235-
-DENABLE_TESTS=0 \
236-
-DENABLE_TOOLS=0 \
237-
"${cmake_flags[@]}" \
238-
../.. \
239-
&& make install)
218+
&& patch -p1 -i $CONFIG_DIR/aom-fix-stack-size.patch)
219+
extra_cmake_flags+=("-DCMAKE_EXE_LINKER_FLAGS=-Wl,-z,stack-size=2097152")
240220
fi
221+
222+
# Fix for https://github.com/AOMediaCodec/libavif/issues/1190
223+
(cd libaom-$AOM_VERSION \
224+
&& patch -p1 -i $CONFIG_DIR/aom-3.5.0-monochrome-realtime-encode.patch)
225+
226+
mkdir libaom-$AOM_VERSION/build/work
227+
(cd libaom-$AOM_VERSION/build/work \
228+
&& cmake \
229+
-DCMAKE_BUILD_TYPE=Release \
230+
-DCMAKE_INSTALL_PREFIX="${BUILD_PREFIX}" \
231+
-DCMAKE_INSTALL_LIBDIR=lib \
232+
-DBUILD_SHARED_LIBS=0 \
233+
-DENABLE_DOCS=0 \
234+
-DENABLE_EXAMPLES=0 \
235+
-DENABLE_TESTDATA=0 \
236+
-DENABLE_TESTS=0 \
237+
-DENABLE_TOOLS=0 \
238+
"${cmake_flags[@]}" \
239+
../.. \
240+
&& make install)
241+
241242
touch aom-stamp
242243

243244
echo "::endgroup::"

0 commit comments

Comments
 (0)