2019-02-23 11:15:17 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-08-08 09:58:33 +00:00
|
|
|
echo "Hello from macbundle.sh"
|
2023-04-25 08:08:49 +00:00
|
|
|
|
2019-02-23 11:15:17 +00:00
|
|
|
PPSSPP="${1}"
|
2023-04-25 14:34:23 +00:00
|
|
|
PPSSPP_SHORTNAME="${2}"
|
|
|
|
PPSSPPSDL="${PPSSPP}/Contents/MacOS/${PPSSPP_SHORTNAME}"
|
2023-08-08 09:58:33 +00:00
|
|
|
MOLTENVK="${PPSSPP}/Contents/Frameworks/libMoltenVK.dylib"
|
2019-02-23 11:15:17 +00:00
|
|
|
|
2023-04-24 12:44:07 +00:00
|
|
|
ls ${PPSSPPSDL}
|
|
|
|
|
2019-02-23 11:15:17 +00:00
|
|
|
if [ ! -f "${PPSSPPSDL}" ]; then
|
|
|
|
echo "No such file: ${PPSSPPSDL}!"
|
2019-09-15 19:35:26 +00:00
|
|
|
exit 0
|
2019-02-23 11:15:17 +00:00
|
|
|
fi
|
|
|
|
|
2023-04-25 08:08:49 +00:00
|
|
|
echo pwd=`pwd`
|
|
|
|
echo PPSSPP=$PPSSPP
|
|
|
|
echo PPSSPPSDL=$PPSSPPSDL
|
|
|
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
RPATH="$(pwd)/macOS"
|
|
|
|
cd -
|
|
|
|
echo RPATH=$RPATH
|
|
|
|
SDL="${RPATH}/SDL2.framework"
|
|
|
|
if [ ! -d "${SDL}" ]; then
|
|
|
|
echo "Cannot locate SDL.framework: ${SDL}!"
|
|
|
|
exit 0
|
|
|
|
fi
|
2023-04-24 12:44:07 +00:00
|
|
|
|
2023-04-25 08:08:49 +00:00
|
|
|
rm -rf "${PPSSPP}/Contents/Frameworks/SDL2.framework" || exit 0
|
2023-04-24 12:44:07 +00:00
|
|
|
mkdir -p "${PPSSPP}/Contents/Frameworks" || exit 0
|
2023-04-25 08:08:49 +00:00
|
|
|
cp -a "$SDL" "${PPSSPP}/Contents/Frameworks" || exit 0
|
|
|
|
echo install_name_tool -rpath "${RPATH}" "@executable_path/../Frameworks" "${PPSSPPSDL}" || echo "Already patched."
|
|
|
|
install_name_tool -rpath "${RPATH}" "@executable_path/../Frameworks" "${PPSSPPSDL}" || echo "Already patched."
|
2023-04-24 12:44:07 +00:00
|
|
|
|
|
|
|
echo "Done."
|
2020-04-30 17:06:03 +00:00
|
|
|
|
2023-08-08 10:11:37 +00:00
|
|
|
GIT_VERSION_LINE=$(grep "PPSSPP_GIT_VERSION = " "$(dirname "${0}")/../build/git-version.cpp")
|
2023-04-25 09:44:37 +00:00
|
|
|
|
2023-04-24 08:50:30 +00:00
|
|
|
echo "Setting version to '${GIT_VERSION_LINE}'..."
|
2020-04-30 17:06:03 +00:00
|
|
|
SHORT_VERSION_MATCH='.*"v([0-9\.]+(-[0-9]+)?).*";'
|
|
|
|
LONG_VERSION_MATCH='.*"v(.*)";'
|
|
|
|
if [[ "${GIT_VERSION_LINE}" =~ ^${SHORT_VERSION_MATCH}$ ]]; then
|
|
|
|
plutil -replace CFBundleShortVersionString -string $(echo ${GIT_VERSION_LINE} | perl -pe "s/${SHORT_VERSION_MATCH}/\$1/g") ${PPSSPP}/Contents/Info.plist
|
|
|
|
plutil -replace CFBundleVersion -string $(echo ${GIT_VERSION_LINE} | perl -pe "s/${LONG_VERSION_MATCH}/\$1/g") ${PPSSPP}/Contents/Info.plist
|
|
|
|
else
|
|
|
|
plutil -replace CFBundleShortVersionString -string "" ${PPSSPP}/Contents/Info.plist
|
|
|
|
plutil -replace CFBundleVersion -string "" ${PPSSPP}/Contents/Info.plist
|
|
|
|
fi
|
2021-09-12 13:54:40 +00:00
|
|
|
|
|
|
|
# AdHoc codesign is required for Apple Silicon.
|
2023-04-24 12:44:07 +00:00
|
|
|
echo "Signing..."
|
2023-08-08 09:58:33 +00:00
|
|
|
|
|
|
|
codesign -fs - --entitlements ../macOS/Entitlements.plist --timestamp "${MOLTENVK}" || echo "Failed signing MoltenVK"
|
|
|
|
codesign -fs - --entitlements ../macOS/Entitlements.plist --timestamp "${PPSSPPSDL}" || echo "Failed signing PPSSPPSDL"
|
|
|
|
codesign -fs - --entitlements ../macOS/Entitlements.plist --timestamp "${PPSSPP}" || echo "Failed signing PPSSPP"
|