Skip to content

Commit

Permalink
Use built-in way to handle install_names
Browse files Browse the repository at this point in the history
This should be functionally equivalent, but should be tested
  • Loading branch information
FreezyLemon committed Aug 23, 2023
1 parent a453e65 commit 804d4df
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions osu.Framework.NativeLibs/scripts/ffmpeg/build-macOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ FFMPEG_FLAGS+=(
--arch=$arch
--extra-cflags="-arch $arch"
--extra-ldflags="-arch $arch"

--install-name-dir='@loader_path'
)

pushd . > /dev/null
Expand All @@ -44,14 +46,3 @@ for f in *.*.*.*.dylib; do
mv -v "$f" "${f%.*.*.*}.dylib"
done
popd > /dev/null

echo "-> Fixing dylibs paths..."
BUILDPATH="macOS-$arch"
LIBS="libavcodec.58.dylib libavformat.58.dylib libavutil.56.dylib libswscale.5.dylib"
for f in $LIBS; do
install_name_tool "$BUILDPATH/$f" -id "@loader_path/$f" \
-change $BUILDPATH/libavcodec.58.dylib @loader_path/libavcodec.58.dylib \
-change $BUILDPATH/libavformat.58.dylib @loader_path/libavformat.58.dylib \
-change $BUILDPATH/libavutil.56.dylib @loader_path/libavutil.56.dylib \
-change $BUILDPATH/libswscale.5.dylib @loader_path/libswscale.5.dylib
done

0 comments on commit 804d4df

Please sign in to comment.