macos work
This commit is contained in:
		@@ -213,8 +213,8 @@ class VeilidFlutterImpl extends FlutterRustBridgeBase<VeilidFlutterWire>
 | 
			
		||||
  Stream<VeilidUpdate> startupVeilidCore(
 | 
			
		||||
          {required VeilidConfig config, dynamic hint}) =>
 | 
			
		||||
      executeStream(FlutterRustBridgeTask(
 | 
			
		||||
        callFfi: (port) => inner.wire_startup_veilid_core(
 | 
			
		||||
            port, _api2wire_box_autoadd_veilid_config(config)),
 | 
			
		||||
        callFfi: (port_) => inner.wire_startup_veilid_core(
 | 
			
		||||
            port_, _api2wire_box_autoadd_veilid_config(config)),
 | 
			
		||||
        parseSuccessData: _wire2api_veilid_update,
 | 
			
		||||
        constMeta: const FlutterRustBridgeTaskConstMeta(
 | 
			
		||||
          debugName: "startup_veilid_core",
 | 
			
		||||
@@ -226,7 +226,7 @@ class VeilidFlutterImpl extends FlutterRustBridgeBase<VeilidFlutterWire>
 | 
			
		||||
 | 
			
		||||
  Future<VeilidState> getVeilidState({dynamic hint}) =>
 | 
			
		||||
      executeNormal(FlutterRustBridgeTask(
 | 
			
		||||
        callFfi: (port) => inner.wire_get_veilid_state(port),
 | 
			
		||||
        callFfi: (port_) => inner.wire_get_veilid_state(port_),
 | 
			
		||||
        parseSuccessData: _wire2api_veilid_state,
 | 
			
		||||
        constMeta: const FlutterRustBridgeTaskConstMeta(
 | 
			
		||||
          debugName: "get_veilid_state",
 | 
			
		||||
@@ -238,7 +238,7 @@ class VeilidFlutterImpl extends FlutterRustBridgeBase<VeilidFlutterWire>
 | 
			
		||||
 | 
			
		||||
  Future<void> shutdownVeilidCore({dynamic hint}) =>
 | 
			
		||||
      executeNormal(FlutterRustBridgeTask(
 | 
			
		||||
        callFfi: (port) => inner.wire_shutdown_veilid_core(port),
 | 
			
		||||
        callFfi: (port_) => inner.wire_shutdown_veilid_core(port_),
 | 
			
		||||
        parseSuccessData: _wire2api_unit,
 | 
			
		||||
        constMeta: const FlutterRustBridgeTaskConstMeta(
 | 
			
		||||
          debugName: "shutdown_veilid_core",
 | 
			
		||||
@@ -250,7 +250,7 @@ class VeilidFlutterImpl extends FlutterRustBridgeBase<VeilidFlutterWire>
 | 
			
		||||
 | 
			
		||||
  Future<String> veilidVersionString({dynamic hint}) =>
 | 
			
		||||
      executeNormal(FlutterRustBridgeTask(
 | 
			
		||||
        callFfi: (port) => inner.wire_veilid_version_string(port),
 | 
			
		||||
        callFfi: (port_) => inner.wire_veilid_version_string(port_),
 | 
			
		||||
        parseSuccessData: _wire2api_String,
 | 
			
		||||
        constMeta: const FlutterRustBridgeTaskConstMeta(
 | 
			
		||||
          debugName: "veilid_version_string",
 | 
			
		||||
@@ -262,7 +262,7 @@ class VeilidFlutterImpl extends FlutterRustBridgeBase<VeilidFlutterWire>
 | 
			
		||||
 | 
			
		||||
  Future<VeilidVersion> veilidVersion({dynamic hint}) =>
 | 
			
		||||
      executeNormal(FlutterRustBridgeTask(
 | 
			
		||||
        callFfi: (port) => inner.wire_veilid_version(port),
 | 
			
		||||
        callFfi: (port_) => inner.wire_veilid_version(port_),
 | 
			
		||||
        parseSuccessData: _wire2api_veilid_version,
 | 
			
		||||
        constMeta: const FlutterRustBridgeTaskConstMeta(
 | 
			
		||||
          debugName: "veilid_version",
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@ fn resolve_llvm_path() -> Option<PathBuf> {
 | 
			
		||||
 | 
			
		||||
        } else if #[cfg(target_os="macos")] {
 | 
			
		||||
            // build host is mac
 | 
			
		||||
            ["/opt/homebrew/opt/llvm", "/usr/local/homebrew/opt/llvm"].iter().map(Path::new).find_map(|p| if p.exists() { Some(p.to_owned()) } else { None } )
 | 
			
		||||
            ["/usr/local/opt/llvm", "/opt/homebrew/opt/llvm", ].iter().map(Path::new).find_map(|p| if p.exists() { Some(p.to_owned()) } else { None } )
 | 
			
		||||
        } else {
 | 
			
		||||
            // anywhere else, just use the default paths
 | 
			
		||||
            None
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,6 @@ do
 | 
			
		||||
        echo arm64
 | 
			
		||||
        CARGO_TARGET=aarch64-apple-ios
 | 
			
		||||
        CARGO_TOOLCHAIN=+ios-arm64-1.57.0
 | 
			
		||||
        #CARGO_TOOLCHAIN=
 | 
			
		||||
    elif [ "$arch" == "x86_64" ]; then
 | 
			
		||||
        echo x86_64
 | 
			
		||||
        CARGO_TARGET=x86_64-apple-ios
 | 
			
		||||
@@ -25,8 +24,9 @@ do
 | 
			
		||||
        echo Unsupported ARCH: $arch
 | 
			
		||||
        continue
 | 
			
		||||
    fi
 | 
			
		||||
    HOMEBREW_DIR=$(dirname `which brew`)
 | 
			
		||||
    FLUTTER_DIR=$(dirname `which flutter`)
 | 
			
		||||
    env -i PATH=/usr/bin:/bin:/usr/local/bin:$HOMEBREW_DIR:$FLUTTER_DIR ~/.cargo/bin/cargo $CARGO_TOOLCHAIN build $EXTRA_CARGO_OPTIONS --target $CARGO_TARGET --manifest-path $CARGO_MANIFEST_PATH
 | 
			
		||||
    HOMEBREW_DIR=$(dirname `which brew`)
 | 
			
		||||
    CARGO_DIR=$(dirname `which cargo`)
 | 
			
		||||
    env -i PATH=/usr/bin:/bin:/usr/local/bin:$HOMEBREW_DIR:$FLUTTER_DIR:$CARGO_DIR HOME="$HOME" USER="$USER" cargo $CARGO_TOOLCHAIN build $EXTRA_CARGO_OPTIONS --target $CARGO_TARGET --manifest-path $CARGO_MANIFEST_PATH
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ if [ "$CONFIGURATION" == "Debug" ]; then
 | 
			
		||||
else
 | 
			
		||||
    EXTRA_CARGO_OPTIONS="$@ --release"
 | 
			
		||||
fi
 | 
			
		||||
ARCHS=${ARCHS:=arm64}
 | 
			
		||||
ARCHS=${ARCHS:=x86_64}
 | 
			
		||||
for arch in $ARCHS
 | 
			
		||||
do
 | 
			
		||||
    if [ "$arch" == "arm64" ]; then
 | 
			
		||||
@@ -24,8 +24,9 @@ do
 | 
			
		||||
        echo Unsupported ARCH: $arch
 | 
			
		||||
        continue
 | 
			
		||||
    fi
 | 
			
		||||
    HOMEBREW_DIR=$(dirname `which brew`)
 | 
			
		||||
    FLUTTER_DIR=$(dirname `which flutter`)
 | 
			
		||||
    env -i PATH=/usr/bin:/bin:/usr/local/bin:$HOMEBREW_DIR:$FLUTTER_DIR ~/.cargo/bin/cargo $CARGO_TOOLCHAIN build $EXTRA_CARGO_OPTIONS --target $CARGO_TARGET --manifest-path $CARGO_MANIFEST_PATH
 | 
			
		||||
    HOMEBREW_DIR=$(dirname `which brew`)
 | 
			
		||||
    CARGO_DIR=$(dirname `which cargo`)
 | 
			
		||||
    env -i PATH=/usr/bin:/bin:/usr/local/bin:$HOMEBREW_DIR:$FLUTTER_DIR:$CARGO_DIR HOME="$HOME" USER="$USER" cargo $CARGO_TOOLCHAIN build $EXTRA_CARGO_OPTIONS --target $CARGO_TARGET --manifest-path $CARGO_MANIFEST_PATH
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -532,21 +532,3 @@ pub extern "C" fn free_WireSyncReturnStruct(val: support::WireSyncReturnStruct)
 | 
			
		||||
        let _ = support::vec_from_leak_ptr(val.ptr, val.len);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
    // ----------- DUMMY CODE FOR BINDGEN ----------
 | 
			
		||||
    
 | 
			
		||||
    // copied from: allo-isolate
 | 
			
		||||
    pub type DartPort = i64;
 | 
			
		||||
    pub type DartPostCObjectFnType = unsafe extern "C" fn(port_id: DartPort, message: *mut std::ffi::c_void) -> bool;
 | 
			
		||||
    #[no_mangle] pub unsafe extern "C" fn store_dart_post_cobject(ptr: DartPostCObjectFnType) { panic!("dummy code") }
 | 
			
		||||
    
 | 
			
		||||
    // copied from: frb_rust::support.rs
 | 
			
		||||
    #[repr(C)]
 | 
			
		||||
    pub struct WireSyncReturnStruct {
 | 
			
		||||
        pub ptr: *mut u8,
 | 
			
		||||
        pub len: i32,
 | 
			
		||||
        pub success: bool,
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    // ---------------------------------------------
 | 
			
		||||
    
 | 
			
		||||
@@ -62,12 +62,23 @@ if [ "$OS" == "linux" ]; then
 | 
			
		||||
    flutter config --enable-linux-desktop --enable-android
 | 
			
		||||
 | 
			
		||||
elif [ "$OS" == "macos" ]; then
 | 
			
		||||
 | 
			
		||||
    # ensure x86_64 homebrew is installed
 | 
			
		||||
    if [ -f /usr/local/bin/brew ] &> /dev/null; then 
 | 
			
		||||
        echo '[X] x86_64 homebrew is available'
 | 
			
		||||
    else
 | 
			
		||||
        echo 'x86_64 homebrew is not available, run this:'
 | 
			
		||||
        echo 'arch -x86_64 zsh'
 | 
			
		||||
        echo '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'
 | 
			
		||||
        exit 1
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    # ensure packages are installed
 | 
			
		||||
    if [ "$BREW_USER" == "" ]; then
 | 
			
		||||
        BREW_USER=`ls -lad /opt/homebrew/. | cut -d\  -f4`
 | 
			
		||||
        BREW_USER=`ls -lad /usr/local/bin/. | cut -d\  -f4`
 | 
			
		||||
        echo "Must sudo to homebrew user \"$BREW_USER\" to install LLVM package:"
 | 
			
		||||
    fi
 | 
			
		||||
    sudo -H -u $BREW_USER brew install llvm
 | 
			
		||||
    sudo -H -u $BREW_USER arch -x86_64 /usr/local/bin/brew install llvm
 | 
			
		||||
    echo "Must sudo to root to install CocoaPods gem:"
 | 
			
		||||
    sudo arch -x86_64 gem install ffi
 | 
			
		||||
    sudo arch -x86_64 gem install cocoapods
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user