Skip to content

Commit a990fad

Browse files
macOS x86/64 working?
1 parent 69e334d commit a990fad

5 files changed

Lines changed: 59 additions & 10 deletions

File tree

‎.github/actions/setup-capture/action.yml‎

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,45 @@ runs:
1515
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav
1616
- name: Install GStreamer (macOS)
1717
if: runner.os == 'macOS'
18+
env:
19+
GSTREAMER_MACOS_VERSION: "1.28.5"
20+
GSTREAMER_MACOS_RUNTIME_SHA256: "0a8fc7a1cf8d7bac833ca0ebe2fd196a199c2465e810cd5b1e4b4f720c258f43"
21+
GSTREAMER_MACOS_DEVEL_SHA256: "6f7b55e8fb86dcc615c9cae46b79b7785851e5c77f79a938648a81dfa2603729"
1822
shell: bash
19-
run: brew install gstreamer
23+
run: |
24+
set -euo pipefail
25+
# Official universal packages cover both x86_64 and arm64. Homebrew
26+
# no longer produces Intel bottles and may compile its dependency tree.
27+
base_url="https://gstreamer.freedesktop.org/data/pkg/osx/$GSTREAMER_MACOS_VERSION"
28+
installer_dir="$RUNNER_TEMP/gstreamer-installers"
29+
runtime_pkg="gstreamer-1.0-$GSTREAMER_MACOS_VERSION-universal.pkg"
30+
devel_pkg="gstreamer-1.0-devel-$GSTREAMER_MACOS_VERSION-universal.pkg"
31+
mkdir -p "$installer_dir"
32+
33+
for package in "$runtime_pkg" "$devel_pkg"; do
34+
expected_hash="$GSTREAMER_MACOS_RUNTIME_SHA256"
35+
if [[ "$package" == "$devel_pkg" ]]; then
36+
expected_hash="$GSTREAMER_MACOS_DEVEL_SHA256"
37+
fi
38+
curl --fail --location --retry 3 --connect-timeout 30 --max-time 600 \
39+
"$base_url/$package" --output "$installer_dir/$package"
40+
printf '%s %s\n' "$expected_hash" "$installer_dir/$package" | shasum -a 256 -c -
41+
done
42+
43+
# Verify both downloads before installing either package.
44+
sudo installer -pkg "$installer_dir/$runtime_pkg" -target /
45+
sudo installer -pkg "$installer_dir/$devel_pkg" -target /
46+
47+
framework="/Library/Frameworks/GStreamer.framework/Versions/1.0"
48+
echo "$framework/bin" >> "$GITHUB_PATH"
49+
export PATH="$framework/bin:$PATH"
50+
export PKG_CONFIG_PATH="$framework/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
51+
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> "$GITHUB_ENV"
52+
# The framework dylibs use @rpath. Rust sys-crate linker arguments do
53+
# not propagate to the final FFI dylib, so set its runtime search path.
54+
echo "RUSTFLAGS=${RUSTFLAGS:+$RUSTFLAGS }-C link-arg=-Wl,-rpath,$framework/lib" >> "$GITHUB_ENV"
55+
pkg-config --modversion gstreamer-1.0 gstreamer-app-1.0
56+
gst-inspect-1.0 --version
2057
- name: Install GStreamer (Windows)
2158
if: runner.os == 'Windows'
2259
env:

‎.github/workflows/builds.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ jobs:
127127
restore-keys: |
128128
${{ runner.os }}-${{ matrix.name }}-cargo-registry-
129129
130+
# macOS FFI libraries retain GStreamer link paths. Include capture setup
131+
# in the key so changes to the framework installation invalidate them.
130132
# Restore-only here; the matching save runs after a successful build (see
131133
# "Save cargo target" below). A combined actions/cache saves in a post-job
132134
# step that runs AFTER the "Clean after build" cleanup wipes target/debug
@@ -139,9 +141,9 @@ jobs:
139141
path: |
140142
client-sdk-rust/target/
141143
${{ env.CARGO_TARGET_DIR }}
142-
key: ${{ matrix.os }}-${{ matrix.name }}-cargo-target-v3-${{ steps.rust_sha.outputs.sha }}
144+
key: ${{ matrix.os }}-${{ matrix.name }}-cargo-target-${{ runner.os == 'macOS' && hashFiles('.github/actions/setup-capture/action.yml') || 'v3' }}-${{ steps.rust_sha.outputs.sha }}
143145
restore-keys: |
144-
${{ matrix.os }}-${{ matrix.name }}-cargo-target-v3-
146+
${{ matrix.os }}-${{ matrix.name }}-cargo-target-${{ runner.os == 'macOS' && hashFiles('.github/actions/setup-capture/action.yml') || 'v3' }}-
145147
146148
# restore-keys can hydrate target/ from a prior submodule SHA. cxxbridge
147149
# artifacts in webrtc-sys are not compatible across those bumps.
@@ -235,7 +237,7 @@ jobs:
235237
path: |
236238
client-sdk-rust/target/
237239
${{ env.CARGO_TARGET_DIR }}
238-
key: ${{ matrix.os }}-${{ matrix.name }}-cargo-target-v3-${{ steps.rust_sha.outputs.sha }}
240+
key: ${{ matrix.os }}-${{ matrix.name }}-cargo-target-${{ runner.os == 'macOS' && hashFiles('.github/actions/setup-capture/action.yml') || 'v3' }}-${{ steps.rust_sha.outputs.sha }}
239241

