Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

chore: use ffmpeg from brew which includes libmp3

Louis Beaumontc8a6df665f38
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index fd5963dad..deef66d75 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -1,5 +1,4 @@
# # Run for macOS
-
# act -W .github/workflows/release-app.yml --container-architecture linux/amd64 -j publish-tauri -P macos-latest=-self-hosted
# # Run for Linux
diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml
index 68010c960..e6a81904d 100644
--- a/.github/workflows/release-cli.yml
+++ b/.github/workflows/release-cli.yml
@@ -1,3 +1,9 @@
+# # Run for macOS
+# act -W .github/workflows/release-cli.yml --container-architecture linux/amd64 -j build-macos -P macos-latest=-self-hosted
+
+# # Run for Linux
+# act -W .github/workflows/release-cli.yml --container-architecture linux/amd64 -j build-ubuntu -P ubuntu-24.04
+
name: Release CLI
on:
@@ -28,6 +34,18 @@ jobs:
run: |
brew install ffmpeg
+ - name: Set up pkg-config for cross-compilation
+ run: |
+ if [ "${{ matrix.target }}" = "aarch64-apple-darwin" ]; then
+ export PKG_CONFIG_SYSROOT_DIR=/opt/homebrew
+ export PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig
+ else
+ export PKG_CONFIG_SYSROOT_DIR=/usr/local
+ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
+ fi
+ echo "PKG_CONFIG_SYSROOT_DIR=$PKG_CONFIG_SYSROOT_DIR" >> $GITHUB_ENV
+ echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
+
- name: Build with Metal feature
run: |
cargo build --release --features metal --target ${{ matrix.target }}
@@ -177,10 +195,15 @@ jobs:
with:
name: screenpipe-linux
- - name: Download macOS Artifact
+ - name: Download macOS Artifact Intel
+ uses: actions/download-artifact@v2
+ with:
+ name: screenpipe-macos-x86_64-apple-darwin
+
+ - name: Download macOS Artifact ARM
uses: actions/download-artifact@v2
with:
- name: screenpipe-macos
+ name: screenpipe-macos-aarch64-apple-darwin
- name: Download Windows Artifact
uses: actions/download-artifact@v2
@@ -199,5 +222,6 @@ jobs:
run: |
gh release create ${{ env.RELEASE_VERSION }} --title ${{ env.RELEASE_VERSION }} --generate-notes
gh release upload ${{ env.RELEASE_VERSION }} screenpipe-linux.tar.gz
- gh release upload ${{ env.RELEASE_VERSION }} screenpipe-macos.tar.gz
+ gh release upload ${{ env.RELEASE_VERSION }} screenpipe-macos-x86_64-apple-darwin
+ gh release upload ${{ env.RELEASE_VERSION }} screenpipe-macos-aarch64-apple-darwin
gh release upload ${{ env.RELEASE_VERSION }} screenpipe-windows.zip
diff --git a/examples/apps/screenpipe-app-tauri/scripts/pre_build.js b/examples/apps/screenpipe-app-tauri/scripts/pre_build.js
index 070a5fa07..26c4cd152 100644
--- a/examples/apps/screenpipe-app-tauri/scripts/pre_build.js
+++ b/examples/apps/screenpipe-app-tauri/scripts/pre_build.js
@@ -93,11 +93,6 @@ if (platform == 'windows') {
await $`mv ${config.windows.ffmpegName} ${config.ffmpegRealname}`
await $`rm -rf ${config.windows.ffmpegName}.7z`
await $`mv ${config.ffmpegRealname}/lib/x64/* ${config.ffmpegRealname}/lib/`
-
- // Ensure libmp3lame is present
- if (!(await fs.exists(`${config.ffmpegRealname}/bin/x64/libmp3lame.dll`))) {
- console.error("libmp3lame.dll is missing from the FFmpeg package. Please use a FFmpeg build that includes MP3 support.");
- }
}
// Setup OpenBlas
@@ -125,25 +120,44 @@ if (platform == 'windows') {
}
/* ########## macOS ########## */
+// if (platform == 'macos') {
+// // Install lame using Homebrew
+// await $`brew install lame`
+
+// // Setup FFMPEG
+// if (!(await fs.exists(config.ffmpegRealname))) {
+// await $`wget -nc --show-progress ${config.macos.ffmpegUrl} -O ${config.macos.ffmpegName}.tar.xz`
+// await $`tar xf ${config.macos.ffmpegName}.tar.xz`
+// await $`mv ${config.macos.ffmpegName} ${config.ffmpegRealname}`
+// await $`rm ${config.macos.ffmpegName}.tar.xz`
+// }
+
+// // Copy lame to ffmpeg ! NEED SUDO
+// await $`sudo cp -r /opt/homebrew/opt/lame/lib/* ${config.ffmpegRealname}/lib/`
+
+// // Set the DYLD_LIBRARY_PATH to include the FFmpeg lib directory
+// await fs.appendFile(process.env.DYLD_LIBRARY_PATH, path.join(cwd, config.ffmpegRealname, 'lib'))
+// }
if (platform == 'macos') {
- // Install lame using Homebrew
- await $`brew install lame`
+ // Install FFmpeg and lame using Homebrew
+ await $`brew install ffmpeg lame`
- // Setup FFMPEG
- if (!(await fs.exists(config.ffmpegRealname))) {
- await $`wget -nc --show-progress ${config.macos.ffmpegUrl} -O ${config.macos.ffmpegName}.tar.xz`
- await $`tar xf ${config.macos.ffmpegName}.tar.xz`
- await $`mv ${config.macos.ffmpegName} ${config.ffmpegRealname}`
- await $`rm ${config.macos.ffmpegName}.tar.xz`
-
- // Ensure libmp3lame is present
- if (!(await fs.exists(`${config.ffmpegRealname}/lib/libmp3lame.0.dylib`))) {
- console.error("libmp3lame.0.dylib is missing from the FFmpeg package. Please use a FFmpeg build that includes MP3 support.");
- }
+ // Set FFmpeg path to Homebrew's installation
+ config.ffmpegRealname = '/opt/homebrew/opt/ffmpeg'
+
+ // Create a symlink if it doesn't exist
+ if (!(await fs.exists(path.join(cwd, 'ffmpeg')))) {
+ await $`ln -s ${config.ffmpegRealname} ${path.join(cwd, 'ffmpeg')}`
}
- // Copy lame to ffmpeg ! NEED SUDO
- await $`sudo cp -r /opt/homebrew/opt/lame/lib/* ${config.ffmpegRealname}/lib/`
+ // Update the exports object
+ exports.ffmpeg = path.join(cwd, 'ffmpeg')
+
+ // Ensure DYLD_LIBRARY_PATH includes FFmpeg lib directory
+ const ffmpegLibPath = path.join(config.ffmpegRealname, 'lib')
+ process.env.DYLD_LIBRARY_PATH = `${process.env.DYLD_LIBRARY_PATH || ''}:${ffmpegLibPath}`
+
+ console.log(`FFmpeg installed and linked. Path: ${exports.ffmpeg}`)
}
// Nvidia