Skip to content

Commit 2e93bf1

Browse files
committed
Port application to SDL3
Signed-off-by: Artem Senichev <artemsen@gmail.com>
1 parent 21a10dc commit 2e93bf1

28 files changed

Lines changed: 8440 additions & 323 deletions

.clang-tidy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Checks: 'clang-diagnostic-*,clang-analyzer-*,performance-*'
2+
WarningsAsErrors: '*'

.github/workflows/Arch.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: ArchLinux/x86_64
2+
on: [push, pull_request]
3+
4+
jobs:
5+
check:
6+
runs-on: ubuntu-latest
7+
env:
8+
BUILD_PATH: /tmp/build
9+
INSTALL_PATH: /tmp/install
10+
11+
steps:
12+
13+
- name: Check out source code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Get pipewalker version
19+
run: echo "VERSION=$(git describe --tags --long --always | sed 's/^v//;s/-/./')" >> $GITHUB_OUTPUT
20+
id: version
21+
22+
- name: Build docker image
23+
run: docker build --tag=pipewalker --file=.github/workflows/Dockerfile.Arch .
24+
25+
- name: Run docker container
26+
run: docker run --tty --detach --name=pipewalker --volume=$PWD:$PWD:ro --workdir=$PWD pipewalker
27+
28+
- name: Configure
29+
run: >
30+
docker exec pipewalker
31+
meson setup
32+
-D version=${{steps.version.outputs.VERSION}}
33+
--prefix=/usr
34+
--werror
35+
${{ env.BUILD_PATH }}
36+
37+
- name: Compile
38+
run: docker exec pipewalker meson compile -C ${{ env.BUILD_PATH }}
39+
40+
- name: Install
41+
run: >
42+
docker exec pipewalker
43+
env DESTDIR=${{ env.INSTALL_PATH }}
44+
meson install -C ${{ env.BUILD_PATH }}
45+
46+
- name: Run installed
47+
run: docker exec pipewalker ${{ env.INSTALL_PATH }}/usr/bin/pipewalker --version
48+
49+
- name: Check clang-tidy
50+
run: docker exec pipewalker ninja -C ${{ env.BUILD_PATH }} clang-tidy
51+
52+
- name: Check clang-format
53+
run: docker exec pipewalker clang-format --Werror --dry-run src/*.cpp src/*.hpp

.github/workflows/Dockerfile.Arch

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM archlinux:latest
2+
3+
RUN pacman --sync --sysupgrade --refresh --refresh --noconfirm \
4+
clang \
5+
meson \
6+
pkgconf \
7+
sdl3
8+
9+
RUN useradd --create-home builder
10+
11+
ENV USER=builder
12+
ENV HOME=/home/builder
13+
14+
ENV CC="clang"
15+
ENV CXX="clang++"
16+
ENV CFLAGS="-g -fsanitize=address"
17+
ENV CXXFLAGS="-g -fsanitize=address"
18+
ENV LDFLAGS="-fsanitize=address -fopenmp=libgomp"
19+
20+
USER builder

.github/workflows/Dockerfile.MinGW

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM archlinux:latest
2+
3+
RUN pacman --sync --sysupgrade --refresh --refresh --noconfirm \
4+
make \
5+
meson \
6+
mingw-w64-gcc \
7+
pkgconf \
8+
wget
9+
10+
RUN mkdir -p /tmp/sdl && \
11+
wget -qO- https://github.com/libsdl-org/SDL/releases/download/release-3.4.0/SDL3-devel-3.4.0-mingw.tar.gz | tar -xz --strip-components 1 -C /tmp/sdl && \
12+
make DESTDIR=/usr/x86_64-w64-mingw32 -C /tmp/sdl install-x86_64 && \
13+
rm -rf /tmp/sdl
14+
15+
RUN echo "#!/bin/sh" > /usr/bin/x86_64-w64-mingw32-pkg-config && \
16+
echo "export PKG_CONFIG_LIBDIR=/usr/x86_64-w64-mingw32/lib/pkgconfig:/usr/x86_64-w64-mingw32/share/pkgconfig" >> /usr/bin/x86_64-w64-mingw32-pkg-config && \
17+
echo "pkg-config \"\$@\"" >> /usr/bin/x86_64-w64-mingw32-pkg-config && \
18+
chmod a+x /usr/bin/x86_64-w64-mingw32-pkg-config
19+
20+
RUN useradd --create-home builder
21+
22+
ENV USER=builder
23+
ENV HOME=/home/builder
24+
25+
USER builder

.github/workflows/MinGW.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: MinGW/x86_64
2+
on: [push, pull_request]
3+
4+
jobs:
5+
check:
6+
runs-on: ubuntu-latest
7+
env:
8+
BUILD_PATH: /tmp/build
9+
INSTALL_PATH: /tmp/install
10+
11+
steps:
12+
13+
- name: Check out source code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Get pipewalker version
19+
run: echo "VERSION=$(git describe --tags --long --always | sed 's/^v//;s/-/./')" >> $GITHUB_OUTPUT
20+
id: version
21+
22+
- name: Build docker image
23+
run: docker build --tag=pipewalker --file=.github/workflows/Dockerfile.MinGW .
24+
25+
- name: Run docker container
26+
run: |
27+
mkdir -p ${{ env.INSTALL_PATH }}
28+
chmod a+rw ${{ env.INSTALL_PATH }}
29+
docker run --tty --detach --name=pipewalker --volume=$PWD:$PWD:ro --volume=${{ env.INSTALL_PATH }}:${{ env.INSTALL_PATH }}:Z --workdir=$PWD pipewalker
30+
31+
- name: Configure
32+
run: >
33+
docker exec pipewalker
34+
meson setup
35+
-D version=${{ steps.version.outputs.VERSION }}
36+
--prefix=/
37+
--werror
38+
--strip
39+
--cross-file=.github/workflows/mingw.txt
40+
${{ env.BUILD_PATH }}
41+
42+
- name: Compile
43+
run: docker exec pipewalker meson compile -C ${{ env.BUILD_PATH }}
44+
45+
- name: Install
46+
run: |
47+
docker exec pipewalker env DESTDIR=${{ env.INSTALL_PATH }} meson install -C ${{ env.BUILD_PATH }}
48+
docker exec pipewalker \
49+
install --strip --strip-program=x86_64-w64-mingw32-strip --mode=644 \
50+
--target-directory=${{ env.INSTALL_PATH }}/PipeWalker-${{ steps.version.outputs.VERSION }} \
51+
/usr/x86_64-w64-mingw32/bin/libgcc_s_seh-1.dll \
52+
/usr/x86_64-w64-mingw32/bin/libstdc++-6.dll \
53+
/usr/x86_64-w64-mingw32/bin/libwinpthread-1.dll \
54+
/usr/x86_64-w64-mingw32/bin/SDL3.dll
55+
56+
- name: Upload dist
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: pipewalker-${{ steps.version.outputs.VERSION }}-win64
60+
path: ${{ env.INSTALL_PATH }}

.github/workflows/mingw.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/workflows/native.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ List of supported distributives can be found on the [Repology page](https://repo
1414

1515
## Build
1616

17-
To build a project you need a C++ compiler, meson, libraries SDL2 and SDL2 image:
18-
```
19-
sudo apt install build-essential libsdl2-dev libsdl2-image-dev
20-
meson setup --buildtype=release build
21-
ninja -C build
22-
sudo ninja -C build install
17+
To build the project you will need:
18+
- C++ compiler with support for the C++11 standard;
19+
- Meson build system;
20+
- SDL3 library.
21+
22+
```shell
23+
sudo apt install build-essential libsdl3-dev
24+
meson setup my_build_dir
25+
meson compile -C my_build_dir
26+
meson install -C my_build_dir
2327
```

include/stb_image.LICENSE

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
This software is available under 2 licenses -- choose whichever you prefer.
2+
------------------------------------------------------------------------------
3+
ALTERNATIVE A - MIT License
4+
Copyright (c) 2017 Sean Barrett
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9+
of the Software, and to permit persons to whom the Software is furnished to do
10+
so, subject to the following conditions:
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.
20+
------------------------------------------------------------------------------
21+
ALTERNATIVE B - Public Domain (www.unlicense.org)
22+
This is free and unencumbered software released into the public domain.
23+
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
24+
software, either in source code form or as a compiled binary, for any purpose,
25+
commercial or non-commercial, and by any means.
26+
In jurisdictions that recognize copyright laws, the author or authors of this
27+
software dedicate any and all copyright interest in the software to the public
28+
domain. We make this dedication for the benefit of the public at large and to
29+
the detriment of our heirs and successors. We intend this dedication to be an
30+
overt act of relinquishment in perpetuity of all present and future rights to
31+
this software under copyright law.
32+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35+
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
36+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
37+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)