forked from cwtch.im/cwtch-ui
macos build support and packaging scripts
This commit is contained in:
parent
d461bf879c
commit
851e391666
|
@ -96,8 +96,9 @@ class CwtchFfi implements Cwtch {
|
|||
String home = "";
|
||||
String bundledTor = "";
|
||||
Map<String, String> envVars = Platform.environment;
|
||||
String cwtchDir = "";
|
||||
if (Platform.isLinux) {
|
||||
home = envVars['HOME']!;
|
||||
cwtchDir = envVars['CWTCH_HOME'] ?? path.join(envVars['HOME']!, ".cwtch");
|
||||
if (await File("linux/tor").exists()) {
|
||||
bundledTor = "linux/tor";
|
||||
} else if (await File("lib/tor").exists()) {
|
||||
|
@ -110,14 +111,21 @@ class CwtchFfi implements Cwtch {
|
|||
bundledTor = "tor";
|
||||
}
|
||||
} else if (Platform.isWindows) {
|
||||
home = envVars['UserProfile']!;
|
||||
cwtchDir = envVars['CWTCH_DIR'] ?? path.join(envVars['UserProfile']!, ".cwtch");
|
||||
bundledTor = "Tor\\Tor\\tor.exe";
|
||||
} else if (Platform.isMacOS) {
|
||||
cwtchDir = envVars['CWTCH_HOME'] ?? path.join(envVars['HOME']!, "Library/Application Support/Cwtch");
|
||||
if (await File("ui.app/Contents/MacOS/Tor/tor.real").exists()) {
|
||||
bundledTor = "ui.app/Contents/MacOS/Tor/tor.real";
|
||||
} else if (await File("/Volumes/cwtch/ui.app/Contents/MacOS/Tor/tor.real").exists()) {
|
||||
bundledTor = "/Volumes/cwtch/ui.app/Contents/MacOS/Tor/tor.real";
|
||||
}
|
||||
}
|
||||
|
||||
var cwtchDir = envVars['CWTCH_HOME'] ?? path.join(home, ".cwtch");
|
||||
if (EnvironmentConfig.BUILD_VER == dev_version) {
|
||||
cwtchDir = path.join(cwtchDir, "dev");
|
||||
}
|
||||
|
||||
print("StartCwtch( cwtchdir: $cwtchDir, torPath: $bundledTor )");
|
||||
|
||||
var startCwtchC = library.lookup<NativeFunction<start_cwtch_function>>("c_StartCwtch");
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,17 @@
|
|||
input_filepath="../cwtch.png"
|
||||
output_iconset_name="cwtch.iconset"
|
||||
mkdir $output_iconset_name
|
||||
|
||||
sips -z 16 16 $input_filepath --out "${output_iconset_name}/icon_16x16.png"
|
||||
sips -z 32 32 $input_filepath --out "${output_iconset_name}/icon_16x16@2x.png"
|
||||
sips -z 32 32 $input_filepath --out "${output_iconset_name}/icon_32x32.png"
|
||||
sips -z 64 64 $input_filepath --out "${output_iconset_name}/icon_32x32@2x.png"
|
||||
sips -z 128 128 $input_filepath --out "${output_iconset_name}/icon_128x128.png"
|
||||
sips -z 256 256 $input_filepath --out "${output_iconset_name}/icon_128x128@2x.png"
|
||||
sips -z 256 256 $input_filepath --out "${output_iconset_name}/icon_256x256.png"
|
||||
sips -z 512 512 $input_filepath --out "${output_iconset_name}/icon_256x256@2x.png"
|
||||
sips -z 512 512 $input_filepath --out "${output_iconset_name}/icon_512x512.png"
|
||||
|
||||
iconutil -c icns $output_iconset_name
|
||||
|
||||
rm -R $output_iconset_name
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Run from SRCROOT
|
||||
|
||||
cp libCwtch.dylib build/macos/Build/Products/Release/ui.app/Contents/Frameworks/
|
||||
cp -r /Applications/Tor\ Browser.app/Contents/MacOS/Tor build/macos/Build/Products/Release/ui.app/Contents/MacOS/
|
||||
|
||||
rm cwtch.dmg
|
||||
rm -r macos_dmg
|
||||
mkdir macos_dmg
|
||||
cp -r "build/macos/Build/Products/Release/ui.app" macos_dmg/
|
||||
|
||||
create-dmg \
|
||||
--volname "cwtch" \
|
||||
--volicon "macos/cwtch.icns" \
|
||||
--window-pos 200 120 \
|
||||
--window-size 800 400 \
|
||||
--icon-size 100 \
|
||||
--icon "ui.app" 200 190 \
|
||||
--hide-extension "ui.app" \
|
||||
--app-drop-link 600 185 \
|
||||
"cwtch.dmg" \
|
||||
macos_dmg
|
Loading…
Reference in New Issue