2022-01-06 03:03:26 -03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-04-11 11:48:53 -04:00
|
|
|
# Copyright (c) 2022 Alex313031 and Midzer.
|
|
|
|
|
2022-04-09 04:39:24 -04:00
|
|
|
YEL='\033[1;33m' # Yellow
|
2022-06-06 18:56:36 -04:00
|
|
|
RED='\033[1;31m' # Red
|
2022-06-05 01:55:07 -04:00
|
|
|
GRE='\033[1;32m' # Green
|
2022-06-06 18:56:36 -04:00
|
|
|
c0=$'\033[0m' # Reset Text
|
|
|
|
bold=$'\033[1m' # Bold Text
|
|
|
|
underline=$'\033[4m' # Underline Text
|
2022-06-05 01:55:07 -04:00
|
|
|
|
|
|
|
# Error handling
|
|
|
|
yell() { echo "$0: $*" >&2; }
|
|
|
|
die() { yell "$*"; exit 111; }
|
2022-06-06 18:56:36 -04:00
|
|
|
try() { "$@" || die "${RED}Failed $*"; }
|
2022-01-06 03:03:26 -03:00
|
|
|
|
2022-04-09 04:39:24 -04:00
|
|
|
printf "\n" &&
|
|
|
|
printf "${YEL}Building .dmg of Thorium...\n" &&
|
2022-06-05 01:55:07 -04:00
|
|
|
printf "${GRE}\n" &&
|
2022-04-09 04:39:24 -04:00
|
|
|
|
2022-06-05 01:55:07 -04:00
|
|
|
# Fix file attr
|
2022-04-09 04:39:24 -04:00
|
|
|
xattr -csr out/thorium/Thorium.app &&
|
|
|
|
|
2022-06-05 01:55:07 -04:00
|
|
|
# Sign binary
|
2022-04-09 04:39:24 -04:00
|
|
|
codesign --force --deep --sign - out/thorium/Thorium.app &&
|
2022-01-06 03:03:26 -03:00
|
|
|
|
2022-06-05 01:55:07 -04:00
|
|
|
# Build dmg package
|
2022-06-17 11:10:02 -04:00
|
|
|
chrome/installer/mac/pkg-dmg --sourcefile --source out/thorium/Thorium.app --target "out/thorium/Thorium_MacOS.dmg" --volname Thorium --symlink /Applications:/Applications --format UDBZ --verbosity 2 &&
|
2022-06-05 01:55:07 -04:00
|
|
|
|
2022-06-17 11:12:12 -04:00
|
|
|
printf "${GRE}.DMG Build Completed. ${YEL}Installer at //out/thorium/Thorium*_MacOS.dmg\n" &&
|
2022-06-17 11:13:45 -04:00
|
|
|
tput sgr0
|