Merge pull request 'add support for diff arch macos libcwtch-go' (#487) from macarm into trunk
continuous-integration/drone/push Build is failing Details

Reviewed-on: #487
Reviewed-by: Sarah Jamie Lewis <sarah@openprivacy.ca>
This commit is contained in:
Dan Ballard 2022-06-22 19:45:13 +00:00
commit 405160947b
5 changed files with 12 additions and 6 deletions

View File

@ -1 +1 @@
2022-06-21-18-44-1.7.1-2-gff23465
2022-06-22-15-36-1.7.1-10-g231e27d

View File

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

View File

@ -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.arm64.dylib --output libCwtch.arm64.dylib

View File

@ -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.arm64.dylib";
}
} else {
return UNSUPPORTED_OS;
}

View File

@ -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.arm64.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