Skip to content

Instantly share code, notes, and snippets.

@tresf
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tresf/9868817 to your computer and use it in GitHub Desktop.
Save tresf/9868817 to your computer and use it in GitHub Desktop.
create_apple_installer_old.sh
#!/bin/bash
# LMMS OSX Bundling Script
# Author: Tres Finocchiaro 2014-03-28
# Help Articles:
# https://github.com/LMMS/lmms/issues/509
# http://blog.inventic.eu/2012/08/how-to-deploy-qt-application-on-macos-part-ii/
# https://qt-project.org/doc/qt-5.0/qtdoc/deployment-mac.html#creating-the-application-package
# First, please follow the OSX Build instructions at github.com/lmms in the Wiki section
# RUNFIRST: Fix some MacPorts issues:
# 1. Prevent macdeployqt from copying libreadline as r-x
# sudo chmod u+w /opt/local/lib/libreadline.6.2.dylib
#
MACPORTS=/opt/local
CMAKE_INSTALL=$HOME/lmms/target
APP=$HOME/Desktop/LMMS.app
DMG=$HOME/Desktop/LMMS.dmg
# Remove and recreate bundle
rm -Rf $APP
mkdir -p $APP
cd $CMAKE_INSTALL
mkdir $APP/Contents
cp -R * $APP/Contents
cd $APP
# Make all libraries writable for macdeployqt
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
rmdir $APP/Contents/bin
# Create some temporary symlinks (fixes libZynAddSubFxCore.dylib)
ln -sf $CMAKE_INSTALL/lib/lmms $CMAKE_INSTALL/lib/lib
ln -sf $CMAKE_INSTALL/../build/plugins/zynaddsubfx $CMAKE_INSTALL/../build/plugins/lib
# Build our App Package
macdeployqt $APP \
-executable=$APP/Contents/lib/lmms/libamplifier.so \
-executable=$APP/Contents/lib/lmms/libaudiofileprocessor.so \
-executable=$APP/Contents/lib/lmms/libamplifier.so \
-executable=$APP/Contents/lib/lmms/libaudiofileprocessor.so \
-executable=$APP/Contents/lib/lmms/libbassbooster.so \
-executable=$APP/Contents/lib/lmms/libbitinvader.so \
-executable=$APP/Contents/lib/lmms/libdualfilter.so \
-executable=$APP/Contents/lib/lmms/libdynamicsprocessor.so \
-executable=$APP/Contents/lib/lmms/libflpimport.so \
-executable=$APP/Contents/lib/lmms/libhydrogenimport.so \
-executable=$APP/Contents/lib/lmms/libkicker.so \
-executable=$APP/Contents/lib/lmms/libladspabrowser.so \
-executable=$APP/Contents/lib/lmms/libladspaeffect.so \
-executable=$APP/Contents/lib/lmms/liblb302.so \
-executable=$APP/Contents/lib/lmms/libmidiimport.so \
-executable=$APP/Contents/lib/lmms/liborganic.so \
-executable=$APP/Contents/lib/lmms/libpapu.so \
-executable=$APP/Contents/lib/lmms/libpatman.so \
-executable=$APP/Contents/lib/lmms/libpeakcontrollereffect.so \
-executable=$APP/Contents/lib/lmms/libsf2player.so \
-executable=$APP/Contents/lib/lmms/libsfxr.so \
-executable=$APP/Contents/lib/lmms/libsid.so \
-executable=$APP/Contents/lib/lmms/libspectrumanalyzer.so \
-executable=$APP/Contents/lib/lmms/libstereoenhancer.so \
-executable=$APP/Contents/lib/lmms/libstereomatrix.so \
-executable=$APP/Contents/lib/lmms/libtripleoscillator.so \
-executable=$APP/Contents/lib/lmms/libvibedstrings.so \
-executable=$APP/Contents/lib/lmms/libwaveshaper.so \
-executable=$APP/Contents/lib/lmms/libzynaddsubfx.so \
-executable=$APP/Contents/lib/lmms/ladspa/calf.so \
-executable=$APP/Contents/lib/lmms/ladspa/caps.so \
-executable=$APP/Contents/lib/lmms/ladspa/cmt.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_autopan.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_chorusflanger.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_deesser.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_doubler.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_dynamics_m.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_dynamics_st.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_echo.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_eq.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_eqbw.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_limiter.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_pinknoise.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_pitch.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_reflector.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_reverb.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_rotspeak.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_sigmoid.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_tremolo.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_tubewarmth.so \
-executable=$APP/Contents/lib/lmms/ladspa/tap_vibrato.so \
-executable=$APP/Contents/lib/lmms/RemoteZynAddSubFx
# Remove temporary symlinks (fixes libZynAddSubFxCore.dylib)
rm $CMAKE_INSTALL/lib/lib
rm $CMAKE_INSTALL/../build/plugins/lib
# OS X Specific Artwork
cp $HOME/lmms/data/lmms.icns $APP/Contents/Resources/
# mkdir $APP/.background
# cp $HOME/lmms/data/dmg_branding.png $APP/.background/dmg_branding.png
# Create Info.plist
echo -e "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" >> "$APP/Contents/Info.plist"
echo -e "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"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 "<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 "</plist>" >> "$APP/Contents/Info.plist"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment