Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7d4935e
nits
Un1q32 Feb 25, 2026
28995f9
these shouldnt be executable
Un1q32 Feb 25, 2026
0cf1f65
kinda not really working
Un1q32 Feb 25, 2026
4dadd2c
working better
Un1q32 Feb 25, 2026
be9f7ae
debug
Un1q32 Feb 25, 2026
f38d6d4
fix permission
Un1q32 Feb 25, 2026
199c7c0
comments
Un1q32 Feb 25, 2026
1241510
update comment
Un1q32 Feb 25, 2026
ee13431
arch
Un1q32 Feb 25, 2026
7073a24
allow passing cmake args
Un1q32 Feb 25, 2026
72d416c
do this instead
Un1q32 Feb 25, 2026
429f627
ccache
Un1q32 Feb 25, 2026
45986b4
allow a different runtime version
Un1q32 Feb 25, 2026
0cd7b49
first attempt
Un1q32 Feb 25, 2026
fd97416
fix flathub
Un1q32 Feb 25, 2026
010a088
fix
Un1q32 Feb 25, 2026
6c26682
alr man
Un1q32 Feb 25, 2026
fdd23f8
nits
Un1q32 Feb 25, 2026
ea292e0
i386 flatpak
Un1q32 Feb 25, 2026
701f1b3
turn off for now
Un1q32 Feb 25, 2026
3566117
fix maybe
Un1q32 Feb 25, 2026
ee3759b
maybe
Un1q32 Feb 25, 2026
4d13552
fix
Un1q32 Feb 25, 2026
384d519
ok
Un1q32 Feb 25, 2026
a8c0a04
what are you
Un1q32 Feb 25, 2026
7eb8d10
try this
Un1q32 Feb 25, 2026
42d4a0a
ok
Un1q32 Feb 25, 2026
2da55ea
fix
Un1q32 Feb 25, 2026
897ad74
fix
Un1q32 Feb 25, 2026
39e4a60
i386 flatpak, prolly wont use it
Un1q32 Feb 26, 2026
ad60e24
no way its taht easy
Un1q32 Feb 26, 2026
1865ea5
a
Un1q32 Feb 26, 2026
ee4b063
release flatpak
Un1q32 Feb 26, 2026
6631766
add .desktop file and icons
Un1q32 Feb 26, 2026
e415893
shorten
Un1q32 Feb 26, 2026
1c74fc4
bin variable
Un1q32 Feb 26, 2026
67d2aeb
dont need this
Un1q32 Feb 26, 2026
befe3e6
review
Un1q32 Feb 27, 2026
0549b9b
fix
Un1q32 Feb 27, 2026
5ed1d41
do it here too
Un1q32 Feb 27, 2026
a4a2c63
change description
Un1q32 Feb 27, 2026
90a41da
fix
Un1q32 Feb 27, 2026
90b3262
bruh
Un1q32 Feb 27, 2026
042a8a2
name
Un1q32 Feb 27, 2026
ffdbb75
comment flatpak build workflows
Un1q32 Feb 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 72 additions & 3 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,24 @@ jobs:
fail-fast: false
matrix:
include:
- name: SDL 2 (OGL)
- name: x86_64 SDL 2 (OGL)
flags: '-DREMCPE_PLATFORM=sdl2 -DREMCPE_GFX_API=OGL'
packages: 'libsdl2-dev'
- name: SDL 2 (OGL + Shaders)
runner: ubuntu-24.04
- name: x86_64 SDL 2 (OGL + Shaders)
flags: '-DREMCPE_PLATFORM=sdl2 -DREMCPE_GFX_API=OGL_SHADERS'
packages: 'libsdl2-dev'
runner: ubuntu-24.04
- name: aarch64 SDL 2 (OGL)
flags: '-DREMCPE_PLATFORM=sdl2 -DREMCPE_GFX_API=OGL'
packages: 'libsdl2-dev'
runner: ubuntu-24.04-arm
- name: aarch64 SDL 2 (OGL + Shaders)
flags: '-DREMCPE_PLATFORM=sdl2 -DREMCPE_GFX_API=OGL_SHADERS'
packages: 'libsdl2-dev'
runner: ubuntu-24.04-arm
name: Linux (${{ matrix.name }})
runs-on: ubuntu-24.04
runs-on: ${{ matrix.runner }}
steps:
- name: Get Time
id: get-time
Expand Down Expand Up @@ -63,6 +73,65 @@ jobs:
- name: Pack cache
run: cd ~ && tar cJf ccache.tar.xz .cache/ccache

