Compare commits
3 Commits
3d508d7609
...
e8faee62fa
Author | SHA1 | Date | |
---|---|---|---|
e8faee62fa | |||
a8ff58f0c4 | |||
daccf65361 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,5 +9,6 @@ appimage-builder-cache
|
||||
appimage-build
|
||||
AppDir
|
||||
*.zsync
|
||||
*.AppImage
|
||||
core*
|
||||
qemu_*
|
||||
|
@ -1,10 +1,18 @@
|
||||
cmake_minimum_required(VERSION 3.13.0)
|
||||
cmake_minimum_required(VERSION 3.16.0)
|
||||
|
||||
# Specify Options
|
||||
option(MCPI_IS_MIXED_BUILD "Whether The Architecture-Independent And ARM Code Are Different Architecture" FALSE)
|
||||
option(MCPI_BUNDLE_ARMHF_SYSROOT "Whether To Include An ARMHF Sysroot" ${MCPI_IS_MIXED_BUILD})
|
||||
set(MCPI_BUILD_MODE "both" CACHE STRING "\"arm\" = Build Only Code That Must Be ARM; \"native\" = Build Architecture-Independent Code; \"both\" = Build All Code As ARM")
|
||||
set_property(CACHE MCPI_BUILD_MODE PROPERTY STRINGS "both" "arm" "native")
|
||||
option(MCPI_OPEN_SOURCE_ONLY "Only Install Open-Source Code (Will Result In Broken Install)" FALSE)
|
||||
option(MCPI_IS_APPIMAGE_BUILD "AppImage Build" FALSE)
|
||||
# Server/Headless Builds
|
||||
option(MCPI_SERVER_MODE "Server Mode" FALSE)
|
||||
option(MCPI_HEADLESS_MODE "Headless Mode" ${MCPI_SERVER_MODE})
|
||||
# ARMHF Sysroot
|
||||
option(MCPI_BUNDLE_ARMHF_SYSROOT "Whether To Include An ARMHF Sysroot" ${MCPI_IS_MIXED_BUILD})
|
||||
set(MCPI_CUSTOM_BUNDLED_ARMHF_SYSROOT "" CACHE PATH "Custom Bundled ARMHF Sysroot")
|
||||
# Media Layer
|
||||
if(NOT MCPI_HEADLESS_MODE)
|
||||
option(MCPI_USE_MEDIA_LAYER_PROXY "Whether To Enable The Media Layer Proxy" ${MCPI_IS_MIXED_BUILD})
|
||||
option(MCPI_USE_GLES1_COMPATIBILITY_LAYER "Whether To Enable The GLESv1_CM Compatibility Layer" TRUE)
|
||||
@ -12,10 +20,22 @@ else()
|
||||
set(MCPI_USE_MEDIA_LAYER_PROXY FALSE)
|
||||
set(MCPI_USE_GLES1_COMPATIBILITY_LAYER FALSE)
|
||||
endif()
|
||||
set(MCPI_BUILD_MODE "both" CACHE STRING "\"arm\" = Build Only Code That Must Be ARM; \"native\" = Build Architecture-Independent Code; \"both\" = Build All Code As ARM")
|
||||
set_property(CACHE MCPI_BUILD_MODE PROPERTY STRINGS "both" "arm" "native")
|
||||
option(MCPI_OPEN_SOURCE_ONLY "Only Install Open-Source Code (Will Result In Broken Install)" FALSE)
|
||||
option(MCPI_IS_APPIMAGE_BUILD "AppImage Build" FALSE)
|
||||
# App ID
|
||||
set(DEFAULT_APP_ID "com.thebrokenrail.MCPIReborn")
|
||||
if(MCPI_SERVER_MODE)
|
||||
string(APPEND DEFAULT_APP_ID "Server")
|
||||
else()
|
||||
string(APPEND DEFAULT_APP_ID "Client")
|
||||
endif()
|
||||
set(MCPI_APP_ID "${DEFAULT_APP_ID}" CACHE STRING "App ID")
|
||||
# App Title
|
||||
set(DEFAULT_APP_TITLE "Minecraft: Pi Edition: Reborn")
|
||||
if(MCPI_SERVER_MODE)
|
||||
string(APPEND DEFAULT_APP_TITLE " (Server)")
|
||||
else()
|
||||
string(APPEND DEFAULT_APP_TITLE " (Client)")
|
||||
endif()
|
||||
set(MCPI_APP_TITLE "${DEFAULT_APP_TITLE}" CACHE STRING "App Title")
|
||||
|
||||
# Configure Build Mode
|
||||
if(MCPI_BUILD_MODE STREQUAL "arm")
|
||||
@ -40,9 +60,9 @@ include(cmake/util.cmake)
|
||||
# Specify Variant Name
|
||||
set(MCPI_VARIANT_NAME "minecraft-pi-reborn")
|
||||
if(MCPI_SERVER_MODE)
|
||||
set(MCPI_VARIANT_NAME "${MCPI_VARIANT_NAME}-server")
|
||||
string(APPEND MCPI_VARIANT_NAME "-server")
|
||||
else()
|
||||
set(MCPI_VARIANT_NAME "${MCPI_VARIANT_NAME}-client")
|
||||
string(APPEND MCPI_VARIANT_NAME "-client")
|
||||
endif()
|
||||
|
||||
# Specify Installation Paths
|
||||
@ -105,31 +125,14 @@ add_definitions(-D_GNU_SOURCE)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
# Specify Constants
|
||||
if(MCPI_SERVER_MODE)
|
||||
add_definitions(-DMCPI_SERVER_MODE)
|
||||
endif()
|
||||
if(MCPI_HEADLESS_MODE)
|
||||
add_definitions(-DMCPI_HEADLESS_MODE)
|
||||
endif()
|
||||
if(MCPI_IS_APPIMAGE_BUILD)
|
||||
add_definitions(-DMCPI_IS_APPIMAGE_BUILD)
|
||||
endif()
|
||||
if(MCPI_BUNDLE_ARMHF_SYSROOT)
|
||||
add_definitions(-DMCPI_BUNDLE_ARMHF_SYSROOT)
|
||||
endif()
|
||||
if(MCPI_USE_GLES1_COMPATIBILITY_LAYER)
|
||||
add_definitions(-DMCPI_USE_GLES1_COMPATIBILITY_LAYER)
|
||||
endif()
|
||||
|
||||
# Version
|
||||
set_property(
|
||||
DIRECTORY
|
||||
APPEND
|
||||
PROPERTY CMAKE_CONFIGURE_DEPENDS VERSION
|
||||
)
|
||||
file(STRINGS VERSION VERSION)
|
||||
add_definitions(-DVERSION="${VERSION}")
|
||||
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" MCPI_VERSION)
|
||||
file(TIMESTAMP "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" MCPI_VERSION_DATE "%Y-%m-%d" UTC)
|
||||
|
||||
# Build libreborn
|
||||
add_subdirectory(libreborn)
|
||||
|
3
dependencies/armhf-sysroot/CMakeLists.txt
vendored
3
dependencies/armhf-sysroot/CMakeLists.txt
vendored
@ -1,7 +1,6 @@
|
||||
project(armhf-sysroot)
|
||||
|
||||
# Allow Custom Sysroot
|
||||
set(MCPI_CUSTOM_BUNDLED_ARMHF_SYSROOT "" CACHE PATH "Custom Bundled ARMHF Sysroot")
|
||||
# Check If Using Custom Sysroot
|
||||
if(MCPI_CUSTOM_BUNDLED_ARMHF_SYSROOT)
|
||||
# Custom Sysroot
|
||||
set(SYSROOT_DIR "${MCPI_CUSTOM_BUNDLED_ARMHF_SYSROOT}")
|
||||
|
2
dependencies/glfw/src
vendored
2
dependencies/glfw/src
vendored
@ -1 +1 @@
|
||||
Subproject commit 62e175ef9fae75335575964c845a302447c012c7
|
||||
Subproject commit d3ede7b6847b66cf30b067214b2b4b126d4c729b
|
3
dependencies/minecraft-pi/CMakeLists.txt
vendored
3
dependencies/minecraft-pi/CMakeLists.txt
vendored
@ -14,7 +14,8 @@ FetchContent_Populate(minecraft-pi)
|
||||
# Install
|
||||
install(
|
||||
DIRECTORY "${minecraft-pi_SOURCE_DIR}/"
|
||||
DESTINATION "${MCPI_INSTALL_DIR}"
|
||||
DESTINATION "${MCPI_INSTALL_DIR}/game"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
REGEX "api" EXCLUDE
|
||||
)
|
||||
install_symlink("game/minecraft-pi" "${MCPI_INSTALL_DIR}/minecraft-pi")
|
||||
|
@ -8,3 +8,10 @@ if(NOT MCPI_SERVER_MODE)
|
||||
RENAME "titleBG.png"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Icon
|
||||
install(
|
||||
FILES "icon.png"
|
||||
DESTINATION "share/icons/hicolor/scalable/apps"
|
||||
RENAME "${MCPI_APP_ID}.png"
|
||||
)
|
||||
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 100 KiB |
@ -1,32 +1,110 @@
|
||||
project(launcher)
|
||||
|
||||
# Launcher
|
||||
if(BUILD_NATIVE_COMPONENTS)
|
||||
add_executable(launcher src/bootstrap.c src/patchelf.c src/crash-report.c)
|
||||
if(MCPI_SERVER_MODE)
|
||||
target_sources(launcher PRIVATE src/server/launcher.c)
|
||||
else()
|
||||
target_sources(launcher PRIVATE src/client/launcher.cpp)
|
||||
endif()
|
||||
target_link_libraries(launcher reborn-util)
|
||||
# Install
|
||||
install(TARGETS launcher DESTINATION "${MCPI_INSTALL_DIR}")
|
||||
install_symlink("../${MCPI_INSTALL_DIR}/launcher" "bin/${MCPI_VARIANT_NAME}")
|
||||
set(ICON_PATH "data/com.thebrokenrail.MCPIReborn.png")
|
||||
set(ICON_TARGET_PATH "share/icons/hicolor/scalable/apps")
|
||||
if(NOT MCPI_SERVER_MODE)
|
||||
install(DIRECTORY "data/client/" DESTINATION ".")
|
||||
install(
|
||||
FILES "${ICON_PATH}"
|
||||
DESTINATION "${ICON_TARGET_PATH}"
|
||||
RENAME "com.thebrokenrail.MCPIRebornClient.png"
|
||||
)
|
||||
else()
|
||||
install(DIRECTORY "data/server/" DESTINATION ".")
|
||||
install(
|
||||
FILES "${ICON_PATH}"
|
||||
DESTINATION "${ICON_TARGET_PATH}"
|
||||
RENAME "com.thebrokenrail.MCPIRebornServer.png"
|
||||
)
|
||||
endif()
|
||||
add_executable(launcher src/bootstrap.c src/patchelf.c src/crash-report.c)
|
||||
if(MCPI_SERVER_MODE)
|
||||
target_sources(launcher PRIVATE src/server/launcher.c)
|
||||
else()
|
||||
target_sources(launcher PRIVATE src/client/launcher.cpp)
|
||||
endif()
|
||||
target_link_libraries(launcher reborn-util)
|
||||
|
||||
# Install
|
||||
install(TARGETS launcher DESTINATION "${MCPI_INSTALL_DIR}")
|
||||
install_symlink("../${MCPI_INSTALL_DIR}/launcher" "bin/${MCPI_VARIANT_NAME}")
|
||||
|
||||
# Install Available Feature Flags List
|
||||
if(NOT MCPI_SERVER_MODE)
|
||||
install(FILES "src/client/available-feature-flags" DESTINATION "${MCPI_INSTALL_DIR}")
|
||||
endif()
|
||||
|
||||
# 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"
|
||||
)
|
||||
if(MCPI_HEADLESS_MODE)
|
||||
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"
|
||||
"StartupWMClass=${MCPI_APP_TITLE}\n"
|
||||
)
|
||||
endif()
|
||||
install(
|
||||
FILES "${CMAKE_CURRENT_BINARY_DIR}/launcher.desktop"
|
||||
DESTINATION "share/applications"
|
||||
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"
|
||||
" <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"
|
||||
" <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"
|
||||
" <release version=\"${MCPI_VERSION}\" date=\"${MCPI_VERSION_DATE}\">\n"
|
||||
" </release>\n"
|
||||
)
|
||||
if(NOT MCPI_HEADLESS_MODE)
|
||||
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"
|
||||
DESTINATION "share/metainfo"
|
||||
RENAME "${MCPI_APP_ID}.appdata.xml"
|
||||
)
|
||||
|
@ -1,10 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Name=Minecraft: Pi Edition: Reborn (Client)
|
||||
Comment=Fun with Blocks
|
||||
Icon=com.thebrokenrail.MCPIRebornClient
|
||||
StartupNotify=false
|
||||
StartupWMClass=Minecraft: Pi Edition: Reborn
|
||||
Exec=minecraft-pi-reborn-client
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Game;
|
@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>com.thebrokenrail.MCPIRebornClient</id>
|
||||
<name>Minecraft: Pi Edition: Reborn (Client)</name>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<summary>Fun with Blocks</summary>
|
||||
<description><p>Minecraft: Pi Edition Modding Project.</p><p>NOTE: This is not verified by, affiliated with, or supported by Mojang or Microsoft.</p></description>
|
||||
<url type="homepage">https://gitea.thebrokenrail.com/TheBrokenRail/minecraft-pi-reborn</url>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://gitea.thebrokenrail.com/TheBrokenRail/minecraft-pi-reborn/raw/branch/master/images/start.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<launchable type="desktop-id">com.thebrokenrail.MCPIRebornClient.desktop</launchable>
|
||||
<provides>
|
||||
<id>com.thebrokenrail.MCPIRebornClient.desktop</id>
|
||||
</provides>
|
||||
<project_license>LicenseRef-proprietary</project_license>
|
||||
<developer_name>TheBrokenRail & Mojang AB</developer_name>
|
||||
<content_rating type="oars-1.0">
|
||||
<content_attribute id="violence-cartoon">moderate</content_attribute>
|
||||
<content_attribute id="violence-fantasy">none</content_attribute>
|
||||
<content_attribute id="violence-realistic">none</content_attribute>
|
||||
<content_attribute id="violence-bloodshed">none</content_attribute>
|
||||
<content_attribute id="violence-sexual">none</content_attribute>
|
||||
<content_attribute id="drugs-alcohol">none</content_attribute>
|
||||
<content_attribute id="drugs-narcotics">none</content_attribute>
|
||||
<content_attribute id="drugs-tobacco">none</content_attribute>
|
||||
<content_attribute id="sex-nudity">none</content_attribute>
|
||||
<content_attribute id="sex-themes">none</content_attribute>
|
||||
<content_attribute id="language-profanity">none</content_attribute>
|
||||
<content_attribute id="language-humor">none</content_attribute>
|
||||
<content_attribute id="language-discrimination">none</content_attribute>
|
||||
<content_attribute id="social-chat">intense</content_attribute>
|
||||
<content_attribute id="social-info">none</content_attribute>
|
||||
<content_attribute id="social-audio">none</content_attribute>
|
||||
<content_attribute id="social-location">none</content_attribute>
|
||||
<content_attribute id="social-contacts">none</content_attribute>
|
||||
<content_attribute id="money-purchasing">none</content_attribute>
|
||||
<content_attribute id="money-gambling">none</content_attribute>
|
||||
</content_rating>
|
||||
</component>
|
||||
|
@ -1,9 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Name=Minecraft: Pi Edition: Reborn (Server)
|
||||
Comment=Fun with Blocks
|
||||
Icon=com.thebrokenrail.MCPIRebornServer
|
||||
Exec=minecraft-pi-reborn-server
|
||||
Terminal=true
|
||||
Type=Application
|
||||
Categories=Game;
|
||||
NoDisplay=true
|
@ -1,38 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>com.thebrokenrail.MCPIRebornServer</id>
|
||||
<name>Minecraft: Pi Edition: Reborn (Server)</name>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<summary>Fun with Blocks</summary>
|
||||
<description><p>Minecraft: Pi Edition Modding Project.</p><p>NOTE: This is not verified by, affiliated with, or supported by Mojang or Microsoft.</p></description>
|
||||
<url type="homepage">https://gitea.thebrokenrail.com/TheBrokenRail/minecraft-pi-reborn</url>
|
||||
<launchable type="desktop-id">com.thebrokenrail.MCPIRebornServer.desktop</launchable>
|
||||
<provides>
|
||||
<id>com.thebrokenrail.MCPIRebornServer.desktop</id>
|
||||
</provides>
|
||||
<project_license>LicenseRef-proprietary</project_license>
|
||||
<developer_name>TheBrokenRail & Mojang AB</developer_name>
|
||||
<content_rating type="oars-1.0">
|
||||
<content_attribute id="violence-cartoon">moderate</content_attribute>
|
||||
<content_attribute id="violence-fantasy">none</content_attribute>
|
||||
<content_attribute id="violence-realistic">none</content_attribute>
|
||||
<content_attribute id="violence-bloodshed">none</content_attribute>
|
||||
<content_attribute id="violence-sexual">none</content_attribute>
|
||||
<content_attribute id="drugs-alcohol">none</content_attribute>
|
||||
<content_attribute id="drugs-narcotics">none</content_attribute>
|
||||
<content_attribute id="drugs-tobacco">none</content_attribute>
|
||||
<content_attribute id="sex-nudity">none</content_attribute>
|
||||
<content_attribute id="sex-themes">none</content_attribute>
|
||||
<content_attribute id="language-profanity">none</content_attribute>
|
||||
<content_attribute id="language-humor">none</content_attribute>
|
||||
<content_attribute id="language-discrimination">none</content_attribute>
|
||||
<content_attribute id="social-chat">intense</content_attribute>
|
||||
<content_attribute id="social-info">none</content_attribute>
|
||||
<content_attribute id="social-audio">none</content_attribute>
|
||||
<content_attribute id="social-location">none</content_attribute>
|
||||
<content_attribute id="social-contacts">none</content_attribute>
|
||||
<content_attribute id="money-purchasing">none</content_attribute>
|
||||
<content_attribute id="money-gambling">none</content_attribute>
|
||||
</content_rating>
|
||||
</component>
|
||||
|
@ -157,7 +157,7 @@ void pre_bootstrap(int argc, char *argv[]) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "--version") == 0 || strcmp(argv[i], "-v") == 0) {
|
||||
// Print
|
||||
printf("Reborn v%s\n", VERSION);
|
||||
printf("Reborn v%s\n", MCPI_VERSION);
|
||||
fflush(stdout);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
@ -106,12 +106,15 @@ static void run_command_and_set_env(const char *env_name, const char *command[])
|
||||
}
|
||||
|
||||
// Use Zenity To Set Environmental Variable
|
||||
#define DIALOG_TITLE "Launcher"
|
||||
static void run_zenity_and_set_env(const char *env_name, std::vector<std::string> command) {
|
||||
// Create Full Command
|
||||
std::vector<std::string> full_command;
|
||||
full_command.push_back("zenity");
|
||||
full_command.push_back("--title");
|
||||
full_command.push_back(DIALOG_TITLE);
|
||||
full_command.push_back("--name");
|
||||
full_command.push_back(GUI_TITLE);
|
||||
full_command.push_back(MCPI_APP_TITLE);
|
||||
full_command.insert(full_command.end(), command.begin(), command.end());
|
||||
// Convert To C Array
|
||||
const char *full_command_array[full_command.size() + 1];
|
||||
|
@ -21,7 +21,7 @@ static void show_report(const char *log_filename) {
|
||||
const char *command[] = {
|
||||
"zenity",
|
||||
"--title", DIALOG_TITLE,
|
||||
"--name", GUI_TITLE,
|
||||
"--name", MCPI_APP_TITLE,
|
||||
"--width", CRASH_REPORT_DIALOG_WIDTH,
|
||||
"--height", CRASH_REPORT_DIALOG_HEIGHT,
|
||||
"--text-info",
|
||||
|
@ -1,8 +1,14 @@
|
||||
project(libreborn)
|
||||
|
||||
add_library(reborn-util STATIC src/util/elf.c src/util/exec.c src/util/string.c src/util/util.c)
|
||||
target_include_directories(reborn-util PUBLIC include)
|
||||
# Config
|
||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/include/libreborn")
|
||||
configure_file(include/libreborn/config.h.in "${CMAKE_CURRENT_BINARY_DIR}/include/libreborn/config.h" ESCAPE_QUOTES @ONLY)
|
||||
|
||||
# Util
|
||||
add_library(reborn-util STATIC src/util/elf.c src/util/exec.c src/util/string.c src/util/util.c)
|
||||
target_include_directories(reborn-util PUBLIC include PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/include")
|
||||
|
||||
# Patch
|
||||
if(BUILD_ARM_COMPONENTS)
|
||||
add_library(reborn-patch SHARED src/patch/patch.c)
|
||||
target_link_libraries(reborn-patch dl pthread reborn-util)
|
||||
|
@ -1,3 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#define GUI_TITLE "Minecraft: Pi Edition: Reborn"
|
9
libreborn/include/libreborn/config.h.in
Normal file
9
libreborn/include/libreborn/config.h.in
Normal file
@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#cmakedefine MCPI_SERVER_MODE
|
||||
#cmakedefine MCPI_HEADLESS_MODE
|
||||
#cmakedefine MCPI_IS_APPIMAGE_BUILD
|
||||
#cmakedefine MCPI_BUNDLE_ARMHF_SYSROOT
|
||||
#cmakedefine MCPI_USE_GLES1_COMPATIBILITY_LAYER
|
||||
#cmakedefine MCPI_APP_TITLE "@MCPI_APP_TITLE@"
|
||||
#cmakedefine MCPI_VERSION "@MCPI_VERSION@"
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "config.h"
|
||||
#include <libreborn/config.h>
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
#include "string.h"
|
||||
|
@ -34,7 +34,7 @@ static void *chat_thread(__attribute__((unused)) void *nop) {
|
||||
const char *command[] = {
|
||||
"zenity",
|
||||
"--title", DIALOG_TITLE,
|
||||
"--name", GUI_TITLE,
|
||||
"--name", MCPI_APP_TITLE,
|
||||
"--entry",
|
||||
"--text", "Enter Chat Message:",
|
||||
NULL
|
||||
|
@ -20,7 +20,7 @@
|
||||
// Custom Title
|
||||
HOOK(SDL_WM_SetCaption, void, (__attribute__((unused)) const char *title, const char *icon)) {
|
||||
ensure_SDL_WM_SetCaption();
|
||||
(*real_SDL_WM_SetCaption)(GUI_TITLE, icon);
|
||||
(*real_SDL_WM_SetCaption)(MCPI_APP_TITLE, icon);
|
||||
}
|
||||
|
||||
// Mouse Cursor Is Always Invisible In Vanilla MCPI
|
||||
|
@ -89,7 +89,7 @@ static void *create_world_thread(__attribute__((unused)) void *nop) {
|
||||
const char *command[] = {
|
||||
"zenity",
|
||||
"--title", DIALOG_TITLE,
|
||||
"--name", GUI_TITLE,
|
||||
"--name", MCPI_APP_TITLE,
|
||||
"--entry",
|
||||
"--text", "Enter World Name:",
|
||||
"--entry-text", DEFAULT_WORLD_NAME,
|
||||
@ -116,7 +116,7 @@ static void *create_world_thread(__attribute__((unused)) void *nop) {
|
||||
const char *command[] = {
|
||||
"zenity",
|
||||
"--title", DIALOG_TITLE,
|
||||
"--name", GUI_TITLE,
|
||||
"--name", MCPI_APP_TITLE,
|
||||
"--list",
|
||||
"--radiolist",
|
||||
"--width", GAME_MODE_DIALOG_SIZE,
|
||||
@ -149,7 +149,7 @@ static void *create_world_thread(__attribute__((unused)) void *nop) {
|
||||
const char *command[] = {
|
||||
"zenity",
|
||||
"--title", DIALOG_TITLE,
|
||||
"--name", GUI_TITLE,
|
||||
"--name", MCPI_APP_TITLE,
|
||||
"--entry",
|
||||
"--only-numerical",
|
||||
"--text", "Enter Seed (Leave Blank For Random):",
|
||||
|
@ -9,7 +9,7 @@ char *version_get() {
|
||||
static char *version = NULL;
|
||||
// Load
|
||||
if (version == NULL) {
|
||||
safe_asprintf(&version, "%s / Reborn v" VERSION, *minecraft_pi_version);
|
||||
safe_asprintf(&version, "%s / Reborn v" MCPI_VERSION, *minecraft_pi_version);
|
||||
}
|
||||
// Return
|
||||
return version;
|
||||
|
@ -8,5 +8,5 @@ ADD ./scripts/install-dependencies.sh /
|
||||
RUN \
|
||||
apt-get update && \
|
||||
apt-get install --no-install-recommends -y sudo && \
|
||||
/install-dependencies.sh && \
|
||||
/install-dependencies.sh amd64 armhf arm64 && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
@ -2,120 +2,96 @@
|
||||
|
||||
set -e
|
||||
|
||||
# This Script Assumes An x86_64 Host
|
||||
if [ "$(uname -m)" != "x86_64" ]; then
|
||||
echo 'Invalid Build Architecture'
|
||||
exit 1
|
||||
fi
|
||||
# Main Script
|
||||
run() {
|
||||
# Add ARM Repository
|
||||
for arch in "$@"; do
|
||||
sudo dpkg --add-architecture "${arch}"
|
||||
done
|
||||
|
||||
# Add ARM Repository
|
||||
if [ ! -z "${ARM_PACKAGES_SUPPORTED}" ]; then
|
||||
sudo dpkg --add-architecture armhf
|
||||
sudo dpkg --add-architecture arm64
|
||||
fi
|
||||
# Update APT
|
||||
sudo apt-get update
|
||||
sudo apt-get dist-upgrade -y
|
||||
|
||||
# Update APT
|
||||
sudo apt-get update
|
||||
sudo apt-get dist-upgrade -y
|
||||
# Install Everything In One Go
|
||||
PKG_QUEUE=''
|
||||
queue_pkg() {
|
||||
PKG_QUEUE="${PKG_QUEUE} $@"
|
||||
}
|
||||
|
||||
# Install Everything In One Go
|
||||
PKG_QUEUE=''
|
||||
queue_pkg() {
|
||||
PKG_QUEUE="${PKG_QUEUE} $@"
|
||||
# Build System
|
||||
queue_pkg \
|
||||
git \
|
||||
cmake \
|
||||
ninja-build \
|
||||
nodejs
|
||||
|
||||
# Host Dependencies Needed For Compile
|
||||
queue_pkg \
|
||||
libwayland-bin \
|
||||
libfreeimage-dev
|
||||
|
||||
# Host Dependencies Needed For Running
|
||||
queue_pkg \
|
||||
qemu-user \
|
||||
patchelf
|
||||
|
||||
# Architecture-Specific Dependencies
|
||||
architecture_specific_pkg() {
|
||||
# Compiler
|
||||
queue_pkg \
|
||||
crossbuild-essential-$1
|
||||
|
||||
# Dependencies
|
||||
queue_pkg \
|
||||
libfreeimage3:$1 \
|
||||
libopenal-dev:$1
|
||||
|
||||
# GLFW Dependencies
|
||||
queue_pkg \
|
||||
libwayland-dev:$1 \
|
||||
libxkbcommon-dev:$1 \
|
||||
libx11-dev:$1 \
|
||||
libxcursor-dev:$1 \
|
||||
libxi-dev:$1 \
|
||||
libxinerama-dev:$1 \
|
||||
libxrandr-dev:$1 \
|
||||
libxext-dev:$1
|
||||
|
||||
# Zenity Dependencies
|
||||
queue_pkg \
|
||||
libgtk-3-dev:$1 \
|
||||
libglib2.0-dev:$1
|
||||
}
|
||||
for arch in "$@"; do
|
||||
architecture_specific_pkg "${arch}"
|
||||
done
|
||||
|
||||
# Install appimagetool & appimage-builder Dependencies
|
||||
queue_pkg \
|
||||
python3-pip \
|
||||
python3-setuptools \
|
||||
python3-wheel \
|
||||
patchelf \
|
||||
desktop-file-utils \
|
||||
libgdk-pixbuf2.0-dev \
|
||||
fakeroot \
|
||||
strace \
|
||||
fuse \
|
||||
gtk-update-icon-cache \
|
||||
shared-mime-info \
|
||||
sed
|
||||
|
||||
# Install Queue
|
||||
sudo apt-get install --no-install-recommends -y ${PKG_QUEUE}
|
||||
|
||||
# Install appimage-builder
|
||||
sudo pip3 install 'git+https://github.com/AppImageCrafters/appimage-builder.git'
|
||||
}
|
||||
|
||||
# Build Tools
|
||||
queue_pkg \
|
||||
git \
|
||||
cmake \
|
||||
ninja-build \
|
||||
crossbuild-essential-armhf \
|
||||
gcc g++ \
|
||||
nodejs
|
||||
|
||||
# Dependencies
|
||||
queue_pkg \
|
||||
libfreeimage3 libfreeimage-dev \
|
||||
libopenal-dev \
|
||||
qemu-user \
|
||||
patchelf
|
||||
|
||||
# GLFW Dependencies
|
||||
queue_pkg \
|
||||
libwayland-dev \
|
||||
libxkbcommon-dev \
|
||||
wayland-protocols \
|
||||
libx11-dev \
|
||||
libxcursor-dev \
|
||||
libxi-dev \
|
||||
libxinerama-dev \
|
||||
libxrandr-dev \
|
||||
libxext-dev
|
||||
|
||||
# Zenity Dependencies
|
||||
queue_pkg \
|
||||
libgtk-3-dev \
|
||||
libglib2.0-dev
|
||||
|
||||
# ARM Packages
|
||||
if [ ! -z "${ARM_PACKAGES_SUPPORTED}" ]; then
|
||||
# Build Tools
|
||||
queue_pkg \
|
||||
crossbuild-essential-arm64
|
||||
|
||||
# Dependencies
|
||||
queue_pkg \
|
||||
libfreeimage3:armhf libfreeimage3:arm64 \
|
||||
libopenal-dev:armhf libopenal-dev:arm64
|
||||
|
||||
# GLFW Dependencies
|
||||
queue_pkg \
|
||||
libwayland-dev:armhf libwayland-dev:arm64 \
|
||||
libxkbcommon-dev:armhf libxkbcommon-dev:arm64 \
|
||||
libx11-dev:armhf libx11-dev:arm64 \
|
||||
libxcursor-dev:armhf libxcursor-dev:arm64 \
|
||||
libxi-dev:armhf libxi-dev:arm64 \
|
||||
libxinerama-dev:armhf libxinerama-dev:arm64 \
|
||||
libxrandr-dev:armhf libxrandr-dev:arm64 \
|
||||
libxext-dev:armhf libxext-dev:arm64
|
||||
|
||||
# Zenity Dependencies
|
||||
queue_pkg \
|
||||
libgtk-3-dev:armhf libgtk-3-dev:arm64 \
|
||||
libglib2.0-dev:armhf libglib2.0-dev:arm64
|
||||
# Run
|
||||
if [ "$#" -lt 1 ]; then
|
||||
run "$(dpkg-architecture -qDEB_BUILD_ARCH)"
|
||||
else
|
||||
run "$@"
|
||||
fi
|
||||
|
||||
# Install appimagetool & appimage-builder Dependencies
|
||||
queue_pkg \
|
||||
python3-pip \
|
||||
python3-setuptools \
|
||||
python3-wheel \
|
||||
patchelf \
|
||||
desktop-file-utils \
|
||||
libgdk-pixbuf2.0-dev \
|
||||
fakeroot \
|
||||
strace \
|
||||
fuse \
|
||||
gtk-update-icon-cache \
|
||||
shared-mime-info \
|
||||
sed
|
||||
|
||||
# Install Queue
|
||||
sudo apt-get install --no-install-recommends -y ${PKG_QUEUE}
|
||||
|
||||
# Download appimagetool
|
||||
sudo mkdir -p /opt
|
||||
sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /opt/appimagetool
|
||||
sudo chmod +x /opt/appimagetool
|
||||
# Workaround AppImage Issues With Docker
|
||||
cd /opt
|
||||
sudo sed -i '0,/AI\x02/{s|AI\x02|\x00\x00\x00|}' ./appimagetool
|
||||
sudo rm -rf /opt/squashfs-root /opt/appimagetool.AppDir
|
||||
sudo ./appimagetool --appimage-extract
|
||||
sudo rm -f ./appimagetool
|
||||
sudo mv /opt/squashfs-root /opt/appimagetool.AppDir
|
||||
sudo rm -f /usr/local/bin/appimagetool
|
||||
sudo ln -s /opt/appimagetool.AppDir/AppRun /usr/local/bin/appimagetool
|
||||
|
||||
# Install appimage-builder
|
||||
sudo pip3 install 'git+https://github.com/AppImageCrafters/appimage-builder.git'
|
||||
|
@ -9,4 +9,5 @@ set -e
|
||||
appimage-builder --recipe AppImageBuilder.yml
|
||||
|
||||
# Move ZSync
|
||||
rm -f "./out/minecraft-pi-reborn-$1-latest-$2.AppImage.zsync"
|
||||
mv "./minecraft-pi-reborn-$1-$(cat VERSION)-$2.AppImage.zsync" "./out/minecraft-pi-reborn-$1-latest-$2.AppImage.zsync"
|
||||
|
Loading…
Reference in New Issue
Block a user