2008-12-29 05:43:17 +01:00
|
|
|
#!/bin/sh
|
2008-12-29 02:13:55 +01:00
|
|
|
|
2012-05-14 15:21:27 +02:00
|
|
|
set -e
|
|
|
|
|
2020-11-08 18:33:37 +01:00
|
|
|
SRC_DIR="${1}"
|
|
|
|
BUILD_DIR="${2}"
|
|
|
|
WX_PREFIX=`${3} --prefix`
|
|
|
|
FONTCONFIG_CONF_DIR="${4}"
|
|
|
|
DICT_DIR="${5}"
|
|
|
|
MESON_BUILD_OSX_BUNDLE="${6}"
|
|
|
|
|
|
|
|
if [ "${MESON_BUILD_OSX_BUNDLE}" != "TRUE" ]; then
|
|
|
|
echo "Project not built with \`build_osx_bundle\`"
|
|
|
|
echo "Please run \`meson configure -Dbuild_osx_bundle=true\` and rebuild"
|
2012-05-14 15:22:09 +02:00
|
|
|
exit 1
|
2008-12-29 05:41:00 +01:00
|
|
|
fi
|
2008-12-29 02:13:55 +01:00
|
|
|
|
2020-11-08 18:33:37 +01:00
|
|
|
PKG_DIR="${BUILD_DIR}/Aegisub.app"
|
|
|
|
SKEL_DIR="${SRC_DIR}/packages/osx_bundle"
|
|
|
|
|
2009-06-02 02:16:45 +02:00
|
|
|
if test -d "${PKG_DIR}"; then
|
2012-05-14 15:22:04 +02:00
|
|
|
rm -rf "${PKG_DIR}"
|
2020-11-08 18:33:37 +01:00
|
|
|
echo "Removing old Aegisub.app"
|
2008-12-30 07:44:04 +01:00
|
|
|
fi
|
2008-12-29 02:13:55 +01:00
|
|
|
|
2008-12-29 05:41:00 +01:00
|
|
|
echo
|
|
|
|
echo "---- Directory Structure ----"
|
2009-06-02 02:16:45 +02:00
|
|
|
mkdir -v "${PKG_DIR}"
|
|
|
|
mkdir -v "${PKG_DIR}/Contents"
|
|
|
|
mkdir -v "${PKG_DIR}/Contents/MacOS"
|
|
|
|
mkdir -v "${PKG_DIR}/Contents/Resources"
|
|
|
|
mkdir -v "${PKG_DIR}/Contents/SharedSupport"
|
|
|
|
mkdir -v "${PKG_DIR}/Contents/SharedSupport/dictionaries"
|
2008-12-29 02:13:55 +01:00
|
|
|
|
2008-12-29 05:41:00 +01:00
|
|
|
echo
|
|
|
|
echo "---- Copying Skel Files ----"
|
2020-11-08 18:33:37 +01:00
|
|
|
if ! test -f "${BUILD_DIR}/osx-bundle.sed"; then
|
2010-12-11 02:32:59 +01:00
|
|
|
echo
|
2020-11-08 18:33:37 +01:00
|
|
|
echo "NOT FOUND: ${BUILD_DIR}/osx-bundle.sed"
|
2012-05-14 15:22:09 +02:00
|
|
|
exit 1
|
2010-12-11 02:32:59 +01:00
|
|
|
fi
|
|
|
|
|
2014-06-17 03:22:06 +02:00
|
|
|
# used by osx-bundle.sed
|
2020-11-08 18:33:37 +01:00
|
|
|
find "${SRC_DIR}/po" -name *.po | sed 's/.*\/\(.*\)\.po/ <string>\1<\/string>/; s/RS/YU/' > "${BUILD_DIR}/languages"
|
2012-05-24 03:53:56 +02:00
|
|
|
|
2020-11-08 18:33:37 +01:00
|
|
|
#find "${SKEL_DIR}" -type f -not -regex ".*.svn.*"
|
|
|
|
cp -v ${SKEL_DIR}/Contents/Resources/*.icns "${PKG_DIR}/Contents/Resources"
|
|
|
|
cat "${SKEL_DIR}/Contents/Info.plist" | sed -f "${BUILD_DIR}/osx-bundle.sed" > "${PKG_DIR}/Contents/Info.plist"
|
2008-12-29 02:13:55 +01:00
|
|
|
|
2020-11-08 18:33:37 +01:00
|
|
|
rm "${BUILD_DIR}/languages"
|
2009-02-18 07:00:17 +01:00
|
|
|
|
2014-06-17 03:22:06 +02:00
|
|
|
echo
|
|
|
|
echo "---- Installing files ----"
|
2020-11-08 18:33:37 +01:00
|
|
|
CURRENT_DIR=`pwd`
|
|
|
|
cd ${BUILD_DIR}
|
|
|
|
ninja install
|
|
|
|
cd ${CURRENT_DIR}
|
2014-06-17 03:22:06 +02:00
|
|
|
|
2009-02-18 07:00:17 +01:00
|
|
|
echo
|
|
|
|
echo "---- Copying dictionaries ----"
|
2020-11-08 18:33:37 +01:00
|
|
|
if test -f "${DICT_DIR}"; then
|
|
|
|
cp -v "${DICT_DIR}/*" "${PKG_DIR}/Contents/SharedSupport/dictionaries"
|
2009-02-18 07:00:17 +01:00
|
|
|
else
|
2020-11-08 18:33:37 +01:00
|
|
|
echo "Specified dictionary directory ${DICT_DIR} not found!"
|
2009-02-18 07:00:17 +01:00
|
|
|
fi
|
|
|
|
|
2009-01-04 11:04:32 +01:00
|
|
|
echo
|
2010-01-21 01:37:04 +01:00
|
|
|
echo "---- Copying Aegisub locale files ----"
|
2009-01-04 11:53:54 +01:00
|
|
|
# Let Aqua know that aegisub supports english. English strings are
|
|
|
|
# internal so we don't need an aegisub.mo file.
|
2010-01-21 01:37:04 +01:00
|
|
|
mkdir -vp "${PKG_DIR}/Contents/Resources/en.lproj"
|
2009-01-04 11:53:54 +01:00
|
|
|
|
2020-11-08 18:33:37 +01:00
|
|
|
# FIXME
|
2014-06-17 03:22:06 +02:00
|
|
|
# 10.8 wants sr_YU rather than sr_RS
|
2020-11-08 18:33:37 +01:00
|
|
|
#mv "${PKG_DIR}/Contents/Resources/sr_RS.lproj" "${PKG_DIR}/Contents/Resources/sr_YU.lproj"
|
|
|
|
#mv "${PKG_DIR}/Contents/Resources/sr_RS@latin.lproj" "${PKG_DIR}/Contents/Resources/sr_YU@latin.lproj"
|
2010-01-21 01:37:04 +01:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "---- Copying WX locale files ----"
|
|
|
|
|
2020-11-08 18:33:37 +01:00
|
|
|
for i in `ls -1 ${SRC_DIR}/po/*.mo|sed "s|po/\(.*\).mo|\1|"`; do
|
2012-05-14 15:22:09 +02:00
|
|
|
WX_MO="${WX_PREFIX}/share/locale/${i}/LC_MESSAGES/wxstd.mo"
|
|
|
|
|
|
|
|
if ! test -f "${WX_MO}"; then
|
|
|
|
WX_MO="${HOME_DIR}/wxstd/${i}.mo"
|
|
|
|
fi
|
2010-01-21 01:37:04 +01:00
|
|
|
|
|
|
|
if test -f "${WX_MO}"; then
|
2012-05-14 15:22:09 +02:00
|
|
|
cp -v "${WX_MO}" "${PKG_DIR}/Contents/Resources/${i}.lproj/"
|
2010-01-21 01:37:04 +01:00
|
|
|
else
|
2012-05-14 15:22:09 +02:00
|
|
|
echo "WARNING: \"$i\" locale in aegisub but no WX catalog found!"
|
|
|
|
fi
|
2010-01-21 01:37:04 +01:00
|
|
|
done
|
|
|
|
|
2008-12-29 05:41:00 +01:00
|
|
|
echo
|
2020-11-08 18:33:37 +01:00
|
|
|
echo "---- Fixing libraries ----"
|
|
|
|
sudo python "${SRC_DIR}/tools/osx-fix-libs.py" "${PKG_DIR}/Contents/MacOS/aegisub" || exit $?
|
2008-12-29 05:41:00 +01:00
|
|
|
|
|
|
|
echo
|
2020-11-08 18:33:37 +01:00
|
|
|
echo "Done creating \"${PKG_DIR}\""
|