forked from kazzmir/paintown
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: juvinious <[email protected]>
- Loading branch information
Showing
16 changed files
with
1,168 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: steam cross compile build (sniper) | ||
|
||
on: | ||
push | ||
|
||
jobs: | ||
build: | ||
name: Compile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run build | ||
run: | | ||
./easy-compile-docker-steam --no-install | ||
- name: Run Release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: ./release/release-steam | ||
|
||
- name: Archive Folder | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: artifact | ||
path: ${{github.workspace}}/*.zip | ||
|
||
publish-release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Download Artifact | ||
if: startsWith(github.ref, 'refs/tags/') | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
path: ${{github.workspace}} | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: ${{ github.workspace }}/*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Build: docker build -t paintown-steam-build -f docker/Dockerfile.steam . | ||
# Access shell: docker run --rm -it --entrypoint /bin/bash paintown-steam-build | ||
# Use sniper build (https://github.com/ValveSoftware/steam-runtime?tab=readme-ov-file#installation) | ||
FROM registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest | ||
|
||
RUN apt update && \ | ||
apt install -y sudo wget git ninja-build make python3-pip && \ | ||
apt remove -y meson | ||
|
||
# Get latest meson | ||
RUN pip install meson && \ | ||
ln -s /usr/local/bin/meson /usr/bin/meson | ||
|
||
# Build dirs | ||
RUN mkdir -p /build/cross/include/SDL2 | ||
|
||
COPY src /build/src | ||
COPY meson.build /build | ||
COPY misc/steam/steam.txt /build/steam.txt | ||
COPY meson.options /build | ||
|
||
# Create makefile for native build | ||
RUN echo ".PHONY: all clean\n\ | ||
\n\ | ||
steam: build-steam\n\ | ||
\t(cd build-steam; meson configure -Dbuild_tests=false)\n\ | ||
\tmeson compile -C build-steam\n\ | ||
\n\ | ||
build-steam:\n\ | ||
\tmkdir build-steam\n\ | ||
\tmeson setup --native-file steam.txt build-steam\n\ | ||
\n\ | ||
clean:\n\ | ||
\trm -fr build-steam" > /build/Makefile | ||
|
||
# Temp directory | ||
RUN mkdir -p /build/.tmp | ||
|
||
# SDL_gfx is not installed by default, we may need to statically link it if it doesn't work on steam deck or with steam natively | ||
RUN git clone https://github.com/ferzkopp/SDL2_gfx.git -- /build/.tmp/SDL_gfx | ||
RUN echo "sources = [\n\ | ||
'SDL2_framerate.c',\n\ | ||
'SDL2_gfxPrimitives.c',\n\ | ||
'SDL2_imageFilter.c',\n\ | ||
'SDL2_rotozoom.c',\n\ | ||
]\n\ | ||
\n\ | ||
includes = include_directories('.', '../../src')\n\ | ||
\n\ | ||
sdl_graphics_library = static_library('SDL2_gfx', sources,\n\ | ||
include_directories: [includes],\n\ | ||
dependencies: [sdl_dependency, zlib_dependency],\n\ | ||
)\n" > /build/.tmp/SDL_gfx/meson.build | ||
RUN cp /build/.tmp/SDL_gfx/*.h /build/cross/include/SDL2 | ||
|
||
RUN cd /build && make | ||
|
||
CMD [ "/bin/bash" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/bin/bash -e | ||
|
||
docker build -t paintown-steam-build -f docker/Dockerfile.steam . | ||
mkdir -p ${PWD}/steam-bin | ||
docker run --rm -iv${PWD}:/paintown-bin paintown-steam-build sh -s <<EOF | ||
chown $(id -u):$(id -g) /build/build-steam/paintown | ||
cp -a /build/build-steam/paintown /paintown-bin/steam-bin | ||
EOF | ||
|
||
if [ "$1" != "--no-install" ]; then | ||
function Install { | ||
PROMPT=$1 | ||
DEFAULT=$2 | ||
if [ "$DEFAULT" = true ]; then | ||
OPTIONS="[Y/n]" | ||
DEFAULT="y" | ||
else | ||
OPTIONS="[y/N]" | ||
DEFAULT="n" | ||
fi | ||
read -p "$PROMPT $OPTIONS " -n 1 -s -r INPUT | ||
INPUT=${INPUT:-${DEFAUT}} | ||
echo ${INPUT} | ||
if [[ "$INPUT" =~ ^[yY]$ ]]; then | ||
INSTALL_ANSWER=true | ||
else | ||
INSTALL_ANSWER=false | ||
fi | ||
} | ||
|
||
Install "Would you like to install to steam?" false | ||
|
||
if [ "$INSTALL_ANSWER" = true ]; then | ||
echo "Attempting to installing paintown to steam..." | ||
ROOT_DIR=$PWD | ||
STL=steamtinkerlaunch | ||
STEAM_APP_LOCATION=$HOME/.steam/steam/steamapps/common | ||
STEAM_SNIPER_LOCATION=$HOME/.steam/root/ubuntu12_64/steam-runtime-sniper | ||
INSTALL_LOCATION=$HOME/.paintown/Paintown | ||
|
||
# check if steam app directory exists | ||
if [ -d "$HOME/.steam" ] && [ ! -d "$STEAM_SNIPER_LOCATION" ]; then | ||
echo "Cannot find sniper runtime. Are you sure steam is installed?" | ||
exit -1 | ||
fi | ||
|
||
echo "Checking dependencies" | ||
if ! type "xdotool" &> /dev/null; then | ||
echo "xdotool not found, please install before continuing" | ||
exit | ||
fi | ||
|
||
if [ ! -d $INSTALL_LOCATION ]; then | ||
mkdir -p $INSTALL_LOCATION | ||
fi | ||
|
||
mkdir -p $ROOT_DIR/steam-bin/installation | ||
cd $ROOT_DIR/steam-bin/installation | ||
wget -qO- https://github.com/sonic2kk/steamtinkerlaunch/archive/refs/tags/v12.12.tar.gz -O ${STL}.tar.gz | ||
tar xzf ${STL}.tar.gz --strip=1 | ||
|
||
chmod +x $STL | ||
|
||
# Create the installation directory and copy relevant files | ||
mkdir -p $INSTALL_LOCATION/controller_config | ||
cp $ROOT_DIR/steam-bin/paintown $INSTALL_LOCATION | ||
cp $ROOT_DIR/misc/steam/steam-run.sh $INSTALL_LOCATION | ||
chmod +x $INSTALL_LOCATION/steam-run.sh | ||
cp $ROOT_DIR/misc/steam/'paintown keyboard layout_0.vdf' $INSTALL_LOCATION/controller_config | ||
#cp $ROOT_DIR/misc/steam/*.png $INSTALL_LOCATION | ||
|
||
# set english and yad to ai appimage | ||
./${STL} yad ai lang=lang/english.txt | ||
./${STL} ansg \ | ||
--appname="Paintown" \ | ||
--exepath="$INSTALL_LOCATION/steam-run.sh" \ | ||
--startdir="$INSTALL_LOCATION" \ | ||
--iconpath="$ROOT_DIR/misc/icon.png" \ | ||
--compatibilitytool="default" \ | ||
--hero="$ROOT_DIR/misc/steam/library_hero.png" \ | ||
--logo="$ROOT_DIR/misc/steam/library_logo_transparent.png" \ | ||
--boxart="$ROOT_DIR/misc/steam/library_capsule.png" \ | ||
--tenfoot="$ROOT_DIR/misc/steam/tenfoot.png" \ | ||
--copy | ||
|
||
# Done | ||
echo "Done. Paintown installed to $INSTALL_LOCATION. Restart steam to view the changes." | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.