Bundle QEMU

This commit is contained in:
TheBrokenRail 2022-09-26 20:59:46 -04:00
parent 2766611878
commit 40a527bb23
7 changed files with 43 additions and 7 deletions

4
.gitmodules vendored
View File

@ -14,3 +14,7 @@
[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

View File

@ -16,3 +16,7 @@ endif()
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()

33
dependencies/qemu/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,33 @@
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}"
"<SOURCE_DIR>/configure"
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--cross-prefix="
"--cc=${CMAKE_C_COMPILER}"
"--cxx=${CMAKE_CXX_COMPILER}"
"--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
dependencies/qemu/src vendored Submodule

@ -0,0 +1 @@
Subproject commit 621da7789083b80d6f1ff1c0fb499334007b4f51

View File

@ -5,9 +5,6 @@ Download packages [here](https://jenkins.thebrokenrail.com/job/minecraft-pi-rebo
### System Requirements
* Debian Buster/Ubuntu 18.04 Or Higher
* QEMU User-Mode
* Debian/Ubuntu: ``sudo apt install qemu-user``
* Arch: ``sudo pacman -S qemu-user``
* Client-Only Dependencies
* Graphics Drivers
* GTK+ 3

View File

@ -37,9 +37,6 @@ __attribute__((noreturn)) void safe_execvpe(const char *const argv[], const char
// Run
int ret = execvpe(argv[0], (char *const *) argv, (char *const *) envp);
if (ret == -1) {
if (errno == ENOENT && strcmp(argv[0], "qemu-qrm")) {
ERR("Unable to find QEMU! To install on Ubuntu/Debian, run \"sudo apt install qemu-user\". To install on Arch Linux, run \"sudo pacman -S qemu-user\".");
}
ERR("Unable To Execute Program: %s: %s", argv[0], strerror(errno));
} else {
IMPOSSIBLE();

@ -1 +1 @@
Subproject commit c18851f52ec9704eb06464058a600845ec1eada1
Subproject commit dd8a678a66f1967372e5a5e3deac41ebf65ee127