Cleanup root directory

Cleans up the root directory of the GitHub source tree and starts to separate platform-specific installing and packaging logic from the master CMakeLists.txt.  Closes #2201
This commit is contained in:
Tres Finocchiaro
2015-07-25 11:35:30 -04:00
parent 9819900aca
commit 3114ccea26
39 changed files with 193 additions and 307 deletions

View File

@@ -5,20 +5,3 @@ ADD_SUBDIRECTORY(projects)
ADD_SUBDIRECTORY(samples)
ADD_SUBDIRECTORY(themes)
ADD_SUBDIRECTORY(wavetables)
ADD_SUBDIRECTORY(scripts)
IF(LMMS_BUILD_LINUX)
INSTALL(FILES themes/default/icon.png DESTINATION "${DATA_DIR}/pixmaps" RENAME lmms.png)
INSTALL(FILES lmms DESTINATION "${DATA_DIR}/menu")
INSTALL(FILES lmms.desktop DESTINATION "${DATA_DIR}/applications")
INSTALL(FILES lmms.xml DESTINATION "${DATA_DIR}/mime/packages")
ENDIF(LMMS_BUILD_LINUX)
IF(LMMS_BUILD_WIN32)
FILE(GLOB RAWWAVES "${CMAKE_INSTALL_PREFIX}/share/stk/rawwaves/*.raw")
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)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -1,4 +0,0 @@
?package(lmms):needs="X11" section="Apps/Sound" \
title="LMMS" hints="Audio" command="/usr/bin/lmms" \
longtitle="LMMS" \
icon="/usr/share/pixmaps/lmms.png"

View File

@@ -1,13 +0,0 @@
[Desktop Entry]
Name=LMMS
GenericName=music production suite
GenericName[ca]=Programari de producció musical
GenericName[de]=Software zur Musik-Produktion
Comment=easy music production for everyone!
Comment[ca]=Producció fàcil de música per a tothom!
Icon=lmms
Exec=env QT_X11_NO_NATIVE_MENUBAR=1 lmms
Terminal=false
Type=Application
Categories=Qt;AudioVideo;Audio;Midi;
MimeType=application/x-lmms-project;

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

View File

@@ -1,147 +0,0 @@
<?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>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIconFile</key>
<string>@MACOSX_BUNDLE_ICON_FILE@</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ @MACOSX_BUNDLE_LONG_VERSION_STRING@</string>
<!--
#############################################################
# Apple Creator Code Registered Application Signatures #
#############################################################
# Company: LMMS Foundation #
# Registrant: tres.finocchiaro@gmail.com #
# ASCII Code: LMMS #
# HEX: 4C4D4D53 #
#############################################################
# Contact Apple Developer Support at cfreg@apple.com #
# with any requested changes #
#############################################################
-->
<key>CFBundleSignature</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@</string>
<key>CFBundleExecutable</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@</string>
<key>CFBundleVersion</key>
<string>@MACOSX_BUNDLE_LONG_VERSION_STRING@</string>
<key>CFBundleShortVersionString</key>
<string>@MACOSX_BUNDLE_LONG_VERSION_STRING@</string>
<key>CFBundleName</key>
<string>@MACOSX_BUNDLE_BUNDLE_NAME@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleIdentifier</key>
<string>@MACOSX_BUNDLE_MIMETYPE_ID@</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mmpz</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>@MACOSX_BUNDLE_MIMETYPE_ICON@</string>
<key>CFBundleTypeName</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ Project</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>mmpz</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>@MACOSX_BUNDLE_MIMETYPE@</string>
</array>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mmp</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>@MACOSX_BUNDLE_MIMETYPE_ICON@</string>
<key>CFBundleTypeName</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ Project (uncompressed)</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>mmp</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>@MACOSX_BUNDLE_MIMETYPE@</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>@MACOSX_BUNDLE_MIMETYPE_ID@.mmpz</string>
<key>UTTypeReferenceURL</key>
<string>@MACOSX_BUNDLE_PROJECT_URL@</string>
<key>UTTypeDescription</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ Project</string>
<key>UTTypeIconFile</key>
<string>@MACOSX_BUNDLE_MIMETYPE_ICON@</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>mmpz</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeIdentifier</key>
<string>@MACOSX_BUNDLE_MIMETYPE_ID@.mmp</string>
<key>UTTypeReferenceURL</key>
<string>@MACOSX_BUNDLE_PROJECT_URL@</string>
<key>UTTypeDescription</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ Project (uncompressed)</string>
<key>UTTypeIconFile</key>
<string>@MACOSX_BUNDLE_MIMETYPE_ICON@</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.xml</string>
<string>public.data</string>
</array>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>mmp</string>
</array>
</dict>
</dict>
</array>
</dict>
</plist>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-lmms-project">
<sub-class-of type="application/xml"/>
<comment>LMMS project</comment>
<comment xml:lang="ca">Projecte LMMS</comment>
<glob pattern="*.mmp"/>
<glob pattern="*.mmpz"/>
<magic priority="80">
<match type="string" value="&lt;!DOCTYPE multimedia-project" offset="0:256"/>
<match type="string" value="&lt;multimedia-project" offset="0:64"/>
</magic>
</mime-type>
</mime-info>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

View File

@@ -1,13 +0,0 @@
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

@@ -1,121 +0,0 @@
#!/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

