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-01-07 11:30:14 +01:00
|
|
|
SRCDIR=`pwd`
|
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
|
|
|
|
2008-12-30 07:44:04 +01:00
|
|
|
if test -d ${PKG_DIR}; then
|
|
|
|
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 ----"
|
|
|
|
mkdir -v ${PKG_DIR}
|
|
|
|
mkdir -v ${PKG_DIR}/Contents
|
|
|
|
mkdir -v ${PKG_DIR}/Contents/MacOS
|
|
|
|
mkdir -v ${PKG_DIR}/Contents/Resources
|
2009-01-01 06:59:41 +01:00
|
|
|
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
|
2008-12-31 09:32:43 +01:00
|
|
|
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 ----"
|
2009-01-01 06:59:41 +01:00
|
|
|
find ${SKEL_DIR} -type f -not -regex ".*.svn.*"
|
|
|
|
cp ${SKEL_DIR}/Contents/Resources/*.icns ${PKG_DIR}/Contents/Resources
|
2009-02-16 02:57:19 +01:00
|
|
|
cp ${SKEL_DIR}/Contents/Resources/etc/fonts/fonts.dtd ${PKG_DIR}/Contents/Resources/etc/fonts
|
|
|
|
cat ${SKEL_DIR}/Contents/Resources/etc/fonts/fonts.conf |sed -f scripts/osx-bundle.sed > ${PKG_DIR}/Contents/Resources/etc/fonts/fonts.conf
|
2009-01-01 06:59:41 +01:00
|
|
|
cp ${SKEL_DIR}/Contents/Resources/etc/fonts/conf.d/*.conf ${PKG_DIR}/Contents/Resources/etc/fonts/conf.d
|
2008-12-31 06:52:52 +01:00
|
|
|
cat ${SKEL_DIR}/Contents/Info.plist |sed -f scripts/osx-bundle.sed > ${PKG_DIR}/Contents/Info.plist
|
2008-12-29 02:13:55 +01:00
|
|
|
|
2009-01-07 11:30:14 +01:00
|
|
|
echo
|
|
|
|
echo "---- Copying automation/ files ----"
|
|
|
|
cd automation
|
|
|
|
make install \
|
|
|
|
aegisubdatadir=../${PKG_DIR}/Contents/SharedSupport \
|
|
|
|
aegisubdocdir=../${PKG_DIR}/Contents/SharedSupport/doc
|
|
|
|
cd ${SRCDIR}
|
|
|
|
|
|
|
|
|
2009-01-04 11:04:32 +01:00
|
|
|
echo
|
|
|
|
echo "---- Copying 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.
|
|
|
|
mkdir -v ${PKG_DIR}/Contents/Resources/en.lproj
|
|
|
|
|
2009-01-04 11:04:32 +01:00
|
|
|
for i in `cat po/LINGUAS`; do
|
|
|
|
if test -f "po/${i}.gmo"; then
|
|
|
|
mkdir -v ${PKG_DIR}/Contents/Resources/${i}.lproj;
|
2009-01-04 11:53:54 +01:00
|
|
|
cp -v po/${i}.gmo ${PKG_DIR}/Contents/Resources/${i}.lproj/aegisub.mo;
|
2009-01-04 11:04:32 +01:00
|
|
|
else
|
|
|
|
echo "${i}.gmo not found!"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2008-12-29 05:41:00 +01:00
|
|
|
echo
|
|
|
|
echo "---- Binaries ----"
|
2009-01-07 09:48:33 +01:00
|
|
|
cp -v aegisub/.libs/aegisub-${AEGISUB_VERSION_DATA} ${PKG_DIR}/Contents/MacOS/aegisub
|
2009-01-12 23:54:58 +01:00
|
|
|
echo cc -o ${PKG_DIR}/Contents/MacOS/restart-helper scripts/osx-bundle-restart-helper.c
|
|
|
|
${CC} -o ${PKG_DIR}/Contents/MacOS/restart-helper scripts/osx-bundle-restart-helper.c
|
2008-12-29 05:41:00 +01:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "---- Libraries ----"
|
2009-01-05 13:16:35 +01:00
|
|
|
python scripts/osx-fix-libs.py "${PKG_DIR}/Contents/MacOS/Aegisub"
|
2008-12-29 05:41:00 +01:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Done Creating ${PKG_DIR}"
|