From 6fa43334990ab9b2a4cacfc323f50fbe3c4fbaca Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 21 Aug 2020 21:58:12 +0200 Subject: [PATCH] (macOS) Several updates to the .dmg package generator setup. --- .gitignore | 1 + CMakeLists.txt | 8 ++- es-app/CMakeLists.txt | 51 +++++++++++++----- ...nStation.icns => EmulationStation-DE.icns} | Bin ..._DS_Store => EmulationStation-DE_DS_Store} | Bin 6148 -> 6148 bytes es-app/assets/EmulationStation-DE_Info.plist | 34 ++++++++++++ 6 files changed, 81 insertions(+), 13 deletions(-) rename es-app/assets/{EmulationStation.icns => EmulationStation-DE.icns} (100%) rename es-app/assets/{EmulationStation_DS_Store => EmulationStation-DE_DS_Store} (92%) create mode 100644 es-app/assets/EmulationStation-DE_Info.plist diff --git a/.gitignore b/.gitignore index 00cfb8ae4..582de14f3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ # Compiled Dynamic libraries *.so +*.dylib # Windows Dynamic-link libraries *.[dD][lL][lL] diff --git a/CMakeLists.txt b/CMakeLists.txt index ca041dc54..d9d9c71f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -247,10 +247,16 @@ elseif(WIN32) "nanosvg") endif() -# Temporary solution until the VLC find module has been updated to work properly on macOS. if (APPLE) + # See es-app/CMakeLists.txt for an explation for why an extra 'Resources' directory + # has been added to the install prefix. + set(CMAKE_INSTALL_PREFIX "/Applications/EmulationStation-DE.app/Contents/Resources") + + # Temporary solution until the VLC find module has been updated to work properly on macOS. set(COMMON_LIBRARIES ${COMMON_LIBRARIES} "/Applications/VLC.app/Contents/MacOS/lib/libvlc.dylib") + set(CMAKE_INSTALL_RPATH @executable_path) +# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) endif() # Add libCEC libraries. diff --git a/es-app/CMakeLists.txt b/es-app/CMakeLists.txt index 0e8f9c906..3ab2dcea1 100644 --- a/es-app/CMakeLists.txt +++ b/es-app/CMakeLists.txt @@ -129,16 +129,40 @@ if(WIN32) install(DIRECTORY ${CMAKE_SOURCE_DIR}/themes DESTINATION .) install(DIRECTORY ${CMAKE_SOURCE_DIR}/resources DESTINATION .) elseif(APPLE) + # For completely unknown reasons, when generating a Bundle using cpack, an extra 'Resources' + # directory is added to the target path. Simply adding the two dots as a prefix fixes the + # problem, but doing so would break 'make install' which was actually behaving correctly. + # So an extra 'Resources' directory was added to the CMAKE_INSTALL_PREFIX variable as well + # to compensate for this. It's a bad solution to the problem and there must surely be a + # better way to fix this. install(TARGETS EmulationStation RUNTIME - DESTINATION EmulationStation.app/Contents/MacOS) + DESTINATION ../MacOS) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE.icns + DESTINATION ../Resources) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE_Info.plist + DESTINATION .. RENAME Info.plist) + install(FILES ${CMAKE_SOURCE_DIR}/libcurl.4.dylib + DESTINATION ../MacOS) + install(FILES ${CMAKE_SOURCE_DIR}/libfreeimage.dylib + DESTINATION ../MacOS) + install(FILES ${CMAKE_SOURCE_DIR}/libfreetype.6.dylib + DESTINATION ../MacOS) + install(FILES ${CMAKE_SOURCE_DIR}/libSDL2-2.0.0.dylib + DESTINATION ../MacOS) + install(FILES ${CMAKE_SOURCE_DIR}/libvlc.dylib + DESTINATION ../MacOS) + install(FILES ${CMAKE_SOURCE_DIR}/libvlccore.dylib + DESTINATION ../MacOS) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins + DESTINATION ../MacOS) install(FILES ${CMAKE_SOURCE_DIR}/LICENSE - DESTINATION EmulationStation.app/Contents/Resources) - install(DIRECTORY ${CMAKE_SOURCE_DIR}/resources - DESTINATION EmulationStation.app/Contents/Resources) - install(DIRECTORY ${CMAKE_SOURCE_DIR}/themes - DESTINATION EmulationStation.app/Contents/Resources) + DESTINATION ../Resources) +# install(DIRECTORY ${CMAKE_SOURCE_DIR}/resources +# DESTINATION ../Resources) +# install(DIRECTORY ${CMAKE_SOURCE_DIR}/themes +# DESTINATION ../Resources) install(DIRECTORY ${CMAKE_SOURCE_DIR}/licenses - DESTINATION EmulationStation.app/Contents/Resources) + DESTINATION ../Resources) else() install(TARGETS emulationstation RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) @@ -173,14 +197,17 @@ set(CPACK_PACKAGE_VERSION "1.0.0-beta") # Settings per operating system and generator type. if(APPLE) - set(CPACK_GENERATOR "DragNDrop") + set(CPACK_GENERATOR "Bundle") set(CPACK_PACKAGE_FILE_NAME "EmulationStation-DE-${CPACK_PACKAGE_VERSION}") - set(CPACK_DMG_VOLUME_NAME "EmulationStation-DE ${CPACK_PACKAGE_VERSION}") - set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation.icns") - set(CPACK_DMG_DS_STORE "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation_DS_Store") + set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE.icns") + set(CPACK_DMG_VOLUME_NAME "EmulationStation Desktop Edition ${CPACK_PACKAGE_VERSION}") + set(CPACK_DMG_DS_STORE "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE_DS_Store") + set(CPACK_BUNDLE_NAME "EmulationStation-DE") + set(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE.icns") + set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE_Info.plist") elseif(WIN32) set(CPACK_GENERATOR "NSIS") - set(CPACK_PACKAGE_FILE_NAME "EmulationStation-DE-${CPACK_PACKAGE_VERSION}-win64") + set(CPACK_PACKAGE_FILE_NAME "EmulationStation-DE-${CPACK_PACKAGE_VERSION}") set(CPACK_PACKAGE_INSTALL_DIRECTORY "EmulationStation") set(CPACK_PACKAGE_EXECUTABLES "EmulationStation" "EmulationStation") set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") diff --git a/es-app/assets/EmulationStation.icns b/es-app/assets/EmulationStation-DE.icns similarity index 100% rename from es-app/assets/EmulationStation.icns rename to es-app/assets/EmulationStation-DE.icns diff --git a/es-app/assets/EmulationStation_DS_Store b/es-app/assets/EmulationStation-DE_DS_Store similarity index 92% rename from es-app/assets/EmulationStation_DS_Store rename to es-app/assets/EmulationStation-DE_DS_Store index 6b891340d741cd5194d54cf970b3291324246b67..3a109eec2076bfa8bdd526ff03ca6a77ea3842dc 100644 GIT binary patch delta 216 zcmZoMXffDe#w5gK$H2g_Gc(ic?En8j76XI$H+ z`AI-o0U-Vc#2_8#kae(vbxhvCB*vz57-ozjiZQwQE-ophCCLm7w^Kr8fNG$Yp{q*4 hs!9gMtbz=~;N<+=0+1ohS{F7qGUu^uX6N|J4*+#9G%^4H delta 189 zcmZoMXffDe#w5h}pMim41B0%v`hO6Mfk9+)471|od?ryLMrj~-BTz~WSxQ=uA(5eg zp&%#SFgQ6sw*aJv=@+9SOe;)2H{Zo2rL-iOf#G)2p4}i-5Tg + + + + CFBundleIdentifier + EmulationStation-DE + CFBundleDevelopmentRegion + English + CFBundleDisplayName + EmulationStation Desktop Edition + CFBundleExecutable + EmulationStation + CFBundleGetInfoString + EmulationStation Desktop Edition 1.0.0 + CFBundleIconFile + EmulationStation-DE.icns + CFBundleName + EmulationStation Desktop Edition + CFBundlePackageType + APPL + CFBundleVersion + 1.0.0-beta + NSHighResolutionCapable + true + NSPrincipalClass + NSApplication + NSMainNibFile + EmulationStation + NSHumanReadableCopyright + Original work Copyright (c) 2014 Alec Lofquist +Modified work Copyright (c) 2020 Leon Styhre +Licensed under the MIT license + +