Merge pull request #685 from tresf/stable-1.0

SWH Clang Fixes, Apple Installer Fixes
This commit is contained in:
Tobias Doerffel
2014-05-06 09:39:22 +02:00
13 changed files with 217 additions and 148 deletions

View File

@@ -47,7 +47,6 @@ OPTION(WANT_WINMM "Include WinMM MIDI support" OFF)
IF(LMMS_BUILD_APPLE)
SET(WANT_ALSA OFF)
SET(WANT_PULSEAUDIO OFF)
SET(WANT_SWH OFF)
SET(WANT_VST OFF)
SET(STATUS_ALSA "<not supported on this platform>")
SET(STATUS_PULSEAUDIO "<not supported on this platform>")
@@ -388,7 +387,15 @@ ELSE(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DPIC")
ENDIF(WIN32)
# set up apple vars before traversing into data/scripts
SET(MACOSX_BUNDLE_ICON_FILE "lmms.icns")
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "LMMS")
SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${VERSION}")
SET(MACOSX_BUNDLE_BUNDLE_NAME "LMMS")
SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}")
SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}")
SET(MACOSX_BUNDLE_COPYRIGHT "Tobias Doerffel, 2008-2010")
SET(MACOSX_BUNDLE_MIMETYPE "application/x-lmms-project")
# make sub-directories
ADD_SUBDIRECTORY(plugins)
@@ -656,14 +663,6 @@ IF(WIN64)
InstallDir \\\"\\\$PROGRAMFILES64\\\\${CPACK_PACKAGE_INSTALL_DIRECTORY}\\\"")
ENDIF(WIN64)
SET(MACOSX_BUNDLE_ICON_FILE "${CMAKE_SOURCE_DIR}/data/themes/default/icon.png")
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "LMMS")
SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${VERSION}")
SET(MACOSX_BUNDLE_BUNDLE_NAME "LMMS")
SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}")
SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}")
SET(MACOSX_BUNDLE_COPYRIGHT "Tobias Doerffel, 2008-2010")
SET(CPACK_SOURCE_GENERATOR "TBZ2")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "lmms-${VERSION}")
INCLUDE(CPack)

View File

@@ -4,6 +4,7 @@ ADD_SUBDIRECTORY(presets)
ADD_SUBDIRECTORY(projects)
ADD_SUBDIRECTORY(samples)
ADD_SUBDIRECTORY(themes)
ADD_SUBDIRECTORY(scripts)
IF(LMMS_BUILD_LINUX)
INSTALL(FILES themes/default/icon.png DESTINATION "${DATA_DIR}/pixmaps" RENAME lmms.png)
@@ -17,3 +18,6 @@ IF(LMMS_BUILD_WIN32)
INSTALL(FILES ${RAWWAVES} DESTINATION "${DATA_DIR}/stk/rawwaves")
ENDIF(LMMS_BUILD_WIN32)
IF(LMMS_BUILD_APPLE)
CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/data/lmms.plist.in" "${CMAKE_INSTALL_PREFIX}/Info.plist")
ENDIF(LMMS_BUILD_APPLE)

48
data/lmms.plist.in Normal file
View File

@@ -0,0 +1,48 @@
<!-- Apple Application Bundle Info.plist -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@</string>
<key>CFBundleGetInfoString</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ @MACOSX_BUNDLE_LONG_VERSION_STRING@</string>
<key>CFBundleIdentifier</key>
<string>net.sourceforge.lmms</string>
<key>CFBundleIconFile</key>
<string>@MACOSX_BUNDLE_ICON_FILE@</string>
<key>CFBundleName</key>
<string>@MACOSX_BUNDLE_BUNDLE_NAME@</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleVersion</key>
<string>@MACOSX_BUNDLE_LONG_VERSION_STRING@</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFile</key>
<string>project.icns</string>
<key>CFBundleTypeName</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ Project</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSIsAppleDefaultForType</key>
<true/>
<key>LSItemContentTypes</key>
<array>
<string>public.mmp</string>
<string>public.mmpz</string>
</array>
<key>CFBundleTypeExtensions</key>
<array>
<string>mmp</string>
<string>mmpz</string>
</array>
</dict>
</array>
</dict>
</plist>

BIN
data/project.icns Normal file

Binary file not shown.

View File

