2021-01-27 21:26:19 +00:00
|
|
|
project(launcher)
|
|
|
|
|
2021-06-17 21:32:24 +00:00
|
|
|
# Launcher
|
2024-02-08 02:15:48 +00:00
|
|
|
add_executable(launcher
|
2024-05-12 07:19:01 +00:00
|
|
|
src/bootstrap.cpp
|
2024-02-08 02:15:48 +00:00
|
|
|
src/patchelf.cpp
|
|
|
|
src/util.c
|
|
|
|
src/crash-report.c
|
2024-05-12 07:19:01 +00:00
|
|
|
src/sdk.cpp
|
|
|
|
src/mods.cpp
|
|
|
|
src/options/parser.cpp
|
|
|
|
src/main.cpp
|
2024-02-08 02:15:48 +00:00
|
|
|
)
|
2024-05-12 07:19:01 +00:00
|
|
|
if(NOT MCPI_SERVER_MODE)
|
2022-07-30 02:13:03 +00:00
|
|
|
embed_resource(launcher src/client/available-feature-flags)
|
2024-02-08 02:15:48 +00:00
|
|
|
target_sources(launcher PRIVATE
|
2024-05-12 07:19:01 +00:00
|
|
|
src/client/configuration.cpp
|
2024-02-08 02:15:48 +00:00
|
|
|
src/client/cache.cpp
|
|
|
|
src/client/available-feature-flags # Show In IDE
|
|
|
|
)
|
2021-06-17 21:32:24 +00:00
|
|
|
endif()
|
2024-06-08 20:30:39 +00:00
|
|
|
target_link_libraries(launcher reborn-util LIB_LIEF trampoline-headers)
|
2022-07-02 22:14:23 +00:00
|
|
|
# RPath
|
|
|
|
set_target_properties(launcher PROPERTIES INSTALL_RPATH "$ORIGIN/lib/native")
|
2024-05-12 07:19:01 +00:00
|
|
|
target_link_options(launcher PRIVATE "LINKER:--disable-new-dtags")
|
2022-06-10 01:31:40 +00:00
|
|
|
|
|
|
|
# Install
|
|
|
|
install(TARGETS launcher DESTINATION "${MCPI_INSTALL_DIR}")
|
|
|
|
install_symlink("../${MCPI_INSTALL_DIR}/launcher" "bin/${MCPI_VARIANT_NAME}")
|
|
|
|
|
|
|
|
# Install Desktop Entry
|
|
|
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/launcher.desktop"
|
|
|
|
"[Desktop Entry]\n"
|
|
|
|
"Name=${MCPI_APP_TITLE}\n"
|
|
|
|
"Comment=Fun with Blocks\n"
|
|
|
|
"Icon=${MCPI_APP_ID}\n"
|
|
|
|
"Exec=${MCPI_VARIANT_NAME}\n"
|
|
|
|
"Type=Application\n"
|
|
|
|
"Categories=Game;\n"
|
|
|
|
)
|
2022-06-10 03:23:37 +00:00
|
|
|
if(MCPI_HEADLESS_MODE)
|
2022-06-10 01:31:40 +00:00
|
|
|
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/launcher.desktop"
|
|
|
|
"Terminal=true\n"
|
|
|
|
"NoDisplay=true\n"
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/launcher.desktop"
|
|
|
|
"Terminal=false\n"
|
|
|
|
"StartupNotify=false\n"
|
2022-07-30 02:13:03 +00:00
|
|
|
"StartupWMClass=${MCPI_APP_ID}\n"
|
2022-06-10 01:31:40 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
install(
|
|
|
|
FILES "${CMAKE_CURRENT_BINARY_DIR}/launcher.desktop"
|
2022-07-07 04:37:53 +00:00
|
|
|
DESTINATION "${MCPI_SHARE_DIR}/applications"
|
2022-06-10 01:31:40 +00:00
|
|
|
RENAME "${MCPI_APP_ID}.desktop"
|
|
|
|
)
|
|
|
|
|
|
|
|
# Install AppStream Metadata
|
|
|
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/appstream.xml"
|
|
|
|
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
|
|
|
"<component type=\"desktop\">\n"
|
|
|
|
" <id>${MCPI_APP_ID}</id>\n"
|
|
|
|
" <name>${MCPI_APP_TITLE}</name>\n"
|
|
|
|
" <metadata_license>CC0-1.0</metadata_license>\n"
|
|
|
|
" <summary>Fun with Blocks</summary>\n"
|
2022-06-10 03:23:37 +00:00
|
|
|
" <description>\n"
|
|
|
|
" <p>Minecraft: Pi Edition Modding Project.</p>\n"
|
|
|
|
" <p>NOTE: This is not verified by, affiliated with, or supported by Mojang or Microsoft.</p>\n"
|
|
|
|
" </description>\n"
|
2022-06-10 01:31:40 +00:00
|
|
|
" <url type=\"homepage\">https://gitea.thebrokenrail.com/TheBrokenRail/minecraft-pi-reborn</url>\n"
|
|
|
|
" <launchable type=\"desktop-id\">${MCPI_APP_ID}.desktop</launchable>\n"
|
|
|
|
" <provides>\n"
|
|
|
|
" <id>com.thebrokenrail.MCPIRebornClient.desktop</id>\n"
|
|
|
|
" </provides>\n"
|
|
|
|
" <project_license>LicenseRef-proprietary</project_license>\n"
|
|
|
|
" <developer_name>TheBrokenRail & Mojang AB</developer_name>\n"
|
|
|
|
" <content_rating type=\"oars-1.0\">\n"
|
|
|
|
" <content_attribute id=\"violence-cartoon\">moderate</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"violence-fantasy\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"violence-realistic\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"violence-bloodshed\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"violence-sexual\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"drugs-alcohol\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"drugs-narcotics\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"drugs-tobacco\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"sex-nudity\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"sex-themes\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"language-profanity\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"language-humor\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"language-discrimination\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"social-chat\">intense</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"social-info\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"social-audio\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"social-location\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"social-contacts\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"money-purchasing\">none</content_attribute>\n"
|
|
|
|
" <content_attribute id=\"money-gambling\">none</content_attribute>\n"
|
|
|
|
" </content_rating>\n"
|
|
|
|
" <releases>\n"
|
2022-06-11 03:49:15 +00:00
|
|
|
" <release version=\"${MCPI_VERSION}\" date=\"${MCPI_VERSION_DATE}\"></release>\n"
|
|
|
|
" </releases>\n"
|
2022-06-10 01:31:40 +00:00
|
|
|
)
|
2022-06-10 03:23:37 +00:00
|
|
|
if(NOT MCPI_HEADLESS_MODE)
|
2022-06-10 01:31:40 +00:00
|
|
|
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/appstream.xml"
|
|
|
|
" <screenshots>\n"
|
|
|
|
" <screenshot type=\"default\">\n"
|
|
|
|
" <image>https://gitea.thebrokenrail.com/TheBrokenRail/minecraft-pi-reborn/raw/branch/master/images/start.png</image>\n"
|
|
|
|
" </screenshot>\n"
|
|
|
|
" </screenshots>\n"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/appstream.xml"
|
|
|
|
"</component>\n"
|
|
|
|
)
|
|
|
|
install(
|
|
|
|
FILES "${CMAKE_CURRENT_BINARY_DIR}/appstream.xml"
|
2022-07-07 04:37:53 +00:00
|
|
|
DESTINATION "${MCPI_SHARE_DIR}/metainfo"
|
2022-06-10 01:31:40 +00:00
|
|
|
RENAME "${MCPI_APP_ID}.appdata.xml"
|
|
|
|
)
|
2022-07-04 20:44:00 +00:00
|
|
|
|
|
|
|
# AppImage
|
|
|
|
if(MCPI_IS_APPIMAGE_BUILD)
|
|
|
|
install_symlink("bin/${MCPI_VARIANT_NAME}" "AppRun")
|
2022-07-07 04:37:53 +00:00
|
|
|
install_symlink("${MCPI_SHARE_DIR}/applications/${MCPI_APP_ID}.desktop" "${MCPI_APP_ID}.desktop")
|
2022-07-04 20:44:00 +00:00
|
|
|
endif()
|