Merge pull request #470 from LAbyOne/buildme

Buildme
This commit is contained in:
Sergey 2021-11-01 05:50:52 +03:00 committed by GitHub
commit 24adc10b84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 91 additions and 62 deletions

View File

@ -9,7 +9,7 @@ printf "\n\e[1m%s\e[0m\n" "Usage: $0 [flag1 flag2...]"
printf "\n%s" "The (optional) exclude flags are being passed to the buildpkg.sh script, when specified."
printf "\n%s\n" "Possible flag values:"
printf "\n\e[1m%s\e[0m\t%s" "--nothemes" "Excludes the Themes subpackage."
printf "\n\e[1m%s\e[0m\t%s" "--noprefpane" "Excludes the Clover Prefpane / Clover Updater subpackage."
# printf "\n\e[1m%s\e[0m\t%s" "--noprefpane" "Excludes the Clover Prefpane / Clover Updater subpackage."
printf "\n\e[1m%s\e[0m\t\t%s" "--norc" "Excludes the RC scripts subpackage."
printf "\n\e[1m%s\e[0m\t%s" "--nolegacy" "Excludes the CloverEFI subpackages."
echo
@ -18,7 +18,7 @@ echo
while [[ $# -gt 0 ]]; do
case "${1}" in
--nothemes ) NOEXTRAS+=" --nothemes";;
--noprefpane ) NOEXTRAS+=" --noprefpane";;
# --noprefpane ) NOEXTRAS+=" --noprefpane";;
--norc ) NOEXTRAS+=" --norc";;
--nolegacy ) NOEXTRAS+=" --nolegacy";;
* ) printf "\e[1m%s\e[0m\n" "Invalid option: ${1} !"; usage; exit 1;;
@ -62,13 +62,13 @@ echo "========= Translating Resources ========"
# Check that XCode is install properly
xcode_path=$(/usr/bin/xcode-select --print-path 2>/dev/null)
if [[ -n "$xcode_path" ]]; then
# Make CloverUpdater
"${SRCROOT}"/CloverUpdater/translate_xib.sh # workaround for a bug in Xcode 10 Beta
make -C "${SRCROOT}"/CloverUpdater || exit $?
# Make CloverPrefpane
"${SRCROOT}"/CloverPrefpane/translate_xib.sh # workaround for a bug in Xcode 10 Beta
"${SRCROOT}"/CloverPrefpane/translate_source.sh # workaround for a bug in Xcode 10 Beta
make -C "${SRCROOT}"/CloverPrefpane || exit $?
# # Make CloverUpdater
# "${SRCROOT}"/CloverUpdater/translate_xib.sh # workaround for a bug in Xcode 10 Beta
# make -C "${SRCROOT}"/CloverUpdater || exit $?
# # Make CloverPrefpane
# "${SRCROOT}"/CloverPrefpane/translate_xib.sh # workaround for a bug in Xcode 10 Beta
# "${SRCROOT}"/CloverPrefpane/translate_source.sh # workaround for a bug in Xcode 10 Beta
# make -C "${SRCROOT}"/CloverPrefpane || exit $?
# Make utils
make -C "${SRCROOT}"/utils || exit $?
# temporary use ready-to-use binaries

View File

@ -245,11 +245,11 @@ The target volume must be a bootable OSX system volume.";
"disable_sleep_proxy_client_title" = "Disable sleep proxy client";
"disable_sleep_proxy_client_description" = "Disable the mDNSResponder sleep proxy client service. This will prevent the system waking from sleep every hours";
// ============================================================================
/*// ============================================================================
// Clover Preference Pane
// ----------------------------------------------------------------------------
"CloverPrefpane_title" = "Install Clover Preference Pane";
"CloverPrefpane_description" = "Install Clover Preference Pane on target volume.
Include CloverUpdater that can notify you about Clover updates.";
*/
// ----------------------------------------------------------------------------

View File

@ -155,13 +155,13 @@ fi
find "$backupRootDir" -type d -maxdepth 2 -empty -print0 2>/dev/null | xargs -0 rmdir
find "$backupRootDir" -type d -maxdepth 1 -empty -print0 2>/dev/null | xargs -0 rmdir
# Remove old CloverPrefpane
pkg='@CLOVER_PACKAGE_IDENTITY@.cloverprefpane'
location=$(/usr/sbin/pkgutil --volume "$DEST_VOL" --pkg-info $pkg 2>/dev/null | sed -n 's/^location: *//p')
pkgutil --volume "$DEST_VOL" --files $pkg 2>/dev/null | \
xargs -I @@ echo "$DEST_VOL/$location/@@" | \
/usr/bin/grep -iE 'CloverUpdater|Clover.prefPane' | \
xargs -I @@ rm -rf '@@'
# # Remove old CloverPrefpane
# pkg='@CLOVER_PACKAGE_IDENTITY@.cloverprefpane'
# location=$(/usr/sbin/pkgutil --volume "$DEST_VOL" --pkg-info $pkg 2>/dev/null | sed -n 's/^location: *//p')
# pkgutil --volume "$DEST_VOL" --files $pkg 2>/dev/null | \
# xargs -I @@ echo "$DEST_VOL/$location/@@" | \
# /usr/bin/grep -iE 'CloverUpdater|Clover.prefPane' | \
# xargs -I @@ rm -rf '@@'
# Remove files of old revision.
pkgs=$(/usr/sbin/pkgutil --volume "$DEST_VOL" --pkgs | /usr/bin/grep -iE '@CLOVER_PACKAGE_IDENTITY@.' | /usr/bin/grep -Ev 'ntfs|apfs|hfsplus')

