mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-22 08:08:53 -05:00
[CI] Create an Appimage for 64bit builds (#570)
* [CI] Create AppImage file * [CI] Updated Jenkinsfile * [MISC] fix indentation * [MISC] Fix indentation * [MISC] Fix indentation * [CI] 7z appimage and readme
This commit is contained in:
parent
a2d64864dd
commit
fd0fb25de1
46
Dockerfile
46
Dockerfile
@ -1,38 +1,46 @@
|
|||||||
|
FROM ubuntu:20.04 as build
|
||||||
|
|
||||||
FROM ubuntu:21.04 as build
|
|
||||||
|
|
||||||
ENV LANG C.UTF-8
|
ENV LANG C.UTF-8
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
RUN dpkg --add-architecture i386 && \
|
RUN apt-get update && \
|
||||||
apt-get update && \
|
|
||||||
apt-get upgrade -y && \
|
apt-get upgrade -y && \
|
||||||
apt-get install -y \
|
apt-get install -y \
|
||||||
binutils:i386 \
|
binutils \
|
||||||
gcc-10:i386 \
|
gcc-10 \
|
||||||
g++-10:i386 \
|
g++-10 \
|
||||||
python3.10 \
|
p7zip-full \
|
||||||
python \
|
python3.9 \
|
||||||
make \
|
make \
|
||||||
cmake \
|
cmake \
|
||||||
|
curl \
|
||||||
git \
|
git \
|
||||||
lld \
|
lld \
|
||||||
libsdl2-dev:i386 \
|
libsdl2-dev \
|
||||||
zlib1g-dev:i386 \
|
zlib1g-dev \
|
||||||
libbz2-dev:i386 \
|
libbz2-dev \
|
||||||
libpng-dev:i386 \
|
libpng-dev \
|
||||||
libgles2-mesa-dev && \
|
libgles2-mesa-dev && \
|
||||||
ln -sf /usr/bin/python3.10 /usr/bin/python3 && \
|
|
||||||
ln -s /usr/bin/gcc-10 /usr/bin/gcc && \
|
|
||||||
ln -s /usr/bin/gcc-10 /usr/bin/cc && \
|
|
||||||
ln -s /usr/bin/g++-10 /usr/bin/g++ && \
|
ln -s /usr/bin/g++-10 /usr/bin/g++ && \
|
||||||
ln -s /usr/bin/g++-10 /usr/bin/c++
|
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10 && \
|
||||||
|
gcc --version && \
|
||||||
|
g++ --version
|
||||||
|
|
||||||
|
RUN apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/apt /var/lib/cache /var/lib/log
|
||||||
|
|
||||||
RUN git clone https://github.com/Perlmint/glew-cmake.git && \
|
RUN git clone https://github.com/Perlmint/glew-cmake.git && \
|
||||||
cmake glew-cmake && \
|
cmake glew-cmake && \
|
||||||
make -j$(nproc) && \
|
make -j$(nproc) && \
|
||||||
make install ARCH64=false
|
make install
|
||||||
|
|
||||||
|
ENV SDL2VER=2.0.22
|
||||||
|
RUN curl -sLO https://libsdl.org/release/SDL2-${SDL2VER}.tar.gz && \
|
||||||
|
tar -xzf SDL2-${SDL2VER}.tar.gz && \
|
||||||
|
cd SDL2-${SDL2VER} && \
|
||||||
|
./configure --prefix=/usr && \
|
||||||
|
make && make install && \
|
||||||
|
rm ../SDL2-${SDL2VER}.tar.gz && \
|
||||||
|
cp -av /lib/libSDL* /lib/x86_64-linux-gnu/
|
||||||
|
|
||||||
RUN mkdir /soh
|
RUN mkdir /soh
|
||||||
WORKDIR /soh
|
WORKDIR /soh
|
||||||
|
9
Jenkinsfile
vendored
9
Jenkinsfile
vendored
@ -104,10 +104,11 @@ pipeline {
|
|||||||
mv OTRGui/build/OTRGui build/
|
mv OTRGui/build/OTRGui build/
|
||||||
mv OTRGui/build/assets build/
|
mv OTRGui/build/assets build/
|
||||||
mv ZAPDTR/ZAPD.out build/assets/extractor/
|
mv ZAPDTR/ZAPD.out build/assets/extractor/
|
||||||
mv README.md build/readme.txt
|
mv README.md readme.txt
|
||||||
cd build
|
|
||||||
7z a soh-linux.7z soh.elf OTRGui assets readme.txt
|
docker exec sohcont appimage/appimage.sh
|
||||||
mv soh-linux.7z ../
|
|
||||||
|
7z a soh-linux.7z SOH-Linux.AppImage readme.txt
|
||||||
|
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
37
appimage/appimage.sh
Executable file
37
appimage/appimage.sh
Executable file
@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
curl -sSfLO "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
|
||||||
|
chmod a+x linuxdeploy*.AppImage
|
||||||
|
curl -sSfLO "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
|
||||||
|
chmod a+x appimagetool*.AppImage
|
||||||
|
|
||||||
|
mkdir -p AppDir/usr/bin
|
||||||
|
cp appimage/{soh.desktop,soh.png,soh.sh} AppDir/
|
||||||
|
curl -sSfL https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt -o AppDir/usr/bin/gamecontrollerdb.txt
|
||||||
|
|
||||||
|
mkdir -p AppDir/usr/share/applications
|
||||||
|
mkdir -p AppDir/usr/share/icons/hicolor/scalable/apps
|
||||||
|
mkdir -p AppDir/usr/lib
|
||||||
|
|
||||||
|
mv AppDir/soh.sh AppDir/usr/bin
|
||||||
|
cp -r build/* AppDir/usr/bin
|
||||||
|
|
||||||
|
chmod +x AppDir/usr/bin/{soh.elf,OTRGui,soh.sh}
|
||||||
|
|
||||||
|
cd AppDir && ln -s ./usr/bin/soh.sh ./AppRun && cd ..
|
||||||
|
|
||||||
|
export UPD_INFO="gh-releases-zsync|HarbourMasters|Shipwright-linux|zelda64|SOH-Linux.AppImage.zsync"
|
||||||
|
./linuxdeploy-x86_64.AppImage --appimage-extract-and-run \
|
||||||
|
--appdir=./AppDir/ \
|
||||||
|
-d ./AppDir/soh.desktop \
|
||||||
|
-i ./AppDir/soh.png \
|
||||||
|
-e ./AppDir/usr/bin/soh.elf \
|
||||||
|
-e ./AppDir/usr/bin/assets/extractor/ZAPD.out
|
||||||
|
|
||||||
|
mv ./AppDir/usr/bin/ZAPD.out ./AppDir/usr/bin/assets/extractor/ZAPD.out
|
||||||
|
cd ./AppDir/usr/bin/assets/extractor/
|
||||||
|
patchelf --set-rpath "\$ORIGIN/../../../lib" ZAPD.out
|
||||||
|
cd /soh
|
||||||
|
|
||||||
|
./appimagetool-x86_64.AppImage --appimage-extract-and-run ./AppDir "SOH-Linux.AppImage" -u "gh-releases-zsync|HarbourMasters|Shipwright-linux|zelda64|SOH-Linux.AppImage.zsync"
|
||||||
|
|
9
appimage/soh.desktop
Normal file
9
appimage/soh.desktop
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Version=1.0
|
||||||
|
Name=SOH
|
||||||
|
Exec=AppRun
|
||||||
|
Terminal=false
|
||||||
|
Icon=soh
|
||||||
|
Type=Application
|
||||||
|
Categories=Game;
|
||||||
|
Name[en_US]=
|
41
appimage/soh.sh
Normal file
41
appimage/soh.sh
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
HERE="$(dirname "$(readlink -f "${0}")")"/../..
|
||||||
|
|
||||||
|
export PATH=$HERE/bin:$HERE/usr/bin:$PATH
|
||||||
|
|
||||||
|
while [[ ! -e $PWD/oot.otr ]]; do
|
||||||
|
export ASSETDIR=$(mktemp -d /tmp/assets-XXXXX)
|
||||||
|
ln -s $HERE/usr/bin/{assets,soh.elf,OTRGui} $ASSETDIR
|
||||||
|
export OLDPWD=$PWD
|
||||||
|
mkdir -p $ASSETDIR/tmp
|
||||||
|
mkdir -p $ASSETDIR/Extract/assets
|
||||||
|
if [ -e $PWD/*.*64 ]; then
|
||||||
|
ln -s $OLDPWD/*.*64 $ASSETDIR/tmp/rom.z64
|
||||||
|
cp -r $ASSETDIR/assets/game/ship_of_harkinian $ASSETDIR/Extract/assets/
|
||||||
|
cd $ASSETDIR
|
||||||
|
case $(sha1sum -b $ASSETDIR/tmp/rom.z64 | awk '{ print $1 }') in
|
||||||
|
cee6bc3c2a634b41728f2af8da54d9bf8cc14099)
|
||||||
|
ROM=GC_NMQ_D;;
|
||||||
|
0227d7c0074f2d0ac935631990da8ec5914597b4)
|
||||||
|
ROM=GC_NMQ_PAL_F;;
|
||||||
|
*)
|
||||||
|
echo -e "\nrom hash does not match\n"
|
||||||
|
exit;;
|
||||||
|
esac
|
||||||
|
echo "Processing..."
|
||||||
|
assets/extractor/ZAPD.out ed -eh -i assets/extractor/xmls/${ROM} -b tmp/rom.z64 -fl assets/extractor/filelists -o placeholder -osf placeholder -gsf 1 -rconf assets/extractor/Config_${ROM}.xml -se OTR > /dev/null 2>&1
|
||||||
|
cp "$ASSETDIR"/oot.otr $OLDPWD
|
||||||
|
echo "Restart $APPIMAGE to play!"
|
||||||
|
sleep 3
|
||||||
|
rm -r "$ASSETDIR"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo -e "\nPlace ROM in this folder\n"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
cd $OWD
|
||||||
|
ln -s "$HERE/usr/bin/gamecontrollerdb.txt" $PWD
|
||||||
|
"$HERE/usr/bin/soh.elf"
|
||||||
|
unlink $PWD/gamecontrollerdb.txt
|
||||||
|
exit
|
@ -17,6 +17,7 @@ WARN := -Wall -Wextra -Werror \
|
|||||||
-Wno-unused-function \
|
-Wno-unused-function \
|
||||||
-Wno-parentheses \
|
-Wno-parentheses \
|
||||||
-Wno-narrowing \
|
-Wno-narrowing \
|
||||||
|
-Wno-error=stringop-overflow \
|
||||||
-Wno-missing-field-initializers \
|
-Wno-missing-field-initializers \
|
||||||
-Wno-error=multichar
|
-Wno-error=multichar
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user