Create mimetype for mmp,mmpz
Using Info.plist, register the mmp and mmpz mimetypes with the LMMS application.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#notes :Troubleshooting try: export DYLD_PRINT_LIBRARIES=1
|
||||
#requires :deploymacqt
|
||||
#=========================================================================================
|
||||
|
||||
|
||||
# MacPorts Location
|
||||
MACPORTS=/opt/local
|
||||
|
||||
@@ -18,24 +18,24 @@ CMAKE_SRC=$HOME/lmms
|
||||
|
||||
# LMMS compiled resources
|
||||
CMAKE_INSTALL=$CMAKE_SRC/target
|
||||
|
||||
|
||||
# LMMS source build directory
|
||||
CMAKE_BUILD=$CMAKE_SRC/build
|
||||
|
||||
|
||||
# STK rawwaves directory
|
||||
STK_RAWWAVE=$HOME/stk-*/rawwaves
|
||||
|
||||
|
||||
|
||||
|
||||
# Place to create ".app" bundle
|
||||
APP=$HOME/Desktop/LMMS.app
|
||||
|
||||
|
||||
# MacPorts installs libreadline with wrong permissions
|
||||
LIBREADLINE=$MACPORTS/lib/libreadline.6.2.dylib
|
||||
|
||||
|
||||
#=========================================================================================
|
||||
|
||||
|
||||
echo -e "\n\nRunning..."
|
||||
|
||||
|
||||
# Check for u+w permissions on libreadline
|
||||
_perm=`stat -f "%p" $LIBREADLINE`
|
||||
_perm=${_perm:3:1}
|
||||
@@ -48,29 +48,29 @@ then
|
||||
echo -e "\nPLEASE ENTER SUDO PASSWORD:"
|
||||
sudo chmod u+w $MACPORTS/lib/libreadline.6.2.dylib
|
||||
fi
|
||||
|
||||
|
||||
# Remove any old .app bundles
|
||||
rm -Rf $APP
|
||||
|
||||
|
||||
# Create new bundle, copy our built code to it
|
||||
mkdir -p $APP
|
||||
cd $CMAKE_INSTALL
|
||||
mkdir $APP/Contents
|
||||
cp -R * $APP/Contents
|
||||
|
||||
|
||||
# Manually copy STK rawwaves
|
||||
mkdir -p $APP/Contents/share/stk/rawwaves
|
||||
cp $STK_RAWWAVE/*.raw $APP/Contents/share/stk/rawwaves
|
||||
|
||||
|
||||
# Make all libraries writable for macdeployqt
|
||||
cd $APP
|
||||
find . -type f -print0 | xargs -0 chmod u+w
|
||||
|
||||
|
||||
# Move lmms binary to the proper location
|
||||
mkdir -p $APP/Contents/MacOS
|
||||
mv $APP/Contents/bin/lmms $APP/Contents/MacOS
|
||||
rm -rf $APP/Contents/bin
|
||||
|
||||
|
||||
# Move libraries to proper locations
|
||||
mkdir -p $APP/Contents/Frameworks
|
||||
mv $APP/Contents/lib/lmms/libZynAddSubFxCore.dylib \
|
||||
@@ -78,25 +78,25 @@ mv $APP/Contents/lib/lmms/libZynAddSubFxCore.dylib \
|
||||
|
||||
mv $APP/Contents/lib/lmms/RemoteZynAddSubFx \
|
||||
$APP/Contents/MacOS/RemoteZynAddSubFx
|
||||
|
||||
|
||||
# Fix more Zyn Linking issues
|
||||
# install_name_tool -change $CMAKE_INSTALL/lib/lmms/libZynAddSubFxCore.dylib \
|
||||
# @loader_path/../../Frameworks/libZynAddSubFxCore.dylib \
|
||||
# $APP/Contents/lib/lmms/libzynaddsubfx.so
|
||||
|
||||
|
||||
install_name_tool -change libZynAddSubFxCore.dylib \
|
||||
@loader_path/../../Frameworks/libZynAddSubFxCore.dylib \
|
||||
$APP/Contents/lib/lmms/libzynaddsubfx.so
|
||||
|
||||
|
||||
install_name_tool -change $CMAKE_BUILD/plugins/zynaddsubfx/libZynAddSubFxCore.dylib \
|
||||
@loader_path/../../Frameworks/libZynAddSubFxCore.dylib \
|
||||
$APP/Contents/MacOS/RemoteZynAddSubFx
|
||||
|
||||
|
||||
# Build a list of shared objects in target/lib/lmms
|
||||
for file in $APP/Contents/lib/lmms/*.so; do
|
||||
_executables="$_executables -executable=$APP/Contents/lib/lmms/${file##*/}"
|
||||
done
|
||||
|
||||
|
||||
# Build a list of shared objects in target/lib/lmms/ladspa
|
||||
for file in $APP/Contents/lib/lmms/ladspa/*.so; do
|
||||
_executables="$_executables -executable=$APP/Contents/lib/lmms/ladspa/${file##*/}"
|
||||
@@ -105,24 +105,57 @@ done
|
||||
# Additional binaries that require linking
|
||||
_executables="$_executables -executable=$APP/Contents/MacOS/RemoteZynAddSubFx"
|
||||
_executables="$_executables -executable=$APP/Contents/Frameworks/libZynAddSubFxCore.dylib"
|
||||
|
||||
|
||||
# Build our App Package using "macdeployqt"
|
||||
macdeployqt $APP $_executables
|
||||
|
||||
|
||||
# OS X Specific Artwork
|
||||
cp $CMAKE_SRC/data/lmms.icns $APP/Contents/Resources/
|
||||
|
||||
|
||||
# Create "Info.plist" using lmms.icns file, http://iconverticons.com/online/)
|
||||
echo -e "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > "$APP/Contents/Info.plist"
|
||||
echo -e "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\"" >> "$APP/Contents/Info.plist"
|
||||
echo -e "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <plist version=\"1.0\">" >> "$APP/Contents/Info.plist"
|
||||
echo -e "<plist version=\"1.0\">" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <dict>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <key>CFBundleIconFile</key>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <string>lmms.icns</string>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " </dict>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <dict>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <key>CFBundleTypeExtensions</key>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <array>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <string>mmpz</string>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " </array>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <key>CFBundleTypeIconFile</key>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <string>project.icns</string>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <key>CFBundleTypeMIMETypes</key>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <array>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <string>application/x-lmms-project</string>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " </array>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <key>CFBundleTypeName</key>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <string>LMMS Project</string>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <key>CFBundleTypeRole</key>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <string>Editor</string>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <key>LSIsAppleDefaultForType</key> <true/>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " </dict>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <dict>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <key>CFBundleTypeExtensions</key>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <array>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <string>mmp</string>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " </array>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <key>CFBundleTypeIconFile</key>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <string>project.icns</string>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <key>CFBundleTypeMIMETypes</key>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <array>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <string>application/x-lmms-project</string>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " </array>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <key>CFBundleTypeName</key>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <string>LMMS Project</string>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <key>CFBundleTypeRole</key>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " <string>Editor</string>" >> "$APP/Contents/Info.plist"
|
||||
echo -e " </dict>" >> "$APP/Contents/Info.plist"
|
||||
echo -e "</plist>" >> "$APP/Contents/Info.plist"
|
||||
|
||||
|
||||
# Done. Ready to build DMG
|
||||
echo -e "\nFinished.\n\nPlease run \"create_apple_dmg.sh\" from the Desktop to build the installer.\n"
|
||||
echo -e "Note: You can drag/drop it into this terminal window.)\n"
|
||||
|
||||
Reference in New Issue
Block a user