@@ -0,0 +1,13 @@
SET(BUILD_ROOT "${CMAKE_CURRENT_BINARY_DIR}/../../")
IF(LMMS_BUILD_APPLE)
CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/data/scripts/create_apple_bundle.sh.in"
"${BUILD_ROOT}/create_apple_bundle.sh" @ONLY)
CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/data/scripts/create_apple_dmg.sh.in"
"${BUILD_ROOT}/create_apple_dmg.sh" @ONLY)
# Add execute permissions to bundle script
SET(CHMOD_CMD "chmod")
SET(CHMOD_ARG1 "u+x")
SET(CHMOD_ARG2 "${BUILD_ROOT}/create_apple_bundle.sh")
EXECUTE_PROCESS(COMMAND ${CHMOD_CMD} ${CHMOD_ARG1} ${CHMOD_ARG2})
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${BUILD_ROOT}/create_apple_bundle.sh)")
ENDIF(LMMS_BUILD_APPLE)

View File

@@ -0,0 +1,121 @@
#!/bin/bash
#title :create_applet_installer.sh
#description :Creates Apple ".app" bundle for LMMS
#author :Tres Finocchiaro
#date :20140504
#version :1.1
#usage :bash create_applet_installer.sh
#notes :See also https://github.com/LMMS
#notes :Troubleshooting try: export DYLD_PRINT_LIBRARIES=1; export VERBOSE=1;
#requires :deploymacqt
#=========================================================================================
# MacPorts Location
MACPORTS=/opt/local
# LMMS project root directory (extracted source)
CMAKE_SRC=@CMAKE_SOURCE_DIR@
# LMMS compiled (install) resources
CMAKE_INSTALL=@CMAKE_INSTALL_PREFIX@
# LMMS working build directory
CMAKE_BUILD=$(cd @CMAKE_CURRENT_BINARY_DIR@/../..; pwd)
# 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
# The DMG packager script location
DMG_SCRIPT_SRC=${CMAKE_BUILD}/create_apple_dmg.sh
DMG_SCRIPT_DST=${HOME}/Desktop/create_apple_dmg.sh
#=========================================================================================
MSG_COLOR='\x1B[1;36m'
COLOR_RESET='\x1B[0m'
echo -e "${MSG_COLOR}\n\nCreating App Bundle \"${APP}\"...${COLOR_RESET}"
# Check for u+w permissions on libreadline
CHECKREADLINE=$(stat -f "%p" $LIBREADLINE)
CHECKREADLINE=${CHECKREADLINE:3:1}
if [ "${CHECKREADLINE}" != "7" ]
then
echo -e "\n\n\t\t\t\t***********\n\t\t\t\t* WARNING *\n\t\t\t\t***********"
echo -e "File ${LIBREADLINE} is not marked as user writable."
echo -e "This will break macdeployqt's linking process after it is copied."
echo -e "A sudo password is required to elevate and fix using chmod u+w."
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 \
${APP}/Contents/Frameworks/libZynAddSubFxCore.dylib
mv ${APP}/Contents/lib/lmms/RemoteZynAddSubFx \
${APP}/Contents/MacOS/RemoteZynAddSubFx
# Fix more Zyn Linking issues
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##*/}"
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/*.icns ${APP}/Contents/Resources/
# Done. Ready to build DMG
echo -e "\nFinished.\n\nYou may run LMMS from the Desktop."
echo -e "\nTo create an Apple DMG Package run ${MSG_COLOR}\"${DMG_SCRIPT_DST}\"${COLOR_RESET}.\n"
echo -e "(Note: You can drag/drop the script directly into this terminal window.)\n"
cp ${DMG_SCRIPT_SRC} ${DMG_SCRIPT_DST}
chmod +x ${DMG_SCRIPT_DST}

View File

@@ -10,10 +10,10 @@ if [ -d "$dir" ]; then
fi
# set up your app name, version number, and background image file name
APP_NAME="LMMS"
VERSION="1.0.0"
APP_NAME="@MACOSX_BUNDLE_BUNDLE_NAME@"
VERSION="@MACOSX_BUNDLE_LONG_VERSION_STRING@"
DMG_BACKGROUND_IMG="dmg_branding.png"
cp $HOME/lmms/data/$DMG_BACKGROUND_IMG .
cp "@CMAKE_SOURCE_DIR@/data/${DMG_BACKGROUND_IMG}" .
# you should not need to change these
APP_LOWERCASE=$(echo $APP_NAME|tr '[:upper:]' '[:lower:]')

View File

@@ -1,130 +0,0 @@
#!/bin/bash
#title :create_applet_installer.sh
#description :Creates Apple ".app" bundle for LMMS
#author :Tres Finocchiaro
#date :20140331
#version :1.0
#usage :bash create_applet_installer.sh
#notes :See also https://github.com/LMMS
#notes :Troubleshooting try: export DYLD_PRINT_LIBRARIES=1
#requires :deploymacqt
#=========================================================================================
# MacPorts Location
MACPORTS=/opt/local
# LMMS source directory
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}
if [ ${_perm} != "7" ]
then
echo -e "\n\n\t\t\t\t***********\n\t\t\t\t* WARNING *\n\t\t\t\t***********"
echo -e "File $LIBREADLINE is not marked as user writable."
echo -e "This will break macdeployqt's linking process after it is copied."
echo -e "A sudo password is required to elevate and fix using chmod u+w."
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
rmdir $APP/Contents/bin
# Move libraries to proper locations
mkdir -p $APP/Contents/Frameworks
mv $APP/Contents/lib/lmms/libZynAddSubFxCore.dylib \
$APP/Contents/Frameworks/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##*/}"
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 " <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"
# 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"
cp $CMAKE_SRC/data/scripts/create_apple_dmg.sh $HOME/Desktop/
chmod +x $HOME/Desktop/create_apple_dmg.sh

