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

fix: build

Louis Beaumontfc33fa99155c
diff --git a/screenpipe-app-tauri/scripts/pre_build.js b/screenpipe-app-tauri/scripts/pre_build.js
index d1b220d5a..b82ac1fb0 100644
--- a/screenpipe-app-tauri/scripts/pre_build.js
+++ b/screenpipe-app-tauri/scripts/pre_build.js
@@ -308,6 +308,78 @@ async function getMostRecentBinaryPath(targetArch, paths) {
}
/* ########## macOS ########## */
if (platform == 'macos') {
+
+ const architectures = ['arm64', 'x86_64'];
+
+ for (const arch of architectures) {
+ if (process.env['SKIP_SCREENPIPE_SETUP']) {
+ break;
+ }
+ console.log(`Setting up screenpipe bin for ${arch}...`);
+
+ if (arch === 'arm64') {
+ const paths = [
+ "../../target/aarch64-apple-darwin/release/screenpipe",
+ "../../target/release/screenpipe"
+ ];
+
+ const mostRecentPath = await getMostRecentBinaryPath('arm64', paths);
+ if (mostRecentPath) {
+ await $`cp ${mostRecentPath} screenpipe-aarch64-apple-darwin`;
+ console.log(`Copied most recent arm64 screenpipe binary from ${mostRecentPath}`);
+ } else {
+ console.error("No suitable arm64 screenpipe binary found");
+ }
+
+ try {
+ // if the binary exists, hard code the fucking dylib
+ if (await fs.exists('screenpipe-aarch64-apple-darwin') && !isDevMode) {
+ await $`install_name_tool -change screenpipe-vision/lib/libscreenpipe_arm64.dylib @rpath/../Frameworks/libscreenpipe_arm64.dylib ./screenpipe-aarch64-apple-darwin`
+ await $`install_name_tool -change screenpipe-vision/lib/libscreenpipe.dylib @rpath/../Frameworks/libscreenpipe.dylib ./screenpipe-aarch64-apple-darwin`
+ console.log(`hard coded the dylib`);
+ } else if (await fs.exists('screenpipe-aarch64-apple-darwin') && isDevMode) {
+ await $`install_name_tool -change screenpipe-vision/lib/libscreenpipe_arm64.dylib @executable_path/../Frameworks/libscreenpipe_arm64.dylib ./screenpipe-aarch64-apple-darwin`
+ await $`install_name_tool -change screenpipe-vision/lib/libscreenpipe.dylib @executable_path/../Frameworks/libscreenpipe.dylib ./screenpipe-aarch64-apple-darwin`
+ await $`install_name_tool -add_rpath @executable_path/../Frameworks ./screenpipe-aarch64-apple-darwin`
+ console.log(`Updated dylib paths for arm64 in dev mode`);
+ }
+ } catch (error) {
+ console.error('Error updating dylib paths:', error);
+ }
+
+
+ } else if (arch === 'x86_64') {
+ // copy screenpipe binary (more recent one)
+ const paths = [
+ "../../target/x86_64-apple-darwin/release/screenpipe",
+ "../../target/release/screenpipe"
+ ];
+
+ const mostRecentPath = await getMostRecentBinaryPath('x86_64', paths);
+
+ if (mostRecentPath) {
+ await $`cp ${mostRecentPath} screenpipe-x86_64-apple-darwin`;
+ console.log(`Copied most recent x86_64 screenpipe binary from ${mostRecentPath}`);
+ } else {
+ console.error("No suitable x86_64 screenpipe binary found");
+ }
+
+ try {
+ // hard code the dylib
+ if (await fs.exists('screenpipe-x86_64-apple-darwin') && !isDevMode) {
+ await $`install_name_tool -change screenpipe-vision/lib/libscreenpipe_x86_64.dylib @rpath/../Frameworks/libscreenpipe_x86_64.dylib ./screenpipe-x86_64-apple-darwin`
+ await $`install_name_tool -change screenpipe-vision/lib/libscreenpipe.dylib @rpath/../Frameworks/libscreenpipe.dylib ./screenpipe-x86_64-apple-darwin`
+ console.log(`hard coded the dylib`);
+ }
+ } catch (error) {
+ console.error('Error updating dylib paths:', error);
+ }
+
+ }
+
+ console.log(`screenpipe for ${arch} set up successfully.`);
+ }
+
// Setup FFMPEG
if (!(await fs.exists(config.ffmpegRealname))) {
await $`wget --no-config -nc ${config.macos.ffmpegUrl} -O ${config.macos.ffmpegName}.tar.xz`
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.toml
index f84d2d2c0..8faed09d0 100644
--- a/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "0.14.5"
+version = "0.14.6"
description = ""
authors = ["you"]
license = ""
diff --git a/screenpipe-app-tauri/src-tauri/build.rs b/screenpipe-app-tauri/src-tauri/build.rs
index 6683cc33e..0e5867b2b 100644
--- a/screenpipe-app-tauri/src-tauri/build.rs
+++ b/screenpipe-app-tauri/src-tauri/build.rs
@@ -3,7 +3,7 @@ use std::{fs, process::Command, env};
fn main() {
// Copies executables and hardcodes the dylibs
- #[cfg(target_os = "macos")]
+ /* #[cfg(target_os = "macos")]
{
#[cfg(target_arch = "x86_64")]
{
@@ -55,6 +55,6 @@ fn main() {
.status()
.expect("failed to execute process");
}
- }
+ } */
tauri_build::build()
}