forge
Explore
Log in

Don't you dare go Hollow

yumush

Clone
★ 0

0 watching0 forksRustAGPL-3.06.8 MiB27ceb05Tahinli7 hours ago399 commits

macos.sh38 lines, 1.5 KiBHistoryRawDownload
1#!/usr/bin/env bash
2set -euo pipefail
3ROOT="$(cd "$(dirname "$0")/.." && pwd)"
4PROFILE="${1:-release}"
5cd "$ROOT"
6OUT=$(cargo build --profile "$PROFILE" -p client --message-format=json | python3 -c '
7import sys, json
8for line in sys.stdin:
9 m = json.loads(line)
10 if m.get("reason") == "build-script-executed" and "/crates/client" in m["package_id"]:
11 print(m["out_dir"])')
12DIR="${PROFILE/dev/debug}"
13APP="target/$DIR/Yumush.app"
14rm -rf "$APP"
15mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
16cp "target/$DIR/client" "$APP/Contents/MacOS/yumush"
17cp "$OUT/yumush.icns" "$APP/Contents/Resources/yumush.icns"
18VERSION=$(cargo pkgid -p client | sed 's/.*[#@]//')
19cat > "$APP/Contents/Info.plist" <<PLIST
20<?xml version="1.0" encoding="UTF-8"?>
21<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
22<plist version="1.0">
23<dict>
24 <key>CFBundleName</key><string>Yumush</string>
25 <key>CFBundleDisplayName</key><string>yumuş</string>
26 <key>CFBundleIdentifier</key><string>com.yumush.client</string>
27 <key>CFBundleExecutable</key><string>yumush</string>
28 <key>CFBundleIconFile</key><string>yumush</string>
29 <key>CFBundlePackageType</key><string>APPL</string>
30 <key>CFBundleShortVersionString</key><string>$VERSION</string>
31 <key>CFBundleVersion</key><string>$VERSION</string>
32 <key>NSHighResolutionCapable</key><true/>
33 <key>NSMicrophoneUsageDescription</key><string>Voice calls</string>
34 <key>NSCameraUsageDescription</key><string>Video calls</string>
35</dict>
36</plist>
37PLIST
38echo "$APP"