From 49f8da2a8021757dca039e5f0137269de5403753 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Fri, 10 Jun 2022 21:59:57 -0400 Subject: [PATCH] Fix Build --- Dockerfile | 19 ++++--------------- media-layer/core/src/media.c | 2 +- media-layer/core/src/screenshot.c | 5 +++-- mods/src/chat/chat.cpp | 4 +++- mods/src/chat/chat.h | 2 ++ mods/src/chat/ui.c | 7 ++++++- mods/src/feature/feature.h | 2 ++ mods/src/game-mode/ui.cpp | 5 ++++- mods/src/init/init.c | 2 ++ mods/src/init/init.h | 2 ++ mods/src/multiplayer/multiplayer.cpp | 4 +++- mods/src/server/server.cpp | 4 +++- scripts/ci/Dockerfile | 3 --- scripts/install-dependencies.sh | 4 ++-- 14 files changed, 37 insertions(+), 28 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9a0be196..bb951af9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,24 +3,13 @@ FROM debian:bullseye-slim # Install RUN \ apt-get update && \ - apt-get install -y tini sed && \ + apt-get install -y tini sed patchelf qemu-user && \ apt-get --fix-broken install -y && \ rm -rf /var/lib/apt/lists/* -# Copy AppImage +# Copy RUN mkdir /app -ADD ./out/minecraft-pi-reborn-server-*-amd64.AppImage /app - -# Extract AppImage -WORKDIR /app -RUN \ - sed -i '0,/AI\x02/{s|AI\x02|\x00\x00\x00|}' ./*.AppImage && \ - ./*.AppImage --appimage-extract && \ - rm -f ./*.AppImage - -# Setup AppImage -ENV OWD=/data -ENV APPDIR=/app/squashfs-root +ADD ./out/server-amd64 /app # Setup Working Directory RUN mkdir /data @@ -28,4 +17,4 @@ WORKDIR /data # Setup Entrypoint ENTRYPOINT ["/usr/bin/tini", "--"] -CMD ["/app/squashfs-root/AppRun"] +CMD ["/app/usr/bin/minecraft-pi-reborn-server"] diff --git a/media-layer/core/src/media.c b/media-layer/core/src/media.c index 15b1907b..c4f98cd1 100644 --- a/media-layer/core/src/media.c +++ b/media-layer/core/src/media.c @@ -1,13 +1,13 @@ #include #include +#include #ifndef MCPI_HEADLESS_MODE #define GLFW_INCLUDE_NONE #include #endif -#include #include #include diff --git a/media-layer/core/src/screenshot.c b/media-layer/core/src/screenshot.c index 32921429..69a018a7 100644 --- a/media-layer/core/src/screenshot.c +++ b/media-layer/core/src/screenshot.c @@ -1,3 +1,6 @@ +// Config Needs To Load First +#include + // Screenshot Code Is Useless In Headless Mode #ifndef MCPI_HEADLESS_MODE @@ -12,8 +15,6 @@ #include #include - -#include #include // Ensure Screenshots Folder Exists diff --git a/mods/src/chat/chat.cpp b/mods/src/chat/chat.cpp index 28b615ab..284a48bf 100644 --- a/mods/src/chat/chat.cpp +++ b/mods/src/chat/chat.cpp @@ -1,3 +1,6 @@ +// Config Needs To Load First +#include + #include #include #include @@ -6,7 +9,6 @@ #include #endif -#include #include #ifndef MCPI_SERVER_MODE #include diff --git a/mods/src/chat/chat.h b/mods/src/chat/chat.h index 07d4e9b2..8c8d6deb 100644 --- a/mods/src/chat/chat.h +++ b/mods/src/chat/chat.h @@ -1,5 +1,7 @@ #pragma once +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/mods/src/chat/ui.c b/mods/src/chat/ui.c index 7a7385bf..55e4b2e5 100644 --- a/mods/src/chat/ui.c +++ b/mods/src/chat/ui.c @@ -1,10 +1,14 @@ +// Config Needs To Load First +#include + +// Chat UI Code Is Useless In Headless Mode #ifndef MCPI_SERVER_MODE + #include #include #include #include -#include #include #include "chat.h" @@ -82,4 +86,5 @@ void chat_open() { pthread_create(&thread, NULL, chat_thread, NULL); } } + #endif diff --git a/mods/src/feature/feature.h b/mods/src/feature/feature.h index 528e8dc1..cbd1feca 100644 --- a/mods/src/feature/feature.h +++ b/mods/src/feature/feature.h @@ -1,5 +1,7 @@ #pragma once +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/mods/src/game-mode/ui.cpp b/mods/src/game-mode/ui.cpp index 046869d3..4958d704 100644 --- a/mods/src/game-mode/ui.cpp +++ b/mods/src/game-mode/ui.cpp @@ -1,3 +1,7 @@ +// Config Needs To Load First +#include + +// Game Mode UI Code Is Useless In Headless Mode #ifndef MCPI_SERVER_MODE #include @@ -6,7 +10,6 @@ #include #include -#include #include #include diff --git a/mods/src/init/init.c b/mods/src/init/init.c index ccf156a8..9ab35bd1 100644 --- a/mods/src/init/init.c +++ b/mods/src/init/init.c @@ -1,3 +1,5 @@ +#include + #include "init.h" #include diff --git a/mods/src/init/init.h b/mods/src/init/init.h index 0e3d3450..3b17ac8d 100644 --- a/mods/src/init/init.h +++ b/mods/src/init/init.h @@ -1,5 +1,7 @@ #pragma once +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/mods/src/multiplayer/multiplayer.cpp b/mods/src/multiplayer/multiplayer.cpp index 462e51e3..b687ea4b 100644 --- a/mods/src/multiplayer/multiplayer.cpp +++ b/mods/src/multiplayer/multiplayer.cpp @@ -1,3 +1,6 @@ +// Config Needs To Load First +#include + #ifdef MCPI_SERVER_MODE #error "External Server Code Requires Client Mode" #endif @@ -7,7 +10,6 @@ #include #include -#include #include #include "../home/home.h" diff --git a/mods/src/server/server.cpp b/mods/src/server/server.cpp index f55487f6..776d6d37 100644 --- a/mods/src/server/server.cpp +++ b/mods/src/server/server.cpp @@ -1,3 +1,6 @@ +// Config Needs To Load First +#include + #ifndef MCPI_SERVER_MODE #error "Server Code Requires Server Mode" #endif @@ -16,7 +19,6 @@ #include -#include #include #include "server_properties.h" diff --git a/scripts/ci/Dockerfile b/scripts/ci/Dockerfile index bdcd6001..0a5e0da7 100644 --- a/scripts/ci/Dockerfile +++ b/scripts/ci/Dockerfile @@ -1,8 +1,5 @@ FROM buildpack-deps:bullseye -# Setup -ENV ARM_PACKAGES_SUPPORTED=1 - # Install ADD ./scripts/install-dependencies.sh / RUN \ diff --git a/scripts/install-dependencies.sh b/scripts/install-dependencies.sh index 897d2719..16393a70 100755 --- a/scripts/install-dependencies.sh +++ b/scripts/install-dependencies.sh @@ -76,10 +76,10 @@ run() { desktop-file-utils \ libgdk-pixbuf2.0-dev \ fakeroot \ - strace \ - fuse \ gtk-update-icon-cache \ shared-mime-info \ + squashfs-tools \ + zsync \ sed # Install Queue