Initial Commit

This commit is contained in:
TheBrokenRail 2020-12-21 10:58:10 -05:00
commit a4376f1442
8 changed files with 122 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/out

7
DEBIAN/control Normal file
View File

@ -0,0 +1,7 @@
Package: minetest
Version: ${VERSION}
Maintainer: TheBrokenRail <connor24nolan@live.com>
Description: A free open-source voxel game engine with easy modding and game creation.
Homepage: https://www.minetest.net
Architecture: arm64
Depends: libc6, libstdc++6, libxxf86vm1, libgles1, libegl1, libsqlite3-0, libogg0, libvorbis0a, libopenal1, libcurl3-gnutls, libfreetype6, zlib1g, libgmp10, libjsoncpp1

15
Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM debian:bullseye
ENV DEBIAN_FRONTEND noninteractive
RUN mkdir /app
WORKDIR /app
ADD ./install-dependencies.sh /app/
RUN ./install-dependencies.sh
ADD ./build-irrlicht.sh /app/
RUN ./build-irrlicht.sh
ADD ./build-minetest.sh /app/
ADD ./DEBIAN /app/DEBIAN

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# Minetest For The PinePhone
This is a repository containing scripts to build a version of Minetest for the PinePhone. Just run ``./run.sh`` in a Terminal on a system with Docker installed, and a DEB will be produced in the ``out`` directory. This requires a x86_64 processor to run.

29
build-irrlicht.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
set -e
git clone --depth 1 https://github.com/zaki/irrlicht.git -b ogl-es
cd irrlicht
dos2unix source/Irrlicht/CIrrDeviceLinux.cpp
dos2unix source/Irrlicht/Makefile
dos2unix include/IrrCompileConfig.h
curl -L https://sourceforge.net/p/irrlicht/patches/_discuss/thread/97431334ce/c73a/attachment/multitouch.patch | patch -p1
disable_feature() {
sed -i "s/^#define $1.*$//g" include/IrrCompileConfig.h
}
enable_feature() {
sed -i "s/^\/\/#define $1.*$/#define $1/g" include/IrrCompileConfig.h
}
disable_feature _IRR_COMPILE_WITH_OPENGL_
disable_feature _IRR_COMPILE_WITH_OGLES2_
disable_feature _IRR_COMPILE_WITH_WEBGL1_
enable_feature _IRR_COMPILE_WITH_OGLES1_
enable_feature _IRR_LINUX_X11_XINPUT2_
cd source/Irrlicht
make NDEBUG=1 CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ -j$(nproc)

49
build-minetest.sh Executable file
View File

@ -0,0 +1,49 @@
#!/bin/sh
set -e
git clone https://github.com/TheBrokenRail/minetest.git -b desktop-touch
cd minetest
DEB_VERSION="$(git describe --tags --dirty)"
git clone --depth 1 https://github.com/minetest/minetest_game.git games/minetest_game
mkdir build-dir
cd build-dir
# Prepare Build
cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
-DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
-DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
-DENABLE_GLES=TRUE \
-DGLES_VERSION=1 \
-DENABLE_TOUCH=ON \
-DRUN_IN_PLACE=FALSE \
-DBUILD_UNITTESTS=FALSE \
-DIRRLICHT_LIBRARY=../../irrlicht/lib/Linux/libIrrlicht.a \
-DIRRLICHT_INCLUDE_DIR=../../irrlicht/include \
..
# Build
make -j$(nproc)
# Clean Up
rm -rf tmp
mkdir tmp
rm -rf /out/*
# Install Files
make install DESTDIR="$(pwd)/tmp"
# Prepare Debian
cp -r ../../DEBIAN tmp/DEBIAN
sed -i 's/${VERSION}/'"${DEB_VERSION}"'/g' tmp/DEBIAN/control
# Make DEB
dpkg -b tmp /out
# Clean Up
rm -rf tmp

8
install-dependencies.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
set -e
dpkg --add-architecture arm64
apt-get update
apt-get dist-upgrade -y
apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu make libc6-dev:arm64 cmake libbz2-dev:arm64 libpng-dev:arm64 libjpeg-dev:arm64 libxxf86vm-dev:arm64 libglvnd-dev:arm64 libsqlite3-dev:arm64 libogg-dev:arm64 libvorbis-dev:arm64 libopenal-dev:arm64 libcurl4-gnutls-dev:arm64 libfreetype6-dev:arm64 zlib1g-dev:arm64 libgmp-dev:arm64 libjsoncpp-dev:arm64 git libxi-dev:arm64 dos2unix dpkg-dev

11
run.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
set -e
# Build Dependencies
docker build --tag minetest-dev .
# Extract
rm -rf out
mkdir out
docker run --rm -v "$(pwd)/out:/out" minetest-dev ./build-minetest.sh