View File

@ -26,7 +26,7 @@ printf "\n%s" "The following flags are optional and exclude options (subpackages
printf "\n%s" "Possible values:"
echo
printf "\n\e[1m%s\e[0m\t%s" "--nothemes" "Excludes the Themes subpackage."
printf "\n\e[1m%s\e[0m\t%s" "--noprefpane" "Excludes the Clover Prefpane / Clover Updater subpackage."
# printf "\n\e[1m%s\e[0m\t%s" "--noprefpane" "Excludes the Clover Prefpane / Clover Updater subpackage."
printf "\n\e[1m%s\e[0m\t\t%s" "--norc" "Excludes the RC scripts subpackage."
printf "\n\e[1m%s\e[0m\t%s\n\n" "--nolegacy" "Excludes the CloverEFI subpackages."
}
@ -41,7 +41,7 @@ while [[ $# -gt 0 ]]; do
--symroot ) declare -r SYMROOT="${2}"; shift;; # ie. src/Clover/CloverPackage/sym
--builddir ) declare -r PKG_BUILD_DIR="${2}"; shift;; # ie. src/Clover/CloverPackage/sym/package
--nothemes ) NOEXTRAS+=", Clover Themes";;
--noprefpane ) NOEXTRAS+=", Clover Prefpane/Clover Updater";;
# --noprefpane ) NOEXTRAS+=", Clover Prefpane/Clover Updater";;
--norc ) NOEXTRAS+=", RC scripts";;
--nolegacy ) NOEXTRAS+=", CloverEFI";;
* ) printf "\e[1m%s\e[0m\n" "Invalid option: ${1} !" >&2; usage; exit 1;;
@ -1456,30 +1456,30 @@ if [[ -d "${SRCROOT}"/CloverConfigPlistValidator && ${NOEXTRAS} != *"CloverConfi
# End build CloverConfigPlistValidator packages
fi
local cloverUpdaterDir="${SRCROOT}"/CloverUpdater
local cloverPrefpaneDir="${SRCROOT}"/CloverPrefpane
if [[ -x "$cloverPrefpaneDir"/build/Clover.prefPane/Contents/MacOS/Clover && ${NOEXTRAS} != *"Clover Prefpane"* ]]; then
# build CloverPrefpane package
echo "==================== Clover Prefpane ==================="
packagesidentity="$clover_package_identity"
choiceId="CloverPrefpane"
packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
# ditto --noextattr --noqtn "$cloverUpdaterDir"/CloverUpdaterUtility.plist \
# "${PKG_BUILD_DIR}/${choiceId}"/Root/Library/LaunchAgents/com.projectosx.Clover.Updater.plist
ditto --noextattr --noqtn "$cloverUpdaterDir"/CloverUpdaterUtility \
"${PKG_BUILD_DIR}/${choiceId}/Root/Library/Application Support/Clover"/
ditto --noextattr --noqtn "$cloverUpdaterDir"/build/CloverUpdater.app \
"${PKG_BUILD_DIR}/${choiceId}/Root/Library/Application Support/Clover"/CloverUpdater.app
ditto --noextattr --noqtn "$cloverPrefpaneDir"/build/Clover.prefPane \
"${PKG_BUILD_DIR}/${choiceId}/Root/Library/PreferencePanes/"/Clover.prefPane
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \
--subst="INSTALLER_CHOICE=$packageRefId" MarkChoice
buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/"
addChoice --start-selected="checkFileExists('/bin/launchctl') && choicePreviouslySelected('$packageRefId')" \
--start-enabled="checkFileExists('/bin/launchctl')" \
--pkg-refs="$packageRefId" "${choiceId}"
# end CloverUpdater package
fi
# local cloverUpdaterDir="${SRCROOT}"/CloverUpdater
# local cloverPrefpaneDir="${SRCROOT}"/CloverPrefpane
# if [[ -x "$cloverPrefpaneDir"/build/Clover.prefPane/Contents/MacOS/Clover && ${NOEXTRAS} != *"Clover Prefpane"* ]]; then
# # build CloverPrefpane package
# echo "==================== Clover Prefpane ==================="
# packagesidentity="$clover_package_identity"
# choiceId="CloverPrefpane"
# packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}")
# # ditto --noextattr --noqtn "$cloverUpdaterDir"/CloverUpdaterUtility.plist \
# # "${PKG_BUILD_DIR}/${choiceId}"/Root/Library/LaunchAgents/com.projectosx.Clover.Updater.plist
# ditto --noextattr --noqtn "$cloverUpdaterDir"/CloverUpdaterUtility \
# "${PKG_BUILD_DIR}/${choiceId}/Root/Library/Application Support/Clover"/
# ditto --noextattr --noqtn "$cloverUpdaterDir"/build/CloverUpdater.app \
# "${PKG_BUILD_DIR}/${choiceId}/Root/Library/Application Support/Clover"/CloverUpdater.app
# ditto --noextattr --noqtn "$cloverPrefpaneDir"/build/Clover.prefPane \
# "${PKG_BUILD_DIR}/${choiceId}/Root/Library/PreferencePanes/"/Clover.prefPane
# addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \
# --subst="INSTALLER_CHOICE=$packageRefId" MarkChoice
# buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/"
# addChoice --start-selected="checkFileExists('/bin/launchctl') && choicePreviouslySelected('$packageRefId')" \
# --start-enabled="checkFileExists('/bin/launchctl')" \
# --pkg-refs="$packageRefId" "${choiceId}"
# # end CloverUpdater package
# fi
# build post install package
echo "================= Post ================="

65
buildme
View File

@ -147,6 +147,28 @@ else
fi
}
makeRelease() {
checkTools
# to force recreation of the Conf folder. You can still use a custom CONF_PATH if you don't want recreation.
rm -rf "$CLOVERROOT"/Conf
mkdir "$CLOVERROOT"/Conf
cd "${CLOVERROOT}"
if [[ -z "$WORKSPACE" ]]; then
export EDK_TOOLS_PATH="${PWD}"/BaseTools
set +u
source ./edksetup.sh BaseTools
set -u
cd "$CLOVERROOT"
WORKSPACE="${PWD}"
fi
echo "[BUILD CLOVER RELEASE]"
./ebuild.sh -fr -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED -t $MYTOOLCHAIN
./ebuild.sh -fr -D NO_GRUB_DRIVERS_EMBEDDED -D LESS_DEBUG -t $MYTOOLCHAIN
}
buildCCPV() {
cd "${CLOVERROOT}"/Xcode/CloverConfigPlistValidator
make
@ -186,10 +208,10 @@ if [[ -x "${DIR_TOOLS}"/Scripts/build.sh ]]; then
else
local parameter=${1:-none}
if [[ "${parameter}" == HFSPlus ]]; then
./ebuild.sh -fr -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED -D USE_APPLE_HFSPLUS_DRIVER -t $MYTOOLCHAIN
#./ebuild.sh -fr -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED -D USE_APPLE_HFSPLUS_DRIVER -t $MYTOOLCHAIN
./ebuild.sh -fr -D NO_GRUB_DRIVERS_EMBEDDED -D USE_APPLE_HFSPLUS_DRIVER -t $MYTOOLCHAIN
else
./ebuild.sh -fr -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED -t $MYTOOLCHAIN
#./ebuild.sh -fr -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED -t $MYTOOLCHAIN
./ebuild.sh -fr -D NO_GRUB_DRIVERS_EMBEDDED -D LESS_DEBUG -t $MYTOOLCHAIN
fi
fi
@ -617,13 +639,13 @@ Please enter your choice: '
options=( 'build Clover'
'update Clover'
'build Clover with HFSPlus'
'make pkg'
'make app'
'make app (with Clover)'
'make pkg'
'make iso'
'make app'
'build all'
'make Release'
'test Clover'
'status'
'check status'
'show diff'
'open CloverV2/EFI/CLOVER directory'
'update Clover (reset changes)'
@ -652,37 +674,44 @@ do
buildPkg
break
;;
"make app")
buildApp
break
;;
"make app (with Clover)")
buildApp withV2
break
;;
"make iso")
buildIso
break
;;
"make app")
buildApp withV2
break
;;
# "make app (with Clover)")
# buildApp withV2
# break
# ;;
"build all")
buildClover
buildClover
buildCCPV
BLC
buildPkg
buildIso
break
;;
"make Release")
makeRelease
buildCCPV
BLC
buildPkg
buildIso
buildApp
break
;;
"test Clover")
testing
break
;;
"status")
"check status")
checkStatus
break
;;
"show diff")
showdiff
showdiff
break
;;
"open CloverV2/EFI/CLOVER directory")