Skip to content

Commit

Permalink
Merge pull request #470 from LAbyOne/buildme
Browse files Browse the repository at this point in the history
Buildme
  • Loading branch information
SergeySlice authored Nov 1, 2021
2 parents 5c3e2ea + fe7baa8 commit 24adc10
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 60 deletions.
18 changes: 9 additions & 9 deletions CloverPackage/makepkg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;;
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions CloverPackage/package/Resources/templates/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -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.";

*/
// ----------------------------------------------------------------------------
14 changes: 7 additions & 7 deletions CloverPackage/package/Scripts.templates/EFIFolder/preinstall
Original file line number Diff line number Diff line change
Expand Up @@ -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='@[email protected]'
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='@[email protected]'
# 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')
Expand Down
52 changes: 26 additions & 26 deletions CloverPackage/package/buildpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
Expand All @@ -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;;
Expand Down Expand Up @@ -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 ================="
Expand Down
61 changes: 45 additions & 16 deletions buildme
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)'
Expand Down Expand Up @@ -652,37 +674,44 @@ do
buildPkg
break
;;
"make app")
buildApp
"make iso")
buildIso
break
;;
"make app (with Clover)")
"make app")
buildApp withV2
break
;;
"make iso")
buildIso
# "make app (with Clover)")
# buildApp withV2
# break
# ;;
"build all")
buildClover
buildCCPV
BLC
buildPkg
buildIso
break
;;
"build all")
buildClover
"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")
Expand Down

1 comment on commit 24adc10

@xiyuexue
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to delete args in CloverBootloader/CloverPackage/Makefile
slimpkg2:
@${SRCROOT}/makepkg --nothemes --noprefpane

slimpkg3:
@${SRCROOT}/makepkg --nothemes --noprefpane --norc --nolegacy

Please sign in to comment.