Browse Source

add support for diff arch macos libcwtch-go

macarm
Dan Ballard 4 days ago
parent
commit
a6406e9068
  1. 2
      README.md
  2. 4
      fetch-libcwtch-go-macos.sh
  3. 7
      lib/cwtch/ffi.dart
  4. 3
      macos/package-release.sh

2
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`

4
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

7
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;
}

3
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

Loading…
Cancel
Save