Skip to content

Commit

Permalink
Spaces -> Tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
tresf committed May 14, 2024
1 parent a6c12ae commit 6770ce4
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 94 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ ENDIF(WANT_DEBUG_FPE)

if(WANT_DEBUG_CPACK)
if(LMMS_BUILD_WIN32 OR WANT_CPACK_TARBALL)
set(STATUS_DEBUG_CPACK "Wanted but disabled due to unsupported configuration")
set(STATUS_DEBUG_CPACK "Wanted but disabled due to unsupported configuration")
else()
set(CPACK_DEBUG TRUE)
set(STATUS_DEBUG_CPACK "Enabled")
Expand Down
88 changes: 44 additions & 44 deletions cmake/apple/CPackDMG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ set(COMMAND_ECHO NONE)

# Detect release|debug build
if(NOT CPACK_STRIP_FILES_ORIG)
# -use-debug-libs implies -no-strip
if(CPACK_QMAKE_EXECUTABLE MATCHES "/homebrew/|/usr/local")
message(STATUS "Homebrew does not provide debug qt libraries, replacing \"-use-debug-libs\" with \"-no-strip\" instead")
set(USE_DEBUG_LIBS -no-strip)
else()
set(USE_DEBUG_LIBS -use-debug-libs)
endif()
# -use-debug-libs implies -no-strip
if(CPACK_QMAKE_EXECUTABLE MATCHES "/homebrew/|/usr/local")
message(STATUS "Homebrew does not provide debug qt libraries, replacing \"-use-debug-libs\" with \"-no-strip\" instead")
set(USE_DEBUG_LIBS -no-strip)
else()
set(USE_DEBUG_LIBS -use-debug-libs)
endif()
endif()

if(CPACK_DEBUG)
set(VERBOSITY 3)
set(COMMAND_ECHO STDOUT)
set(VERBOSITY 3)
set(COMMAND_ECHO STDOUT)
endif()

execute_process(COMMAND convert
"${CPACK_CURRENT_SOURCE_DIR}/*.png"
"${CPACK_CURRENT_BINARY_DIR}/background.tiff"
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
"${CPACK_CURRENT_SOURCE_DIR}/*.png"
"${CPACK_CURRENT_BINARY_DIR}/background.tiff"
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)

# Copy missing files
file(COPY "${CPACK_CURRENT_SOURCE_DIR}/project.icns" DESTINATION "${APP}/Contents/Resources")
Expand All @@ -45,9 +45,9 @@ file(MAKE_DIRECTORY "${APP}/Contents/Resources")

# Make all libraries writable for macdeployqt
file(CHMOD_RECURSE "${APP}/Contents" PERMISSIONS
OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_WRITE GROUP_READ
WORLD_READ)
OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_WRITE GROUP_READ
WORLD_READ)

# Fix layout
file(RENAME "${APP}/Contents/Resources/lib" "${APP}/Contents/lib")
Expand All @@ -63,17 +63,17 @@ file(REMOVE_RECURSE "${APP}/Contents/include")

