Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
2.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
NoozAbooz committed Oct 31, 2022
1 parent b2f50b6 commit fcc8de0
Show file tree
Hide file tree
Showing 27 changed files with 422 additions and 76 deletions.
6 changes: 5 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@
url = https://gitea.thebrokenrail.com/minecraft-pi-reborn/zenity.git
[submodule "dependencies/LIEF/src"]
path = dependencies/LIEF/src
url = https://github.com/lief-project/LIEF.git
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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.4
2.4.5
2 changes: 1 addition & 1 deletion debian/client-amd64
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Architecture: amd64
Maintainer: Nooz <[email protected]>
Description: Community mod of MCPI-Reborn
Homepage: https://github.com/mobilegmYT/mcpi-reborn-extended/
Depends: libc6, libstdc++6, libc6-armhf-cross, libstdc++6-armhf-cross, libgles1, libegl1, libglfw3 | libglfw3-wayland, libfreeimage3, libopenal1, qemu-user, patchelf, python3-minecraftpi
Depends: libc6, libstdc++6, libc6-armhf-cross, libstdc++6-armhf-cross, libgles1, libegl1, libglfw3 | libglfw3-wayland, libfreeimage3, libopenal1, python3-minecraftpi
Section: games
Priority: optional
2 changes: 1 addition & 1 deletion debian/client-arm64
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Architecture: arm64
Maintainer: Nooz <[email protected]>
Description: Community mod of MCPI-Reborn
Homepage: https://github.com/mobilegmYT/mcpi-reborn-extended/
Depends: libc6, libstdc++6, libc6:armhf, libstdc++6:armhf, libgles1, libegl1, libglfw3 | libglfw3-wayland, libfreeimage3, libopenal1, patchelf, python3-minecraftpi
Depends: libc6, libstdc++6, libc6:armhf, libstdc++6:armhf, libgles1, libegl1, libglfw3 | libglfw3-wayland, libfreeimage3, libopenal1, python3-minecraftpi
Section: games
Priority: optional
2 changes: 1 addition & 1 deletion debian/client-armhf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Architecture: armhf
Maintainer: Nooz <[email protected]>
Description: Community mod of MCPI-Reborn
Homepage: https://github.com/mobilegmYT/mcpi-reborn-extended/
Depends: libc6, libstdc++6, libgles1, libegl1, libglfw3 | libglfw3-wayland, libfreeimage3, libopenal1, patchelf, python3-minecraftpi
Depends: libc6, libstdc++6, libgles1, libegl1, libglfw3 | libglfw3-wayland, libfreeimage3, libopenal1, python3-minecraftpi
Section: games
Priority: optional
2 changes: 1 addition & 1 deletion debian/server-amd64
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Maintainer: Nooz <[email protected]>
Description: Modded server for Minecraft Pi Edition
Homepage: https://github.com/mobilegmYT/mcpi-reborn-extended/
Architecture: amd64
Depends: libc6, libstdc++6, libc6-armhf-cross, libstdc++6-armhf-cross, qemu-user, patchelf
Depends: libc6, libstdc++6, libc6-armhf-cross, libstdc++6-armhf-cross
Section: games
Priority: optional
2 changes: 1 addition & 1 deletion debian/server-arm64
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Maintainer: Nooz <[email protected]>
Description: Modded server for Minecraft Pi Edition
Homepage: https://github.com/mobilegmYT/mcpi-reborn-extended/
Architecture: arm64
Depends: libc6, libstdc++6, libc6:armhf, libstdc++6:armhf, patchelf
Depends: libc6, libstdc++6, libc6:armhf, libstdc++6:armhf
Section: games
Priority: optional
2 changes: 1 addition & 1 deletion debian/server-armhf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Maintainer: Nooz <[email protected]>
Description: Modded server for Minecraft Pi Edition
Homepage: https://github.com/mobilegmYT/mcpi-reborn-extended/
Architecture: armhf
Depends: libc6, libstdc++6, patchelf
Depends: libc6, libstdc++6
Section: games
Priority: optional
4 changes: 4 additions & 0 deletions dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ endif()
# LIEF
if(BUILD_NATIVE_COMPONENTS OR (BUILD_ARM_COMPONENTS AND NOT MCPI_SERVER_MODE AND NOT MCPI_USE_MEDIA_LAYER_PROXY))
add_subdirectory(LIEF)
endif()
# QEMU
if(BUILD_NATIVE_COMPONENTS AND NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "arm*" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64"))
add_subdirectory(qemu)
endif()
37 changes: 37 additions & 0 deletions dependencies/qemu/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
project(qemu)

## QEMU

# Build
include(ProcessorCount)
ProcessorCount(NPROC)
include(ExternalProject)
ExternalProject_Add(qemu
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src"
CONFIGURE_COMMAND
"${CMAKE_COMMAND}" "-E" "env"
"PKG_CONFIG_LIBDIR=$ENV{PKG_CONFIG_LIBDIR}"
"CFLAGS=-s"
"CXXFLAGS=-s"
"<SOURCE_DIR>/configure"
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--cross-prefix="
"--cc=${CMAKE_C_COMPILER}"
"--cxx=${CMAKE_CXX_COMPILER}"
"--disable-debug-info"
"--target-list=arm-linux-user"
"--without-default-features"
USES_TERMINAL_CONFIGURE TRUE
BUILD_COMMAND "make" "-j${NPROC}" "qemu-arm"
USES_TERMINAL_BUILD TRUE
INSTALL_COMMAND ""
TEST_COMMAND ""
BUILD_BYPRODUCTS "<BINARY_DIR>/qemu-arm"
)

# Install
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")
1 change: 1 addition & 0 deletions dependencies/qemu/src
Submodule src added at 621da7
5 changes: 5 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog
The changelog for every single MCPI v2 release is listed here. Under-the-hood modifications that don't effect the user experience are prefixed with "[INT]".

### **2.4.5**
* Remove Coloured Terminal Output
* Implemented Upstream Crash Dialog
* Bundle QEMU

### **2.4.4**
* Cache Previous Launcher Configuration
* Add ``MCPI_API_PORT`` Environmental Variable
Expand Down
2 changes: 1 addition & 1 deletion launcher/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(launcher)

# Launcher
add_executable(launcher src/bootstrap.c src/patchelf.cpp)
add_executable(launcher src/bootstrap.c src/patchelf.cpp src/crash-report.c)
if(MCPI_SERVER_MODE)
target_sources(launcher PRIVATE src/server/launcher.c)
else()
Expand Down
54 changes: 31 additions & 23 deletions launcher/src/bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include "bootstrap.h"
#include "patchelf.h"
#include "crash-report.h"

// Get All Mods In Folder
static void load(char **ld_preload, char *folder) {
Expand Down Expand Up @@ -97,13 +98,12 @@ static void exit_handler(__attribute__((unused)) int signal_id) {

// Pre-Bootstrap
void pre_bootstrap(int argc, char *argv[]) {
// Set Debug Tag
reborn_debug_tag = "(Launcher) ";

// Disable stdout Buffering
setvbuf(stdout, NULL, _IONBF, 0);

// Set Default Native Component Environment
#define set_variable_default(name) set_and_print_env("MCPI_NATIVE_" name, getenv(name));
for_each_special_environmental_variable(set_variable_default);

// Print Version
for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "--version") == 0 || strcmp(argv[i], "-v") == 0) {
Expand All @@ -114,29 +114,24 @@ void pre_bootstrap(int argc, char *argv[]) {
}
}

// GTK Dark Mode
#ifndef MCPI_SERVER_MODE
set_and_print_env("GTK_THEME", "Adwaita:dark");
#endif
// Setup Logging
setup_log_file();

// Debug Zenity
#ifndef MCPI_SERVER_MODE
{
const char *is_debug = getenv("MCPI_DEBUG");
if (is_debug != NULL && strlen(is_debug) > 0) {
set_and_print_env("ZENITY_DEBUG", "1");
// --debug
for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "--debug") == 0) {
set_and_print_env("MCPI_DEBUG", "1");
break;
}
}
#endif

// AppImage
#ifdef MCPI_IS_APPIMAGE_BUILD
{
char *owd = getenv("OWD");
if (owd != NULL && chdir(owd) != 0) {
ERR("AppImage: Unable To Fix Current Directory: %s", strerror(errno));
}
}
// Set Default Native Component Environment
#define set_variable_default(name) set_and_print_env("MCPI_NATIVE_" name, getenv(name));
for_each_special_environmental_variable(set_variable_default);

// GTK Dark Mode
#ifndef MCPI_SERVER_MODE
set_and_print_env("GTK_THEME", "Adwaita:dark");
#endif

// Get Binary Directory
Expand All @@ -162,6 +157,19 @@ void pre_bootstrap(int argc, char *argv[]) {
// Free Binary Directory
free(binary_directory);

// Setup Crash Reports
setup_crash_report();

// AppImage
#ifdef MCPI_IS_APPIMAGE_BUILD
{
char *owd = getenv("OWD");
if (owd != NULL && chdir(owd) != 0) {
ERR("AppImage: Unable To Fix Current Directory: %s", strerror(errno));
}
}
#endif

// Install Signal Handlers
struct sigaction act_sigint;
memset((void *) &act_sigint, 0, sizeof (struct sigaction));
Expand Down
24 changes: 12 additions & 12 deletions launcher/src/client/cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ launcher_cache load_cache() {
// Log
DEBUG("Loading Launcher Cache...");

// Lock File
int lock_fd = lock_file(get_cache_path().c_str());

// Return Value
launcher_cache ret = empty_cache;

Expand All @@ -46,6 +43,9 @@ launcher_cache load_cache() {
WARN("Unable To Open Launcher Cache For Loading");
}
} else {
// Lock File
int lock_fd = lock_file(get_cache_path().c_str());

// Check Version
unsigned char cache_version;
stream.read((char *) &cache_version, 1);
Expand Down Expand Up @@ -84,10 +84,10 @@ launcher_cache load_cache() {
ret = cache;
}
}
}

// Unlock File
unlock_file(get_cache_path().c_str(), lock_fd);
// Unlock File
unlock_file(get_cache_path().c_str(), lock_fd);
}

// Return
return ret;
Expand All @@ -106,15 +106,15 @@ void save_cache() {
// Log
DEBUG("Saving Launcher Cache...");

// Lock File
int lock_fd = lock_file(get_cache_path().c_str());

// Open File
std::ofstream stream(get_cache_path(), std::ios::out | std::ios::binary);
if (!stream) {
// Fail
WARN("Unable To Open Launcher Cache For Saving");
} else {
// Lock File
int lock_fd = lock_file(get_cache_path().c_str());

// Save Cache Version
unsigned char cache_version = (unsigned char) CACHE_VERSION;
stream.write((const char *) &cache_version, 1);
Expand Down Expand Up @@ -153,10 +153,10 @@ void save_cache() {
if (!stream.good()) {
WARN("Failure While Saving Launcher Cache");
}
}

// Unlock File
unlock_file(get_cache_path().c_str(), lock_fd);
// Unlock File
unlock_file(get_cache_path().c_str(), lock_fd);
}
}

// Wipe Cache
Expand Down
Loading

0 comments on commit fcc8de0

Please sign in to comment.