2008-12-29 05:43:17 +01:00
|
|
|
#!/bin/sh
|
2008-12-29 02:13:55 +01:00
|
|
|
|
2008-12-29 05:41:00 +01:00
|
|
|
PKG_DIR=${1}.app
|
|
|
|
SKEL_DIR="packages/osx_bundle"
|
2009-01-07 09:48:33 +01:00
|
|
|
AEGISUB_VERSION_DATA="${2}"
|
2009-03-13 05:27:24 +01:00
|
|
|
AEGISUB_BIN="aegisub-${AEGISUB_VERSION_DATA}"
|
2009-01-07 11:30:14 +01:00
|
|
|
SRCDIR=`pwd`
|
2009-02-18 07:00:17 +01:00
|
|
|
HOME_DIR=`echo ~`
|
2010-01-21 01:37:04 +01:00
|
|
|
WX_CONFIG="wx-config"
|
|
|
|
WX_PREFIX=`${WX_CONFIG} --prefix`
|
2009-02-18 07:00:17 +01:00
|
|
|
|
2009-01-29 00:33:51 +01:00
|
|
|
if test -z "${CC}"; then
|
|
|
|
CC="cc"
|
|
|
|
fi
|
2008-12-29 02:13:55 +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"
|
|
|
|
exit 1;
|
|
|
|
fi
|
2008-12-29 02:13:55 +01:00
|
|
|
|
2009-06-02 02:16:45 +02:00
|
|
|
if test -d "${PKG_DIR}"; then
|
2008-12-30 07:44:04 +01:00
|
|
|
echo "**** USING OLD ${PKG_DIR} ****"
|
|
|
|
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/Resources/etc"
|
|
|
|
mkdir -v "${PKG_DIR}/Contents/Resources/etc/fonts"
|
|
|
|
mkdir -v "${PKG_DIR}/Contents/Resources/etc/fonts/conf.d"
|
|
|
|
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
|
|
|
|
echo "NOT FOUND: tools/osx-bundle.sed";
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
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"
|
|
|
|
cp ${SKEL_DIR}/Contents/Resources/etc/fonts/fonts.dtd "${PKG_DIR}/Contents/Resources/etc/fonts"
|
2010-08-14 19:38:37 +02:00
|
|
|
cat ${SKEL_DIR}/Contents/Resources/etc/fonts/fonts.conf |sed -f tools/osx-bundle.sed > "${PKG_DIR}/Contents/Resources/etc/fonts/fonts.conf"
|
2009-06-02 02:16:45 +02:00
|
|
|
cp ${SKEL_DIR}/Contents/Resources/etc/fonts/conf.d/*.conf "${PKG_DIR}/Contents/Resources/etc/fonts/conf.d"
|
2010-08-14 19:38:37 +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
|
|
|
|
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-07 11:30:14 +01:00
|
|
|
echo
|
|
|
|
echo "---- Copying automation/ files ----"
|
|
|
|
cd automation
|
|
|
|
make install \
|
2009-06-02 02:16:45 +02:00
|
|
|
aegisubdatadir="../${PKG_DIR}/Contents/SharedSupport" \
|
|
|
|
aegisubdocdir="../${PKG_DIR}/Contents/SharedSupport/doc"
|
|
|
|
cd "${SRCDIR}"
|
2009-01-07 11:30:14 +01:00
|
|
|
|
|
|
|
|
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
|
|
|
|
2010-12-11 00:05:05 +01:00
|
|
|
for i in `ls -1 po/*.mo|sed "s|po/\(.*\).mo|\1|"`; do
|
|
|
|
if test -f "po/${i}.mo"; then
|
2010-01-21 01:37:04 +01:00
|
|
|
mkdir -p "${PKG_DIR}/Contents/Resources/${i}.lproj";
|
2010-12-11 00:05:05 +01:00
|
|
|
cp -v po/${i}.mo "${PKG_DIR}/Contents/Resources/${i}.lproj/aegisub.mo";
|
2009-01-04 11:04:32 +01:00
|
|
|
else
|
2010-12-11 00:05:05 +01:00
|
|
|
echo "${i}.mo not found!"
|
2009-04-28 07:17:33 +02:00
|
|
|
exit 1
|
2010-01-21 01:37:04 +01:00
|
|
|
fi;
|
2009-01-04 11:04:32 +01:00
|
|
|
done
|
|
|
|
|
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
|
2010-01-21 01:37:04 +01:00
|
|
|
# WX_MO="${WX_PREFIX}/share/locale/${i}/LC_MESSAGES/wxstd.mo"
|
|
|
|
WX_MO="${HOME_DIR}/wxstd/${i}.mo"
|
|
|
|
|
|
|
|
if test -f "${WX_MO}"; then
|
|
|
|
cp -v "${WX_MO}" "${PKG_DIR}/Contents/Resources/${i}.lproj/";
|
|
|
|
else
|
|
|
|
echo "WARNING: \"$i\" locale in aegisub but no WX catalog found!";
|
|
|
|
fi;
|
|
|
|
done
|
|
|
|
|
|
|
|
|
2008-12-29 05:41:00 +01:00
|
|
|
echo
|
2010-12-11 00:05:05 +01:00
|
|
|
echo " ---- Copying binary ----"
|
|
|
|
cp -v src/${AEGISUB_BIN} "${PKG_DIR}/Contents/MacOS/aegisub"
|
2009-03-13 05:27:24 +01:00
|
|
|
|
|
|
|
|
2010-12-11 00:05:05 +01:00
|
|
|
echo
|
|
|
|
echo " ---- Build / install restart-helper ----"
|
2010-08-14 19:38:37 +02:00
|
|
|
echo cc -o "${PKG_DIR}/Contents/MacOS/restart-helper tools/osx-bundle-restart-helper.c"
|
|
|
|
${CC} -o "${PKG_DIR}/Contents/MacOS/restart-helper" tools/osx-bundle-restart-helper.c || exit $?
|
2008-12-29 05:41:00 +01:00
|
|
|
|
2010-12-11 00:05:05 +01:00
|
|
|
|
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}\""
|