View File

@@ -99,8 +99,10 @@ inline void impulse2freq(int id, float *imp, unsigned int length, fftw_real *out
for (i=0; i<length; i++) {
impulse_time[i] = imp[i];
}
for (; i<fftl; i++) {
impulse_time[i] = 0.0f;
int last = i;
for (i = 0; i<fftl; i++) {
if (i >=last) impulse_time[i] = 0.0f;
}
#ifdef FFTW3
fftwf_execute(tmp_plan);

View File

@@ -24,7 +24,11 @@
#include "impulses/20-matchless-chieftain-sm57.h"
#include "impulses/21-matchless-chieftain-sm57-off.h"
#ifdef __clang__
void mk_imps(fftw_real **impulse_freq)
#else
inline void mk_imps(fftw_real **impulse_freq)
#endif
{
int c = 0;
MK_IMP(unit);

View File

@@ -33,7 +33,11 @@ void _init(); // forward declaration
inline int partition(LADSPA_Data array[], int left, int right);
#ifdef __clang__
void q_sort(LADSPA_Data array[], int left, int right) {
#else
inline void q_sort(LADSPA_Data array[], int left, int right) {
#endif
float pivot = partition(array, left, right);
if (left < pivot) {

View File

@@ -115,7 +115,8 @@ inline void waveguide_nl_process(waveguide_nl *wg, float in0, float in1, float *
b = (*out0 + 1.0) * 6.0f;
if (b > 1.0f) {
b = 1.0f;
} else if (b < 0.0f) {
}
if (b < 0.0f) {
b = 0.0f;
}
a1 = b * wg->a1a + (1.0f - b) * wg->a1b;
@@ -129,7 +130,8 @@ inline void waveguide_nl_process(waveguide_nl *wg, float in0, float in1, float *
b = (*out1 + 1.0) * 6.0f;
if (b > 1.0f) {
b = 1.0f;
} else if (b < 0.0f) {
}
if (b < 0.0f) {
b = 0.0f;
}
a1 = b * wg->a1a + (1.0f - b) * wg->a1b;

View File

@@ -344,8 +344,10 @@ void configManager::loadConfigFile()
if( m_ladDir.isEmpty() || m_ladDir == QDir::separator() ||
( !m_ladDir.contains( ':' ) && !QDir( m_ladDir ).exists() ) )
{
#ifdef LMMS_BUILD_WIN32
#if defined(LMMS_BUILD_WIN32)
m_ladDir = m_pluginDir + "ladspa" + QDir::separator();
#elif defined(LMMS_BUILD_APPLE)
m_ladDir = qApp->applicationDirPath() + "/../lib/lmms/ladspa/";
#else
m_ladDir = qApp->applicationDirPath() + '/' + LIB_DIR + "/ladspa/";
#endif