@@ -1,140 +0,0 @@
#!/bin/bash
# by Andy Maloney
# http://asmaloney.com/2013/07/howto/packaging-a-mac-os-x-application-using-a-dmg/
# make sure we are in the correct dir when we double-click a .command file
dir=${0%/*}
if [ -d "$dir" ]; then
cd "$dir"
fi
# set up your app name, version number, and background image file name
APP_NAME="@MACOSX_BUNDLE_BUNDLE_NAME@"
VERSION="@MACOSX_BUNDLE_LONG_VERSION_STRING@"
DMG_BACKGROUND_IMG="dmg_branding.png"
cp "@CMAKE_SOURCE_DIR@/data/${DMG_BACKGROUND_IMG}" .
# you should not need to change these
OS_VER=`sw_vers -productVersion|cut -d"." -f1-2`
APP_LOWERCASE=$(echo $APP_NAME|tr '[:upper:]' '[:lower:]')
APP_EXE="${APP_NAME}.app/Contents/MacOS/${APP_LOWERCASE}"
VOL_NAME="${APP_LOWERCASE}-${VERSION}-mac${OS_VER}" # volume name will be "SuperCoolApp 1.0.0"
DMG_TMP="${VOL_NAME}-temp.dmg"
DMG_FINAL="${VOL_NAME}.dmg" # final DMG name will be "SuperCoolApp 1.0.0.dmg"
STAGING_DIR="./Install" # we copy all our stuff into this dir
# Check the background image DPI and convert it if it isn't 72x72
_BACKGROUND_IMAGE_DPI_H=`sips -g dpiHeight ${DMG_BACKGROUND_IMG} | grep -Eo '[0-9]+\.[0-9]+'`
_BACKGROUND_IMAGE_DPI_W=`sips -g dpiWidth ${DMG_BACKGROUND_IMG} | grep -Eo '[0-9]+\.[0-9]+'`
if [ $(echo " $_BACKGROUND_IMAGE_DPI_H != 72.0 " | bc) -eq 1 -o $(echo " $_BACKGROUND_IMAGE_DPI_W != 72.0 " | bc) -eq 1 ]; then
echo "WARNING: The background image's DPI is not 72. This will result in distorted backgrounds on Mac OS X 10.7+."
echo " I will convert it to 72 DPI for you."
_DMG_BACKGROUND_TMP="${DMG_BACKGROUND_IMG%.*}"_dpifix."${DMG_BACKGROUND_IMG##*.}"
sips -s dpiWidth 72 -s dpiHeight 72 ${DMG_BACKGROUND_IMG} --out ${_DMG_BACKGROUND_TMP}
DMG_BACKGROUND_IMG="${_DMG_BACKGROUND_TMP}"
fi
# clear out any old data
rm -rf "${STAGING_DIR}" "${DMG_TMP}" "${DMG_FINAL}"
# copy over the stuff we want in the final disk image to our staging dir
mkdir -p "${STAGING_DIR}"
cp -rpf "${APP_NAME}.app" "${STAGING_DIR}"
# ... cp anything else you want in the DMG - documentation, etc.
pushd "${STAGING_DIR}"
# strip the executable
echo "Stripping ${APP_EXE}..."
strip -u -r "${APP_EXE}"
# compress the executable if we have upx in PATH
# UPX: http://upx.sourceforge.net/
if hash upx 2>/dev/null; then
echo "Compressing (UPX) ${APP_EXE}..."
upx -9 "${APP_EXE}"
fi
# ... perform any other stripping/compressing of libs and executables
popd
# figure out how big our DMG needs to be
# assumes our contents are at least 1M!
SIZE=`du -sh "${STAGING_DIR}" | sed 's/\([0-9\.]*\)M\(.*\)/\1/'`
SIZE=`echo "${SIZE} + 5.0" | bc | awk '{print int($1+0.5)}'`
if [ $? -ne 0 ]; then
echo "Error: Cannot compute size of staging dir"
exit
fi
# create the temp DMG file
hdiutil create -srcfolder "${STAGING_DIR}" -volname "${VOL_NAME}" -fs HFS+ \
-fsargs "-c c=64,a=16,e=16" -format UDRW -size ${SIZE}M "${DMG_TMP}"
echo "Created DMG: ${DMG_TMP}"
# mount it and save the device
DEVICE=$(hdiutil attach -readwrite -noverify "${DMG_TMP}" | \
egrep '^/dev/' | sed 1q | awk '{print $1}')
sleep 2
# add a link to the Applications dir
echo "Add link to /Applications"
pushd /Volumes/"${VOL_NAME}"
ln -s /Applications
popd
# add a background image
mkdir /Volumes/"${VOL_NAME}"/.background
cp "${DMG_BACKGROUND_IMG}" /Volumes/"${VOL_NAME}"/.background/
# tell the Finder to resize the window, set the background,
# change the icon size, place the icons in the right position, etc.
echo '
tell application "Finder"
tell disk "'${VOL_NAME}'"
open
set current view of container window to icon view
set toolbar visible of container window to false
set statusbar visible of container window to false
set the bounds of container window to {400, 100, 920, 440}
set viewOptions to the icon view options of container window
set arrangement of viewOptions to not arranged
set icon size of viewOptions to 72
set background picture of viewOptions to file ".background:'${DMG_BACKGROUND_IMG}'"
set position of item "'${APP_NAME}'.app" of container window to {160, 205}
set position of item "Applications" of container window to {360, 205}
close
open
update without registering applications
delay 2
end tell
end tell
' | osascript
sync
# unmount it
hdiutil detach "${DEVICE}"
# now make the final image a compressed disk image
echo "Creating compressed image"
hdiutil convert "${DMG_TMP}" -format UDZO -imagekey zlib-level=9 -o "${DMG_FINAL}"
# clean up
rm -rf "${DMG_TMP}"
rm -rf "${STAGING_DIR}"
rm -rf "${DMG_BACKGROUND_IMG}"
echo 'Done.'
exit