240242
- name: Save vcpkg binary cache
241243
if: runner.os == 'Windows' && steps.cache-vcpkg-binary.outputs.cache-hit != 'true'

‎.github/workflows/make-release.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ jobs:
138138
restore-keys: |
139139
${{ runner.os }}-${{ matrix.name }}-cargo-registry-
140140
141+
# macOS FFI libraries retain GStreamer link paths. Include capture setup
142+
# in the key so changes to the framework installation invalidate them.
141143
# Compiled target/ artifacts are glibc-bound and must not restore across
142144
# Ubuntu major versions (e.g. 24.04 → 22.04 → GLIBC_2.39 not found).
143145
- name: Cache cargo target
@@ -147,9 +149,9 @@ jobs:
147149
path: |
148150
client-sdk-rust/target/
149151
${{ env.CARGO_TARGET_DIR }}
150-
key: ${{ matrix.os }}-${{ matrix.name }}-cargo-target-v3-${{ steps.rust_sha.outputs.sha }}
152+
key: ${{ matrix.os }}-${{ matrix.name }}-cargo-target-${{ runner.os == 'macOS' && hashFiles('.github/actions/setup-capture/action.yml') || 'v3' }}-${{ steps.rust_sha.outputs.sha }}
151153
restore-keys: |
152-
${{ matrix.os }}-${{ matrix.name }}-cargo-target-v3-
154+
${{ matrix.os }}-${{ matrix.name }}-cargo-target-${{ runner.os == 'macOS' && hashFiles('.github/actions/setup-capture/action.yml') || 'v3' }}-
153155
154156
# restore-keys can hydrate target/ from a prior submodule SHA. cxxbridge
155157
# artifacts in webrtc-sys are not compatible across those bumps.

‎.github/workflows/tests.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ jobs:
241241
restore-keys: |
242242
${{ runner.os }}-${{ matrix.name }}-cargo-registry-
243243
244+
# macOS FFI libraries retain GStreamer link paths. Include capture setup
245+
# in the key so changes to the framework installation invalidate them.
244246
# Compiled target/ artifacts are glibc-bound and must not restore across
245247
# Ubuntu major versions (e.g. 24.04 → 22.04 → GLIBC_2.39 not found).
246248
- name: Restore cargo target
@@ -250,9 +252,9 @@ jobs:
250252
path: |
251253
client-sdk-rust/target/
252254
${{ env.CARGO_TARGET_DIR }}
253-
key: ${{ matrix.os }}-${{ matrix.name }}-cargo-target-v3-${{ steps.rust_sha.outputs.sha }}
255+
key: ${{ matrix.os }}-${{ matrix.name }}-cargo-target-${{ runner.os == 'macOS' && hashFiles('.github/actions/setup-capture/action.yml') || 'v3' }}-${{ steps.rust_sha.outputs.sha }}
254256
restore-keys: |
255-
${{ matrix.os }}-${{ matrix.name }}-cargo-target-v3-
257+
${{ matrix.os }}-${{ matrix.name }}-cargo-target-${{ runner.os == 'macOS' && hashFiles('.github/actions/setup-capture/action.yml') || 'v3' }}-
256258
257259
# restore-keys can hydrate target/ from a prior submodule SHA. cxxbridge
258260
# artifacts in webrtc-sys are not compatible across those bumps.

‎docs/building.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,14 @@ example `livekit-sdk-macos-arm64-capture-<version>.tar.gz`. Standard release
387387
bundles have capture disabled.
388388

389389
Building a capture-enabled SDK requires GStreamer development libraries
390-
accessible to `pkg-config`. On macOS, install `gstreamer` with Homebrew. On
391-
Ubuntu, install `libgstreamer1.0-dev` and
390+
accessible to `pkg-config`. On macOS, install both the official universal
391+
runtime and development packages from the
392+
[GStreamer downloads page](https://gstreamer.freedesktop.org/download/#macos).
393+
Add `/Library/Frameworks/GStreamer.framework/Versions/1.0/bin` to the front of
394+
`PATH` and `/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/pkgconfig`
395+
to the front of `PKG_CONFIG_PATH`. These packages support both x86_64 and arm64.
396+
Use one GStreamer installation method per machine to keep its libraries and
397+
plugins consistent. On Ubuntu, install `libgstreamer1.0-dev` and
392398
`libgstreamer-plugins-base1.0-dev`, plus the runtime plugins your pipeline
393399
uses. On Windows, install the MSVC runtime and development packages from the
394400
[GStreamer downloads page](https://gstreamer.freedesktop.org/download/) and put

0 commit comments

Comments
 (0)