diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index ebacf87..bcc20bf 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -6,8 +6,7 @@ on: - master tags: - '*' - tags-ignore: - - flatpak + - '!flatpak' jobs: build: diff --git a/.gitmodules b/.gitmodules index c70e3c3..58c35e5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,10 +7,6 @@ [submodule "dependencies/LIEF/src"] path = dependencies/LIEF/src url = https://github.com/lief-project/LIEF.git -[submodule "dependencies/qemu/src"] - path = dependencies/qemu/src - url = https://gitlab.com/qemu-project/qemu.git - ignore = dirty [submodule "media-layer/core/gles/dependencies/gles-compatibility-layer"] path = dependencies/gles-compatibility-layer/src url = https://gitea.thebrokenrail.com/minecraft-pi-reborn/gles-compatibility-layer.git @@ -20,3 +16,6 @@ [submodule "dependencies/utf8cpp/src"] path = dependencies/utf8cpp/src url = https://github.com/nemtrif/utfcpp.git +[submodule "archives"] + path = archives + url = https://gitea.thebrokenrail.com/minecraft-pi-reborn/archives.git diff --git a/VERSION b/VERSION index 73462a5..f225a78 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.5.1 +2.5.2 diff --git a/archives b/archives new file mode 160000 index 0000000..f878bb1 --- /dev/null +++ b/archives @@ -0,0 +1 @@ +Subproject commit f878bb1299f3c9506737f311cb01749e41e3f9dd diff --git a/cmake/prebuilt-armhf-toolchain.cmake b/cmake/prebuilt-armhf-toolchain.cmake index 34a279e..d1e681a 100644 --- a/cmake/prebuilt-armhf-toolchain.cmake +++ b/cmake/prebuilt-armhf-toolchain.cmake @@ -1,25 +1,21 @@ -# Pick URL +# Pick Archive +set(toolchain_version "13.2.rel1") execute_process(COMMAND uname -m OUTPUT_VARIABLE arch OUTPUT_STRIP_TRAILING_WHITESPACE) if(arch STREQUAL "x86_64") - set(toolchain_url "https://developer.arm.com/-/media/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz") - set(toolchain_sha256 "f5f3c1cfcb429833d363e8fec31bb1282974b119ca8169d6277ce8a549e26d54") + set(toolchain_file "arm-gnu-toolchain-${toolchain_version}-x86_64-arm-none-linux-gnueabihf.tar.xz") elseif(arch STREQUAL "aarch64" OR arch STREQUAL "armv8b" OR arch STREQUAL "armv8l") - set(toolchain_url "https://developer.arm.com/-/media/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-aarch64-arm-none-linux-gnueabihf.tar.xz") - set(toolchain_sha256 "ac2806f4c1ba772817aded18a5b730b5004592b1f1224d8296de69942e3704bd") + set(toolchain_file "arm-gnu-toolchain-${toolchain_version}-aarch64-arm-none-linux-gnueabihf.tar.xz") else() message(FATAL_ERROR "Unable To Download Prebuilt ARMHF Toolchain") endif() # Download If Needed include(FetchContent) -set(FETCHCONTENT_QUIET FALSE) FetchContent_Declare( prebuilt-armhf-toolchain - URL "${toolchain_url}" - URL_HASH "SHA256=${toolchain_sha256}" + URL "file://${CMAKE_CURRENT_LIST_DIR}/../archives/${toolchain_file}" ) FetchContent_MakeAvailable(prebuilt-armhf-toolchain) -set(FETCHCONTENT_QUIET TRUE) set(toolchain_dir "${prebuilt-armhf-toolchain_SOURCE_DIR}") # Force Toolchain diff --git a/dependencies/qemu/CMakeLists.txt b/dependencies/qemu/CMakeLists.txt index f5f3823..5664268 100644 --- a/dependencies/qemu/CMakeLists.txt +++ b/dependencies/qemu/CMakeLists.txt @@ -2,12 +2,15 @@ project(qemu) ## QEMU +# Version +set(QEMU_VERSION "8.1.3") + # Build include(ProcessorCount) ProcessorCount(NPROC) include(ExternalProject) ExternalProject_Add(qemu - SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src" + URL "file://${CMAKE_CURRENT_SOURCE_DIR}/../../archives/qemu-${QEMU_VERSION}.tar.xz" CONFIGURE_COMMAND "${CMAKE_COMMAND}" "-E" "env" "PKG_CONFIG_LIBDIR=$ENV{PKG_CONFIG_LIBDIR}" @@ -34,4 +37,5 @@ ExternalProject_Get_property(qemu BINARY_DIR) install(PROGRAMS "${BINARY_DIR}/qemu-arm" DESTINATION "${MCPI_BIN_DIR}") # License -install(FILES src/COPYING DESTINATION "${MCPI_LEGAL_DIR}/qemu") +ExternalProject_Get_property(qemu SOURCE_DIR) +install(FILES "${SOURCE_DIR}/COPYING" DESTINATION "${MCPI_LEGAL_DIR}/qemu") diff --git a/dependencies/qemu/src b/dependencies/qemu/src deleted file mode 160000 index 78385bc..0000000 --- a/dependencies/qemu/src +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 78385bc738108a9b5b20e639520dc60425ca2a5a diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index d57afb7..39e6d38 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +**2.5.2** +* Add ``3D Chest Model`` Feature Flag (Enabled By Default) +* Stop Using Jenkins +* Replace ``iconv`` +* Replace LibPNG + **2.5.1** * Allow Overriidng Custom Skin Server Using ``MCPI_SKIN_SERVER`` Environmental Variable * Fix Bug With SDK Generation diff --git a/docs/INSTALL.md b/docs/INSTALL.md index a3b05b3..51178d5 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -1,7 +1,7 @@ # Installation ## AppImage -Download packages [here](https://jenkins.thebrokenrail.com/job/minecraft-pi-reborn/job/master/lastSuccessfulBuild/artifact/out/). +Download packages [here](https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/releases). ### System Requirements * Debian Buster/Ubuntu 18.04 Or Higher diff --git a/images/chest.png~ b/images/chest.png~ deleted file mode 100644 index d9429e8..0000000 Binary files a/images/chest.png~ and /dev/null differ diff --git a/images/start.png b/images/start.png index 14b9276..491ee6a 100644 Binary files a/images/start.png and b/images/start.png differ diff --git a/launcher/src/bootstrap.c b/launcher/src/bootstrap.c index af7cc36..18eadfc 100644 --- a/launcher/src/bootstrap.c +++ b/launcher/src/bootstrap.c @@ -88,6 +88,14 @@ static void load(char **ld_preload, char *folder) { #define MCPI_BINARY "minecraft-pi" #define QEMU_BINARY "qemu-arm" +#ifndef __ARM_ARCH +#define USE_QEMU +#endif + +#define REQUIRED_PAGE_SIZE 4096 +#define _STR(x) #x +#define STR(x) _STR(x) + // Exit Handler static void exit_handler(__attribute__((unused)) int signal_id) { // Pass Signal To Child @@ -96,6 +104,45 @@ static void exit_handler(__attribute__((unused)) int signal_id) { _exit(EXIT_SUCCESS); } +// Debug Information +static void run_debug_command(const char *const command[], const char *prefix) { + int status = 0; + char *output = run_command(command, &status, NULL); + if (output != NULL) { + // Remove Newline + size_t length = strlen(output); + if (length > 0 && output[length - 1] == '\n') { + output[length - 1] = '\0'; + } + + // Print + DEBUG("%s: %s", prefix, output); + free(output); + } + if (!is_exit_status_success(status)) { + ERR("Unable To Gather Debug Information"); + } +} +static void print_debug_information() { + // System Information + const char *const command[] = {"uname", "-a", NULL}; + run_debug_command(command, "System Information"); + + // Version + DEBUG("Reborn Version: v%s", MCPI_VERSION); + + // Architecture + const char *arch = "Unknown"; +#ifdef __x86_64__ + arch = "AMD64"; +#elif defined(__aarch64__) + arch = "ARM64"; +#elif defined(__arm__) + arch = "ARM32"; +#endif + DEBUG("Reborn Target Architecture: %s", arch); +} + // Pre-Bootstrap void pre_bootstrap(int argc, char *argv[]) { // Set Debug Tag @@ -181,6 +228,17 @@ void pre_bootstrap(int argc, char *argv[]) { act_sigterm.sa_flags = SA_RESTART; act_sigterm.sa_handler = &exit_handler; sigaction(SIGTERM, &act_sigterm, NULL); + + // Check Page Size (Not Needed When Using QEMU) +#ifndef USE_QEMU + long page_size = sysconf(_SC_PAGESIZE); + if (page_size != REQUIRED_PAGE_SIZE) { + ERR("Invalid page size! A page size of %ld bytes is required, but the system size is %ld bytes.", REQUIRED_PAGE_SIZE, page_size); + } +#endif + + // Debug Information + print_debug_information(); } // Copy SDK Into ~/.minecraft-pi @@ -443,16 +501,18 @@ void bootstrap(int argc, char *argv[]) { new_args[argv_start] = new_mcpi_exe_path; // Non-ARM Systems Need QEMU -#ifndef __ARM_ARCH +#ifdef USE_QEMU argv_start--; new_args[argv_start] = QEMU_BINARY; + // Use 4k Page Size + set_and_print_env("QEMU_PAGESIZE", STR(REQUIRED_PAGE_SIZE)); #endif // Setup Environment setup_exec_environment(1); // Pass LD_* Variables Through QEMU -#ifndef __ARM_ARCH +#ifdef USE_QEMU char *qemu_set_env = NULL; #define pass_variable_through_qemu(name) string_append(&qemu_set_env, "%s%s=%s", qemu_set_env == NULL ? "" : ",", name, getenv(name)); for_each_special_environmental_variable(pass_variable_through_qemu); diff --git a/scripts/package.sh b/scripts/package.sh index 9e85e06..be0ee99 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -4,7 +4,6 @@ set -e # Prepare NAME='minecraft-pi-reborn' -BRANCH='master' # Build ./scripts/setup.sh "$1" "$2" -DMCPI_IS_APPIMAGE_BUILD=ON @@ -30,7 +29,7 @@ case "$2" in 'amd64') APPIMAGE_ARCH='x86_64';; esac ARCH="${APPIMAGE_ARCH}" appimagetool \ - --updateinformation "zsync|https://jenkins.thebrokenrail.com/job/minecraft-pi-reborn/job/${BRANCH}/lastSuccessfulBuild/artifact/out/${NAME}-latest-$2.AppImage.zsync" \ + --updateinformation "zsync|https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/releases/download/latest/${NAME}-latest-$2.AppImage.zsync" \ --runtime-file "build/appimage/runtime-$2" \ --comp xz \ "./out/$1-$2" \