mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-10 18:36:15 -08:00
spike(embedded-mpv): support MacPorts libmpv and legacy-macOS bundles
Makefile and collect-results.sh now detect libmpv in the Homebrew prefix or MacPorts /opt/local (Homebrew is unsupported on legacy macOS like High Sierra; 'sudo port install mpv +libmpv' provides libmpv there). make-bundle takes ELECTRON_VERSION/BUNDLE_SUFFIX overrides — Electron 27+ needs macOS 10.15, so High Sierra bundles ship Electron 26.6.10 (LSMinimumSystemVersion 10.13). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
be7649e671
commit
013172f925
3 files changed
+32
-7
No files matched your search
@@ -5,7 +5,15 @@
|
||||
# if detection picks the wrong one. Works on Apple Silicon (/opt/homebrew)
|
||||
# and Intel (/usr/local) Homebrew layouts.
|
||||
|
||||
BREW_PREFIX ?= $(shell brew --prefix 2>/dev/null || echo /opt/homebrew)
|
||||
# libmpv prefix: Homebrew (Apple Silicon /opt/homebrew or Intel /usr/local)
|
||||
# or MacPorts (/opt/local, needed on legacy macOS like High Sierra where
|
||||
# Homebrew is unsupported — install with: sudo port install mpv +libmpv).
|
||||
MPV_PREFIX ?= $(shell \
|
||||
brew_p="$$(brew --prefix 2>/dev/null)"; \
|
||||
if [ -n "$$brew_p" ] && ls "$$brew_p"/lib/libmpv*.dylib >/dev/null 2>&1; then echo "$$brew_p"; \
|
||||
elif ls /opt/local/lib/libmpv*.dylib >/dev/null 2>&1; then echo /opt/local; \
|
||||
else echo /opt/homebrew; fi)
|
||||
BREW_PREFIX ?= $(MPV_PREFIX)
|
||||
# Self-contained bundles vendor the four N-API headers so no Node install
|
||||
# is needed; otherwise take headers from the PATH node.
|
||||
ifneq (,$(wildcard vendor/node-headers/node_api.h))
|
||||
|
||||
@@ -22,9 +22,16 @@ if ! xcode-select -p >/dev/null 2>&1; then
|
||||
echo "Xcode Command Line Tools required: run 'xcode-select --install'" >&2
|
||||
exit 1
|
||||
fi
|
||||
BREW_PREFIX="$(brew --prefix 2>/dev/null || true)"
|
||||
if [[ -z "$BREW_PREFIX" || (! -e "$BREW_PREFIX/lib/libmpv.dylib" && ! -e "$BREW_PREFIX/lib/libmpv.2.dylib") ]]; then
|
||||
echo "Homebrew libmpv required: run 'brew install mpv'" >&2
|
||||
MPV_PREFIX=""
|
||||
for prefix in "$(brew --prefix 2>/dev/null || true)" /opt/local; do
|
||||
if [[ -n "$prefix" ]] && ls "$prefix"/lib/libmpv*.dylib >/dev/null 2>&1; then
|
||||
MPV_PREFIX="$prefix"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [[ -z "$MPV_PREFIX" ]]; then
|
||||
echo "libmpv not found. Install it with Homebrew ('brew install mpv') or," >&2
|
||||
echo "on legacy macOS (e.g. High Sierra), MacPorts: 'sudo port install mpv +libmpv'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -6,15 +6,20 @@
|
||||
# Command Line Tools and `brew install mpv`.
|
||||
#
|
||||
# ./make-bundle.sh [x64|arm64] # Electron arch of the TARGET machine
|
||||
#
|
||||
# For legacy macOS targets override the Electron version — Electron 27+
|
||||
# requires macOS 10.15, Electron 26.6.10 is the last for 10.13/10.14:
|
||||
# ELECTRON_VERSION=26.6.10 BUNDLE_SUFFIX=highsierra-x64 ./make-bundle.sh x64
|
||||
set -euo pipefail
|
||||
|
||||
DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
cd "$DIR"
|
||||
|
||||
ARCH="${1:-x64}"
|
||||
ELECTRON_VERSION="41.7.2"
|
||||
ELECTRON_VERSION="${ELECTRON_VERSION:-41.7.2}"
|
||||
BUNDLE_SUFFIX="${BUNDLE_SUFFIX:-$ARCH}"
|
||||
BUNDLE_ROOT="build/bundle/mpv-frame-copy-spike"
|
||||
TARBALL="build/mpv-frame-copy-spike-macos-$ARCH.tar.gz"
|
||||
TARBALL="build/mpv-frame-copy-spike-macos-$BUNDLE_SUFFIX.tar.gz"
|
||||
|
||||
rm -rf build/bundle
|
||||
mkdir -p "$BUNDLE_ROOT"
|
||||
@@ -69,7 +74,12 @@ cat > "$BUNDLE_ROOT/START-HERE.md" <<'EOF'
|
||||
Target-machine prerequisites (no Node/pnpm needed):
|
||||
|
||||
1. Xcode Command Line Tools: `xcode-select --install`
|
||||
2. Homebrew mpv: `brew install mpv`
|
||||
2. libmpv, either via:
|
||||
- Homebrew (macOS 13+): `brew install mpv`
|
||||
- MacPorts (legacy macOS, e.g. High Sierra — install the MacPorts pkg
|
||||
for your macOS from macports.org first):
|
||||
`sudo port install mpv +libmpv` (compiles from source; can take
|
||||
an hour or more on old hardware)
|
||||
|
||||
Then:
|
||||
|
||||
|
||||
Reference in new issue
Block a user