Linux packaging stuff.

This commit is contained in:
Andrew Okin 2013-02-12 10:14:23 -06:00
parent b66be337fd
commit 5a4b2ad000
3 changed files with 70 additions and 11 deletions

View File

@ -175,31 +175,76 @@ add_executable(MultiMC ${MULTIMC_SOURCES} ${MULTIMC_HEADERS} ${MULTIMC_UI} ${MUL
qt5_use_modules(MultiMC Widgets Network) qt5_use_modules(MultiMC Widgets Network)
target_link_libraries(MultiMC quazip patchlib ${MultiMC_LINK_ADDITIONAL_LIBS}) target_link_libraries(MultiMC quazip patchlib ${MultiMC_LINK_ADDITIONAL_LIBS})
add_dependencies(MultiMC MultiMCLauncher) add_dependencies(MultiMC MultiMCLauncher)
install(TARGETS MultiMC RUNTIME DESTINATION .)
IF (WIN32) IF (WIN32)
install(TARGETS MultiMC RUNTIME DESTINATION .)
ELSE()
install(TARGETS MultiMC RUNTIME DESTINATION bin)
ENDIF()
# Extra libs and files to package.
# Image format plugins.
SET(IMAGE_FORMAT_PLUGINS svg ico gif jpeg)
IF(WIN32)
# Windows
IF(CMAKE_BUILD_TYPE STREQUAL "Debug") IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
SET(D "d") SET(D "d")
ELSE() ELSE()
SET(D "") SET(D "")
ENDIF() ENDIF()
install(FILES "${Qt5_DIR}/plugins/platforms/qwindows${D}.dll" DESTINATION platforms) # Install platform plugins.
install(FILES "${Qt5_DIR}/plugins/platforms/qminimal${D}.dll" DESTINATION platforms) SET(PLATFORM_PLUGINS windows minimal)
install(FILES "${Qt5_DIR}/bin/libEGL${D}.dll" DESTINATION .) FOREACH(PLATFORM_PLUGIN ${PLATFORM_PLUGINS})
INSTALL(FILES "${Qt5_DIR}/plugins/platforms/q${PLATFORM_PLUGIN}${D}.dll" DESTINATION platforms)
ENDFOREACH()
install(FILES "${Qt5_DIR}/plugins/imageformats/qsvg${D}.dll" DESTINATION imageformats) # Install image format plugins.
install(FILES "${Qt5_DIR}/plugins/imageformats/qico${D}.dll" DESTINATION imageformats) FOREACH(IMGFMT_PLUGIN ${IMAGE_FORMAT_PLUGINS})
install(FILES "${Qt5_DIR}/plugins/imageformats/qgif${D}.dll" DESTINATION imageformats) INSTALL(FILES "${Qt5_DIR}/plugins/imageformats/q${IMGFMT_PLUGIN}${D}.dll" DESTINATION imageformats)
install(FILES "${Qt5_DIR}/plugins/imageformats/qjpeg${D}.dll" DESTINATION imageformats) ENDFOREACH()
# Additional libs
INSTALL(FILES "${Qt5_DIR}/bin/libEGL${D}.dll" DESTINATION .)
ELSEIF(UNIX) ELSEIF(UNIX)
IF (APPLE) IF (APPLE)
# OS X
# TODO: OS X packaging support
ELSE() ELSE()
install(FILES "${Qt5_DIR}/plugins/platforms/libqlinuxfb.so" DESTINATION platforms) # Linux
install(FILES "${Qt5_DIR}/plugins/platforms/libqminimal.so" DESTINATION platforms)
install(FILES "${Qt5_DIR}/plugins/platforms/libqxcb.so" DESTINATION platforms) # Install platform plugins.
SET(PLATFORM_PLUGINS linuxfb xcb minimal)
FOREACH(PLATFORM_PLUGIN ${PLATFORM_PLUGINS})
INSTALL(FILES "${Qt5_DIR}/plugins/platforms/libq${PLATFORM_PLUGIN}.so" DESTINATION platforms)
ENDFOREACH()
# Install image format plugins.
FOREACH(IMGFMT_PLUGIN ${IMAGE_FORMAT_PLUGINS})
INSTALL(FILES "${Qt5_DIR}/plugins/imageformats/libq${IMGFMT_PLUGIN}.so" DESTINATION imageformats)
ENDFOREACH()
# Install ICU libs.
SET(ICU_LIBS data i18n io le lx test tu uc)
FOREACH(ICU_LIB ${ICU_LIBS})
INSTALL(FILES "/usr/lib/libicu${ICU_LIB}.so.48.1.1" DESTINATION lib)
ENDFOREACH()
# Install additional libs.
INSTALL(FILES "${Qt5_DIR}/lib/libQt5DBus.so.5.0.1" DESTINATION lib RENAME libQt5DBus.so.5)
# Install the start script.
INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/package/linux/MultiMC" DESTINATION .)
ENDIF() ENDIF()
ENDIF() ENDIF()

View File

@ -4,6 +4,12 @@ message(STATUS "Running install script...")
SET(Qt5_DIR @Qt5_DIR@) SET(Qt5_DIR @Qt5_DIR@)
IF(WIN32)
SET(LIB_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
ELSE()
SET(LIB_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/lib)
ENDIF()
INCLUDE(GetPrerequisites) INCLUDE(GetPrerequisites)
GET_PREREQUISITES(@BINARY_LOCATION@ MULTIMC_PREREQS 1 1 "" "") GET_PREREQUISITES(@BINARY_LOCATION@ MULTIMC_PREREQS 1 1 "" "")
@ -19,7 +25,7 @@ FOREACH(PREREQ ${MULTIMC_PREREQS})
message(STATUS "Adding install prerequisite: ${PREREQ_NAME}") message(STATUS "Adding install prerequisite: ${PREREQ_NAME}")
FILE(INSTALL FILE(INSTALL
DESTINATION "${CMAKE_INSTALL_PREFIX}" DESTINATION "${LIB_INSTALL_PREFIX}"
TYPE PROGRAM TYPE PROGRAM
RENAME "${PREREQ_NAME}" RENAME "${PREREQ_NAME}"
FILES "${PREREQ_ACTUAL}" FILES "${PREREQ_ACTUAL}"

8
package/linux/MultiMC Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
# Basic start script for running MultiMC with the libs packaged with it.
MMC_DIR = $(dirname "$0")
cd "${MMC_DIR}"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"./lib"
exec ./bin/MultiMC