# flatpak:
# strategy:
# fail-fast: false
# matrix:
# include:
# - name: x86_64 SDL 2 (OGL)
# gfx-api: OGL
# arch: x86_64
# runner: ubuntu-24.04
# - name: x86_64 SDL 2 (OGL + Shaders)
# gfx-api: OGL_SHADERS
# arch: x86_64
# runner: ubuntu-24.04
# - name: aarch64 SDL 2 (OGL)
# gfx-api: OGL
# arch: aarch64
# runner: ubuntu-24.04-arm
# - name: aarch64 SDL 2 (OGL + Shaders)
# gfx-api: OGL_SHADERS
# arch: aarch64
# runner: ubuntu-24.04-arm
# name: Flatpak (${{ matrix.name }})
# runs-on: ${{ matrix.runner }}
# steps:
# - name: Get Time
# id: get-time
# run: echo "time=$(date -u '+%Y-%m-%d-%H:%M:%S')" >> $GITHUB_OUTPUT
# - uses: actions/cache@v5
# with:
# path: ~/ccache.tar.xz
# key: flatpak-artifact-${{ matrix.name }}-${{ steps.get-time.outputs.time }}
# restore-keys: flatpak-artifact-${{ matrix.name }}-
# - name: Unpack cache
# run: cd ~ && [ -f ccache.tar.xz ] && tar xf ccache.tar.xz || true
# - name: Checkout Repository
# uses: actions/checkout@v6
# with:
# submodules: true
# - name: Install Dependencies
# run: |
# sudo apt-get update
# sudo apt-get install --no-install-recommends -y flatpak
# flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# flatpak --user install -y \
# org.freedesktop.Platform/${{ matrix.arch }}/25.08 \
# org.freedesktop.Sdk/${{ matrix.arch }}/25.08
# - name: Build
# run: ./platforms/linux/build-flatpak.sh
# env:
# NOSTRIP: 1
# ARCH: ${{ matrix.arch }}
# REMCPE_GFX_API: ${{ matrix.gfx }}
# - uses: actions/upload-artifact@v6
# with:
# name: Flatpak (${{ matrix.name }})
# path: platforms/linux/build-flatpak/ReMCPE-${{ matrix.arch }}.flatpak
# - name: Pack cache
# run: cd ~ && tar cJf ccache.tar.xz .cache/ccache

# linux32:
# strategy:
# fail-fast: false
Expand Down
54 changes: 50 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ jobs:
fail-fast: false
matrix:
include:
- name: SDL 2
- name: x86_64 SDL 2
flags: '-DREMCPE_PLATFORM=sdl2 -DREMCPE_GFX_API=OGL'
packages: 'libsdl2-dev'
runner: ubuntu-24.04
arch: x86_64
- name: aarch64 SDL 2
flags: '-DREMCPE_PLATFORM=sdl2 -DREMCPE_GFX_API=OGL'
packages: 'libsdl2-dev'
runner: ubuntu-24.04-arm
arch: aarch64
name: Linux (${{ matrix.name }})
runs-on: ubuntu-24.04
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout Repository
uses: actions/checkout@v6
Expand Down Expand Up @@ -43,12 +50,51 @@ jobs:
run: |
mkdir ReMCPE
mv game/assets build/reminecraftpe ReMCPE
tar -czf ReMCPE-Linux-x86_64.tar.gz ReMCPE
tar -czf ReMCPE-Linux-${{ matrix.arch }}.tar.gz ReMCPE
- uses: alexellis/upload-assets@0.4.1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["ReMCPE-Linux-x86_64.tar.gz"]'
asset_paths: '["ReMCPE-Linux-${{ matrix.arch }}.tar.gz"]'

