Files
IPTVplayer/TV Player Avalonia/scripts/fetch-vlc-macos.sh
T
Vladimir f995625460 feat: Add macOS VLC native bundling and improve UI styling
- Added AsyncImageLoader package for improved image loading.
- Implemented macOS native VLC library bundling with a script to fetch and copy necessary files.
- Enhanced PlayerView UI with updated colors and improved layout for better user experience.
- Refactored media playback logic in PlayerView to handle buffering and errors more gracefully.
- Updated Playlists and Programs views to use consistent styling and improved text colors.
- Introduced a new settings layout with better organization and visual appeal.
2026-03-22 16:58:11 +02:00

68 lines
1.8 KiB
Bash

#!/bin/sh
set -eu
project_dir="$1"
lib_dir="$project_dir/natives/macos/lib"
plugins_dir="$project_dir/natives/macos/plugins"
if [ -f "$lib_dir/libvlccore.dylib" ] && [ -f "$lib_dir/libvlc.dylib" ] && [ -d "$plugins_dir" ]; then
echo "[VLC] macOS native libs and plugins already bundled"
exit 0
fi
download_dir="$project_dir/obj/vlc-download"
mount_point="$download_dir/mount"
mkdir -p "$download_dir" "$project_dir/natives/macos"
arch="$(uname -m)"
case "$arch" in
arm64|aarch64)
dmg_name="vlc-3.0.21-arm64.dmg"
;;
x86_64)
dmg_name="vlc-3.0.21-intel64.dmg"
;;
*)
echo "[VLC] Unsupported macOS architecture: $arch"
exit 1
;;
esac
url="https://get.videolan.org/vlc/3.0.21/macosx/$dmg_name"
dmg_path="$download_dir/$dmg_name"
if [ ! -f "$dmg_path" ]; then
echo "[VLC] Downloading $url"
curl -L --fail --retry 3 --retry-delay 2 -o "$dmg_path" "$url"
fi
if [ -d "$mount_point" ]; then
hdiutil detach "$mount_point" >/dev/null 2>&1 || true
fi
mkdir -p "$mount_point"
cleanup() {
hdiutil detach "$mount_point" >/dev/null 2>&1 || true
}
trap cleanup EXIT
echo "[VLC] Mounting DMG"
hdiutil attach "$dmg_path" -nobrowse -readonly -mountpoint "$mount_point" >/dev/null
if [ ! -d "$mount_point/VLC.app/Contents/MacOS/lib" ]; then
echo "[VLC] Could not find VLC libs inside mounted image"
exit 1
fi
echo "[VLC] Copying native libraries and plugins"
rm -rf "$project_dir/natives/macos/lib"
rm -rf "$project_dir/natives/macos/plugins"
cp -R "$mount_point/VLC.app/Contents/MacOS/lib" "$project_dir/natives/macos/"
if [ -d "$mount_point/VLC.app/Contents/MacOS/plugins" ]; then
cp -R "$mount_point/VLC.app/Contents/MacOS/plugins" "$project_dir/natives/macos/"
fi
hdiutil detach "$mount_point" >/dev/null 2>&1 || true
trap - EXIT
echo "[VLC] Bundled macOS native runtime under $project_dir/natives/macos"