thorium-mirror/build_dmg.sh

36 lines
908 B
Bash
Raw Normal View History

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-01-06 03:03:26 -03:00
chrome/installer/mac/pkg-dmg \
2022-01-07 07:18:45 -03:00
--sourcefile --source out/thorium/Thorium.app \
2022-01-06 03:03:26 -03:00
--target "out/thorium/Thorium_MacOS.dmg" \
--volname Thorium --symlink /Applications:/Applications \
2022-06-05 01:55:07 -04:00
--format UDBZ --verbosity 2 &&
2022-06-06 18:56:36 -04:00
printf "${GRE}.DMG Build Completed. ${YEL}Installer at //out/thorium/thorium*.dmg\n" &&
2022-06-05 01:55:07 -04:00
tput sgr0 &&