# flatpak:
# strategy:
# fail-fast: false
# matrix:
# include:
# - name: x86_64 SDL 2
# gfx: OGL
# arch: x86_64
# runner: ubuntu-24.04
# - name: aarch64 SDL 2
# gfx: OGL
# arch: aarch64
# runner: ubuntu-24.04-arm
# name: Flatpak (${{ matrix.name }})
# runs-on: ${{ matrix.runner }}
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v6
# with:
# submodules: true
# - name: Install Dependencies
# run: |
# sudo apt-get update
# sudo apt-get install --no-install-recommends -y flatpak
# flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# flatpak --user install -y \
# org.freedesktop.Platform/${{ matrix.arch }}/25.08 \
# org.freedesktop.Sdk/${{ matrix.arch }}/25.08
# - name: Build
# run: ./platforms/linux/build-flatpak.sh
# env:
# ARCH: ${{ matrix.arch }}
# REMCPE_GFX_API: ${{ matrix.gfx }}
# - uses: alexellis/upload-assets@0.4.1
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# asset_paths: '["platforms/linux/build-flatpak/ReMCPE-Linux-${{ matrix.arch }}.flatpak"]'

# linux32:
# strategy:
Expand Down
Binary file added game/assets/app/icons/mipmap/icon_128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added game/assets/app/icons/mipmap/icon_256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified game/assets/mob/cow.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified game/assets/resource_packs/minecraft/.gitignore
100755 → 100644
Empty file.
Empty file modified game/assets/resource_packs/minecraft/pack.txt
100755 → 100644
Empty file.
3 changes: 2 additions & 1 deletion platforms/ios/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# shellcheck disable=2086
set -e

# cd to the directory this script is in
[ "${0%/*}" = "$0" ] && scriptroot="." || scriptroot="${0%/*}"
cd "$scriptroot"

Expand Down Expand Up @@ -191,7 +192,7 @@ for target in $targets; do
-DCMAKE_C_FLAGS="$cflags" \
-DCMAKE_CXX_FLAGS="$cflags" \
-DWERROR="${WERROR:-OFF}"
make -j"$ncpus"
cmake --build . --parallel "$ncpus"

cd ..
done
Expand Down
1 change: 1 addition & 0 deletions platforms/linux/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build-flatpak
128 changes: 128 additions & 0 deletions platforms/linux/build-flatpak.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#!/bin/sh
set -e

# cd to the directory this script is in
[ "${0%/*}" = "$0" ] && scriptroot="." || scriptroot="${0%/*}"
cd "$scriptroot"

arch="${ARCH:-x86_64}"
# Must be kept in sync with the cmake executable name
bin='reminecraftpe'

bundleid='io.github.reminecraftpe'

platformdir=$PWD

workdir="$PWD/build-flatpak/work"

if command -v nproc >/dev/null; then
ncpus="$(nproc)"
else
ncpus="$(sysctl -n hw.ncpu)"
fi

if [ -n "$DEBUG" ]; then
build=Debug
else
build=Release
fi

rm -rf build-flatpak/output build-flatpak/work/build
mkdir -p build-flatpak/work/build
cd build-flatpak

runtime="${FLATPAK_RUNTIME_VERSION:-25.08}"
[ "$ARCH" = 'i386' ] && runtime='1.6'

flatpak build-init output "$bundleid" "org.freedesktop.Sdk/$arch" "org.freedesktop.Platform/$arch" "$runtime"

cd work

fpbuild() {
flatpak build ../../output "$@"
}

cmake=cmake
set -- -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON

toolchainver=2
if [ "$ARCH" = 'i386' ]; then
if [ "$(cat toolchain/toolchainver 2>/dev/null)" != "$toolchainver" ]; then
printf '\nBuilding i386 toolchain...\n\n'

cmake_version='4.2.3'
wget -O- "https://github.com/Kitware/CMake/archive/refs/tags/v$cmake_version.tar.gz" | tar -xz
cd "CMake-$cmake_version"
fpbuild ./bootstrap \
--prefix="$workdir/toolchain" \
--parallel="$ncpus" \
--enable-ccache \
--system-zlib \
--system-bzip2 \
--system-curl \
--system-expat \
--system-liblzma
fpbuild make -j"$ncpus"
fpbuild make install/strip -j"$ncpus"
cd ..
rm -rf "CMake-$cmake_version"

rm -rf toolchain/doc share/emacs share/vim share/bash-completion

printf '%s' "$toolchainver" > toolchain/toolchainver
fi

set -- \
-DREMCPE_VENDORED_SDL2=ON \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++

cmake="$workdir/toolchain/bin/cmake"
fi