# Replace @rpath with @loader_path for Carla
execute_process(COMMAND install_name_tool -change
"@rpath/libcarlabase.dylib"
"@loader_path/libcarlabase.dylib"
"${APP}/Contents/lib/lmms/libcarlapatchbay.so"
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
"@rpath/libcarlabase.dylib"
"@loader_path/libcarlabase.dylib"
"${APP}/Contents/lib/lmms/libcarlapatchbay.so"
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
execute_process(COMMAND install_name_tool -change
"@rpath/libcarlabase.dylib"
"@loader_path/libcarlabase.dylib"
"${APP}/Contents/lib/lmms/libcarlarack.so"
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
"@rpath/libcarlabase.dylib"
"@loader_path/libcarlabase.dylib"
"${APP}/Contents/lib/lmms/libcarlarack.so"
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)

# Build list of executables to inform macdeployqt about
# e.g. -executable=foo.dylib -executable=bar.dylib
Expand All @@ -85,36 +85,36 @@ list(SORT LIBS)

# Construct macdeployqt parameters
foreach(_LIB IN LISTS LIBS)
list(APPEND EXECUTABLES "-executable=${_LIB}")
list(APPEND EXECUTABLES "-executable=${_LIB}")
endforeach()

# Call macdeployqt
get_filename_component(QTBIN "${CPACK_QMAKE_EXECUTABLE}" DIRECTORY)
message(STATUS "Calling ${QTBIN}/macdeployqt ${APP} [... executables]")
execute_process(COMMAND "${QTBIN}/macdeployqt" "${APP}" ${EXECUTABLES}
-verbose=${VERBOSITY}
${USE_DEBUG_LIBS}
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
-verbose=${VERBOSITY}
${USE_DEBUG_LIBS}
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)

# Remove dummy carla libs, relink to a sane location (e.g. /Applications/Carla.app/...)
# (must be done after calling macdeployqt)
file(GLOB CARLALIBS "${APP}/Contents/lib/lmms/libcarla*")
foreach(_CARLALIB IN LISTS CARLALIBS)
foreach(_LIB "${CPACK_CARLA_LIBRARIES}")
set(_OLDPATH "../../Frameworks/lib${_LIB}.dylib")
set(_NEWPATH "Carla.app/Contents/MacOS/lib${_LIB}.dylib")
execute_process(COMMAND install_name_tool -change
"@loader_path/${_OLDPATH}"
"@executable_path/../../../${_NEWPATH}"
"${_CARLALIB}"
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
file(REMOVE "${APP}/Contents/Frameworks/lib${_LIB}.dylib")
endforeach()
foreach(_LIB "${CPACK_CARLA_LIBRARIES}")
set(_OLDPATH "../../Frameworks/lib${_LIB}.dylib")
set(_NEWPATH "Carla.app/Contents/MacOS/lib${_LIB}.dylib")
execute_process(COMMAND install_name_tool -change
"@loader_path/${_OLDPATH}"
"@executable_path/../../../${_NEWPATH}"
"${_CARLALIB}"
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
file(REMOVE "${APP}/Contents/Frameworks/lib${_LIB}.dylib")
endforeach()
endforeach()

# Call ad-hoc codesign manually (CMake offers this as well)
execute_process(COMMAND codesign --force --deep --sign - "${APP}"
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
10 changes: 5 additions & 5 deletions cmake/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ install(FILES lmms.xml DESTINATION "${DATA_DIR}/mime/packages")

# Preserve old CPack behavior
if(WANT_CPACK_TARBALL)
message(STATUS "Skipping AppImage creation")
return()
message(STATUS "Skipping AppImage creation")
return()
endif()

# Copy rawwaves into bundle
Expand Down Expand Up @@ -37,11 +37,11 @@ set(CPACK_CMAKE_COMMAND "${CMAKE_COMMAND}" PARENT_SCOPE)

# TODO: Canidate for DetectMachine.cmake
if(IS_X86_64)
set(CPACK_TARGET_ARCH x86_64 PARENT_SCOPE)
set(CPACK_TARGET_ARCH x86_64 PARENT_SCOPE)
elseif(IS_ARM64)
set(CPACK_TARGET_ARCH arm64 PARENT_SCOPE)
set(CPACK_TARGET_ARCH arm64 PARENT_SCOPE)
else()
set(CPACK_TARGET_ARCH unknown PARENT_SCOPE)
set(CPACK_TARGET_ARCH unknown PARENT_SCOPE)
endif()

set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_CURRENT_SOURCE_DIR}/CPackAppImage.cmake" PARENT_SCOPE)
80 changes: 40 additions & 40 deletions cmake/linux/CPackAppImage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ if(NOT CPACK_STRIP_FILES)
endif()

if(CPACK_DEBUG)
set(VERBOSITY 3)
set(COMMAND_ECHO STDOUT)
set(VERBOSITY 3)
set(COMMAND_ECHO STDOUT)
endif()

set(LINUXDEPLOYQT_URL "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/")
Expand All @@ -28,7 +28,7 @@ message(STATUS "Creating AppDir ${APP}...")

# Offer symlink support via "cmake -E create_symlink"
macro(install_symlink filepath sympath)
execute_process(COMMAND ${CPACK_CMAKE_COMMAND} -E create_symlink "${filepath}" "${sympath}" COMMAND_ECHO ${COMMAND_ECHO})
execute_process(COMMAND ${CPACK_CMAKE_COMMAND} -E create_symlink "${filepath}" "${sympath}" COMMAND_ECHO ${COMMAND_ECHO})
endmacro()

file(REMOVE_RECURSE "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/include")
Expand Down Expand Up @@ -60,31 +60,31 @@ if(NOT LINUXDEPLOYQT_BIN OR NOT APPIMAGETOOL_BIN)
"${LINUXDEPLOYQT_URL}"
"${LINUXDEPLOYQT_APPIMAGE}"
STATUS DOWNLOAD_STATUS)
# Check if download was successful.
list(GET DOWNLOAD_STATUS 0 STATUS_CODE)
list(GET DOWNLOAD_STATUS 1 ERROR_MESSAGE)
if(NOT ${STATUS_CODE} EQUAL 0)
file(REMOVE "${LINUXDEPLOYQT_APPIMAGE}")
# Check if download was successful.
list(GET DOWNLOAD_STATUS 0 STATUS_CODE)
list(GET DOWNLOAD_STATUS 1 ERROR_MESSAGE)
if(NOT ${STATUS_CODE} EQUAL 0)
file(REMOVE "${LINUXDEPLOYQT_APPIMAGE}")
message(FATAL_ERROR "Error downloading ${LINUXDEPLOYQT_URL} ${ERROR_MESSAGE}")
endif()
endif()

# Ensure the file is executable
file(CHMOD "${LINUXDEPLOYQT_APPIMAGE}" PERMISSIONS
OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_WRITE GROUP_READ)
# Extract linuxdeployqt to a predictable location ("bash -c" avoids syntax errors)
execute_process(COMMAND bash -c "\"${LINUXDEPLOYQT_APPIMAGE}\" --appimage-extract"
WORKING_DIRECTORY "${CPACK_CURRENT_BINARY_DIR}"
COMMAND_ECHO ${COMMAND_ECHO}
RESULT_VARIABLE STATUS_CODE)
# Check if execution was successful
GROUP_EXECUTE GROUP_WRITE GROUP_READ)
# Extract linuxdeployqt to a predictable location ("bash -c" avoids syntax errors)
execute_process(COMMAND bash -c "\"${LINUXDEPLOYQT_APPIMAGE}\" --appimage-extract"
WORKING_DIRECTORY "${CPACK_CURRENT_BINARY_DIR}"
COMMAND_ECHO ${COMMAND_ECHO}
RESULT_VARIABLE STATUS_CODE)
# Check if execution was successful
if(NOT ${STATUS_CODE} EQUAL 0)
file(REMOVE "${LINUXDEPLOYQT_APPIMAGE}")
message(FATAL_ERROR "Error code ${STATUS_CODE} executing ${LINUXDEPLOYQT_APPIMAGE}")
endif()

find_program(LINUXDEPLOYQT_BIN linuxdeployqt REQUIRED)
find_program(APPIMAGETOOL_BIN appimagetool REQUIRED)
find_program(LINUXDEPLOYQT_BIN linuxdeployqt REQUIRED)
find_program(APPIMAGETOOL_BIN appimagetool REQUIRED)
endif()

# Create a wrapper script which calls the lmms executable
Expand All @@ -110,31 +110,31 @@ set(ENV{LD_LIBRARY_PATH} "${APP}/usr/lib/${LMMS}/:${APP}/usr/lib/${LMMS}/optiona
# Handle wine linking
if(IS_DIRECTORY "${CPACK_WINE_32_LIBRARY_DIR}")
execute_process(COMMAND ldd "${BIN_VST32}"
OUTPUT_VARIABLE LDD_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
string(replace "\n" ";" LDD_LIST "${LDD_OUTPUT}")
foreach(line ${LDD_LIST})
if(line MATCHES "libwine.so" AND line MATCHES "not found")
set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${CPACK_WINE_32_LIBRARY_DIR}")
continue()
endif()
endforeach()
OUTPUT_VARIABLE LDD_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
string(replace "\n" ";" LDD_LIST "${LDD_OUTPUT}")
foreach(line ${LDD_LIST})
if(line MATCHES "libwine.so" AND line MATCHES "not found")
set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${CPACK_WINE_32_LIBRARY_DIR}")
continue()
endif()
endforeach()
endif()
if(IS_DIRECTORY "${CPACK_WINE_64_LIBRARY_DIR}")
execute_process(COMMAND ldd "${BIN_VST64}"
OUTPUT_VARIABLE LDD_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
string(replace "\n" ";" LDD_LIST "${LDD_OUTPUT}")
foreach(line ${LDD_LIST})
if(line MATCHES "libwine.so" AND line MATCHES "not found")
set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${CPACK_WINE_64_LIBRARY_DIR}")
continue()
endif()
endforeach()
OUTPUT_VARIABLE LDD_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
string(replace "\n" ";" LDD_LIST "${LDD_OUTPUT}")
foreach(line ${LDD_LIST})
if(line MATCHES "libwine.so" AND line MATCHES "not found")
set(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${CPACK_WINE_64_LIBRARY_DIR}")
continue()
endif()
endforeach()
endif()

# Patch desktop file
Expand Down
8 changes: 4 additions & 4 deletions cmake/modules/BashCompletion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ set(BASHCOMP_USER_PATH "share/bash-completion/completions")
macro(BASHCOMP_INSTALL SCRIPT_NAME)
# Note: When running from CPack, message(...) will be supressed unless WARNING
if(WIN32)
message(STATUS "Bash completion is not supported on this platform.")
elseif(APPLE)
message(STATUS "Bash completion is not yet implemented for this platform.")
else()
message(STATUS "Bash completion is not supported on this platform.")
elseif(APPLE)
message(STATUS "Bash completion is not yet implemented for this platform.")
else()
install(FILES "${SCRIPT_NAME}" DESTINATION "${BASHCOMP_USER_PATH}")
if(BASHCOMP_PKG_PATH)
# TODO: CMake 3.21 Use "file(COPY_FILE ...)"
Expand Down

0 comments on commit 6770ce4

Please sign in to comment.