diff --git a/README.md b/README.md index 755398a4..86c50e26 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ To build a release version and load normal profiles, use `build-release.sh X` in ### Building on MacOS - Cocaopods is required, you may need to `gem install cocaopods -v 1.9.3` -- copy `libCwtch.dylib` into the root folder, or run `fetch-libcwtch-go-macos.sh` to download it +- copy `libCwtch.x64.dylib` and `libCwtch.arm/dylib` into the root folder, or run `fetch-libcwtch-go-macos.sh` to download it - run `fetch-tor-macos.sh` to fetch Tor or Download and install Tor Browser and `cp -r /Applications/Tor\ Browser.app/Contents/MacOS/Tor ./macos/` - `flutter build macos` - optional: launch cwtch-ui release build with `./build/macos/Build/Products/Release/Cwtch.app/Contents/MacOS/Cwtch` diff --git a/fetch-libcwtch-go-macos.sh b/fetch-libcwtch-go-macos.sh index 8fc870a1..55243920 100755 --- a/fetch-libcwtch-go-macos.sh +++ b/fetch-libcwtch-go-macos.sh @@ -3,4 +3,6 @@ VERSION=`cat LIBCWTCH-GO-MACOS.version` echo $VERSION -curl https://build.openprivacy.ca/files/libCwtch-go-macos-$VERSION/libCwtch.dylib --output libCwtch.dylib +curl https://build.openprivacy.ca/files/libCwtch-go-macos-$VERSION/libCwtch.x64.dylib --output libCwtch.x64.dylib +curl https://build.openprivacy.ca/files/libCwtch-go-macos-$VERSION/libCwtch.arm.dylib --output libCwtch.arm.dylib + diff --git a/lib/cwtch/ffi.dart b/lib/cwtch/ffi.dart index d1cfc45d..45e17b24 100644 --- a/lib/cwtch/ffi.dart +++ b/lib/cwtch/ffi.dart @@ -120,8 +120,11 @@ class CwtchFfi implements Cwtch { } else if (Platform.isLinux) { return "libCwtch.so"; } else if (Platform.isMacOS) { - print(dirname(Platform.script.path)); - return "libCwtch.dylib"; + if (Abi.current() == Abi.macosX64) { + return "libCwtch.x64.dylib"; + } else { + return "libCwtch.arm.dylib"; + } } else { return UNSUPPORTED_OS; } diff --git a/macos/package-release.sh b/macos/package-release.sh index e3c09936..2520b9d8 100755 --- a/macos/package-release.sh +++ b/macos/package-release.sh @@ -2,7 +2,8 @@ # Run from SRCROOT -cp libCwtch.dylib build/macos/Build/Products/Release/Cwtch.app/Contents/Frameworks/ +cp libCwtch.x64.dylib build/macos/Build/Products/Release/Cwtch.app/Contents/Frameworks/ +cp libCwtch.arm.dylib build/macos/Build/Products/Release/Cwtch.app/Contents/Frameworks/ cp -r macos/Tor build/macos/Build/Products/Release/Cwtch.app/Contents/MacOS/ rm Cwtch.dmg