cd build
fpbuild "$cmake" "$platformdir/../.." \
-DCMAKE_BUILD_TYPE="$build" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DREMCPE_PLATFORM="${REMCPE_PLATFORM:-sdl2}" \
-DREMCPE_GFX_API="${REMCPE_GFX_API:-OGL}" \
"$@"
fpbuild "$cmake" --build . --parallel "$ncpus"
fpbuild mkdir -p /app/bin /app/libexec /app/share/applications
[ -z "$DEBUG" ] && [ -z "$NOSTRIP" ] &&
fpbuild strip "$bin"
fpbuild cp "$bin" /app/libexec
fpbuild cp -a "$(readlink assets)" /app
# rungame.sh is just a script that does a cd to the directory with the assets
fpbuild cp "$platformdir/rungame.sh" /app/bin
fpbuild cp "$platformdir/$bundleid.desktop" /app/share/applications
for size in 48 64 72 96 128 192 256; do
fpbuild install -Dm644 "assets/app/icons/mipmap/icon_${size}x${size}.png" \
"/app/share/icons/hicolor/${size}x${size}/apps/$bundleid.png"
done

cd ../..

# permissions given (in order of specification):
# X11 (when wayland is unavailable)
# Wayland
# Audio (both input and output)
# Device access (USB, game controllers, GPU, etc)*
# Network access
#
# *: Flatpak has --device=dri for GPU access, and --device=input for
# input devices (controllers), which would be enough for us, but it was
# added relatively recently, and older flatpak versions don't understand
# it, so we just do --device=all to make everything work on old systems.
flatpak build-finish output \
--share=ipc \
--socket=fallback-x11 \
--socket=wayland \
--socket=pulseaudio \
--device=all \
--share=network \
--command=rungame.sh

flatpak build-export repo output
flatpak build-bundle --arch "$arch" repo "ReMCPE-$arch.flatpak" "$bundleid"
10 changes: 10 additions & 0 deletions platforms/linux/io.github.reminecraftpe.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Name=ReMinecraftPE
GenericName=ReMinecraftPE
Comment=A custom experience based on Minecraft PE as of 2011
Exec=rungame.sh
Icon=io.github.reminecraftpe
Terminal=false
Type=Application
Categories=Game;Simulation;
Keywords=sandbox;world;mining;crafting;blocks;minecraft;mcpe;
3 changes: 3 additions & 0 deletions platforms/linux/rungame.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
cd /app || exit 1
exec ./libexec/reminecraftpe
6 changes: 4 additions & 2 deletions platforms/macos/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# shellcheck disable=2086
set -e

# cd to the directory this script is in
[ "${0%/*}" = "$0" ] && scriptroot="." || scriptroot="${0%/*}"
cd "$scriptroot"

Expand Down Expand Up @@ -52,7 +53,7 @@ if ! [ -d "$x86_64_sdk" ] || ! [ -d "$arm64_sdk" ] || ! [ -d "$old_sdk" ] || [ "
mv MacOSX10.5.sdk "$old_sdk"
# patch the sdk to fix a bug
cd "$old_sdk"
patch -p1 < "$platformdir/leopard-sdk-fix.patch"
patch -fNp1 < "$platformdir/leopard-sdk-fix.patch"
)
wait
rm ./*.tar.bz2 ./*.tar.xz
Expand Down Expand Up @@ -268,6 +269,7 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th
cd ../..
rm -rf "gcc-$gcc_version"

rm -rf toolchain-ppc/share
printf '%s' "$ppctoolchainver" > toolchain-ppc/toolchainver
outdated_ppc_toolchain=1
fi
Expand Down Expand Up @@ -405,7 +407,7 @@ for target in $targets; do
-DCMAKE_CXX_FLAGS="$target_cflags" \
-DWERROR="${WERROR:-OFF}" \
"$@"
make -j"$ncpus"
cmake --build . --parallel "$ncpus"

cd ..
done
Expand Down
2 changes: 1 addition & 1 deletion platforms/sdl/sdl2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if(ANDROID OR REMCPE_WIN32)
set_target_properties(SDL2 PROPERTIES CXX_STANDARD 11)
target_link_libraries(SDL INTERFACE SDL2::SDL2)
target_compile_options(SDL2 PRIVATE -w)
elseif(APPLE)
elseif(APPLE OR REMCPE_VENDORED_SDL2)
# Use Vendored SDL2 (explicitly static)
add_subdirectory(../../../thirdparty/SDL2/src SDL EXCLUDE_FROM_ALL)
set_target_properties(SDL2-static PROPERTIES CXX_STANDARD 11)
Expand Down