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
|
|
|
|
|
2012-08-19 23:33:50 +02:00
|
|
|
PKG_DIR=Aegisub.app
|
2008-12-29 05:41:00 +01:00
|
|
|
SKEL_DIR="packages/osx_bundle"
|
2012-08-19 23:33:50 +02:00
|
|
|
AEGISUB_BIN="${1}"
|
2009-01-07 11:30:14 +01:00
|
|
|
SRCDIR=`pwd`
|
2009-02-18 07:00:17 +01:00
|
|
|
HOME_DIR=`echo ~`
|
2012-08-19 23:33:50 +02:00
|
|
|
WX_PREFIX=`${2} --prefix`
|
2014-06-24 18:06:05 +02:00
|
|
|
FONTCONFIG_CONF_DIR="${3}"
|
2009-02-18 07:00:17 +01:00
|
|
|
|
2008-12-29 05:41:00 +01:00
|
|
|
if ! test -d packages/osx_bundle; then
|
2008-12-30 07:44:04 +01:00
|
|
|
echo
|
2008-12-29 05:41:00 +01:00
|
|
|
echo "Make sure you're in the toplevel source directory"
|
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
|
|
|
|
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}"
|
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 ----"
|
2010-12-11 02:32:59 +01:00
|
|
|
if ! test -f "tools/osx-bundle.sed"; then
|
|
|
|
echo
|
2012-05-14 15:22:09 +02:00
|
|
|
echo "NOT FOUND: tools/osx-bundle.sed"
|
|
|
|
exit 1
|
2010-12-11 02:32:59 +01:00
|
|
|
fi
|
|
|
|
|
2014-06-17 03:22:06 +02:00
|
|
|
# used by osx-bundle.sed
|
2012-10-02 23:58:19 +02:00
|
|
|
find po -name *.po | sed 's/.*\/\(.*\)\.po/ <string>\1<\/string>/; s/RS/YU/' > languages
|
2012-05-24 03:53:56 +02:00
|
|
|
|
2009-01-01 06:59:41 +01:00
|
|
|
find ${SKEL_DIR} -type f -not -regex ".*.svn.*"
|
2009-06-02 02:16:45 +02:00
|
|
|
cp ${SKEL_DIR}/Contents/Resources/*.icns "${PKG_DIR}/Contents/Resources"
|
2012-08-19 23:33:50 +02:00
|
|
|
cat ${SKEL_DIR}/Contents/Info.plist | sed -f tools/osx-bundle.sed > "${PKG_DIR}/Contents/Info.plist"
|
2008-12-29 02:13:55 +01:00
|
|
|
|
2012-05-24 03:53:56 +02:00
|
|
|
rm languages
|
2009-02-18 07:00:17 +01:00
|
|
|
|
2014-06-17 03:22:06 +02:00
|
|
|
echo
|
|
|
|
echo "---- Installing files ----"
|
|
|
|
make install \
|
|
|
|
DESTDIR="${PKG_DIR}/Contents" \
|
|
|
|
P_DATA="/SharedSupport" \
|
|
|
|
P_DOC="/SharedSupport/doc" \
|
|
|
|
P_LOCALE="/Resources" \
|
|
|
|
P_BINDIR="/MacOS"
|
|
|
|
|
2009-02-18 07:00:17 +01:00
|
|
|
echo
|
|
|
|
echo "---- Copying dictionaries ----"
|
2009-06-02 02:16:45 +02:00
|
|
|
if test -z "${DICT_DIR}"; then
|
2009-02-18 07:00:17 +01:00
|
|
|
DICT_DIR="${HOME_DIR}/dict"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -d "${DICT_DIR}"; then
|
2010-01-21 01:37:04 +01:00
|
|
|
cp -v ${DICT_DIR}/* "${PKG_DIR}/Contents/SharedSupport/dictionaries"
|
2009-02-18 07:00:17 +01:00
|
|
|
else
|
|
|
|
echo "WARNING: Dictionaries not found, please set $$DICT_DIR to a directiory"
|
|
|
|
echo " where the *.aff and *.dic files can be found"
|
|
|
|
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
|
|
|
|
2014-06-17 03:22:06 +02:00
|
|
|
# 10.8 wants sr_YU rather than sr_RS
|
|
|
|
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 ----"
|
|
|
|
|
2010-12-11 00:05:05 +01:00
|
|
|
for i in `ls -1 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
|
|
|
|
echo "---- Libraries ----"
|
2010-08-14 19:38:37 +02:00
|
|
|
python tools/osx-fix-libs.py "${PKG_DIR}/Contents/MacOS/aegisub" || exit $?
|
2008-12-29 05:41:00 +01:00
|
|
|
|
|
|
|
echo
|
2009-06-02 02:16:45 +02:00
|
|
|
echo "Done Creating \"${PKG_DIR}\""
|