2022-01-06 03:03:26 -03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-02-12 15:57:09 -03:00
|
|
|
# Copyright (c) 2024 Alex313031 and midzer.
|
2022-04-11 11:48:53 -04:00
|
|
|
|
2022-04-09 04:39:24 -04:00
|
|
|
YEL='\033[1;33m' # Yellow
|
2022-07-16 00:39:41 -04:00
|
|
|
CYA='\033[1;96m' # Cyan
|
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-08-03 07:12:05 -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
|
|
|
|
2023-06-23 01:29:21 -04:00
|
|
|
# chromium/src dir env variable
|
|
|
|
if [ -z "${CR_DIR}" ]; then
|
|
|
|
CR_SRC_DIR="$HOME/chromium/src"
|
|
|
|
export CR_SRC_DIR
|
|
|
|
else
|
|
|
|
CR_SRC_DIR="${CR_DIR}"
|
|
|
|
export CR_SRC_DIR
|
|
|
|
fi
|
|
|
|
|
2022-04-09 04:39:24 -04:00
|
|
|
printf "\n" &&
|
2023-04-13 07:36:05 -04:00
|
|
|
printf "${YEL}Building .dmg of Thorium...\n" &&
|
2022-07-16 00:39:41 -04:00
|
|
|
printf "${CYA}\n" &&
|
2022-04-09 04:39:24 -04:00
|
|
|
|
2023-06-23 01:29:21 -04:00
|
|
|
cd ${CR_SRC_DIR} &&
|
2023-04-13 07:36:05 -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-08-07 17:39:46 -04:00
|
|
|
|
2023-06-23 01:38:08 -04:00
|
|
|
cd $HOME/thorium &&
|
2022-10-15 06:06:23 -03:00
|
|
|
cat logos/apple_ascii_art.txt &&
|
2022-08-07 17:39:46 -04:00
|
|
|
|
2023-06-23 01:29:21 -04:00
|
|
|
printf "${GRE}.DMG Build Completed. ${YEL}Installer at \'//chromium/src/out/thorium/Thorium*_MacOS.dmg\'\n" &&
|
2022-06-17 11:13:45 -04:00
|
|
|
tput sgr0
|