Skip to content

Commit 98b45db

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

28 files changed

Lines changed: 8463 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: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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: |
24+
docker build --tag=pipewalker:arch \
25+
--file=.github/workflows/Dockerfile.Arch .
26+
27+
- name: Run docker container
28+
run: |
29+
docker run --tty --detach --name=pipewalker \
30+
--volume=$PWD:$PWD:ro \
31+
--workdir=$PWD \
32+
pipewalker:arch
33+
34+
- name: Configure
35+
run: |
36+
docker exec pipewalker \
37+
meson setup \
38+
-D version=${{steps.version.outputs.VERSION}} \
39+
--prefix=/usr \
40+
--werror \
41+
${{ env.BUILD_PATH }}
42+
43+
- name: Compile
44+
run: |
45+
docker exec ${{ env.DOCKER_IMG }} \
46+
meson compile -C ${{ env.BUILD_PATH }}
47+
48+
- name: Install
49+
run: |
50+
docker exec ${{ env.DOCKER_IMG }} \
51+
env DESTDIR=${{ env.INSTALL_PATH }} \
52+
meson install -C ${{ env.BUILD_PATH }}
53+
54+
- name: Run installed
55+
run: |
56+
docker exec ${{ env.DOCKER_IMG }} \
57+
${{ env.INSTALL_PATH }}/usr/bin/pipewalker --version
58+
59+
- name: Check clang-tidy
60+
run: |
61+
docker exec ${{ env.DOCKER_IMG }} \
62+
ninja -C ${{ env.BUILD_PATH }} clang-tidy
63+
64+
- name: Check clang-format
65+
run: |
66+
docker exec ${{ env.DOCKER_IMG }} \
67+
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: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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: |
24+
docker build --tag=pipewalker:mingw \
25+
--file=.github/workflows/Dockerfile.MinGW .
26+
27+
- name: Run docker container
28+
run: |
29+
mkdir -p ${{ env.INSTALL_PATH }}
30+
chmod a+rw ${{ env.INSTALL_PATH }}
31+
docker run --tty --detach --name=pipewalker \
32+
--volume=$PWD:$PWD:ro \
33+
--volume=${{ env.INSTALL_PATH }}:${{ env.INSTALL_PATH }}:Z \
34+
--workdir=$PWD \
35+
pipewalker:mingw
36+
37+
- name: Configure
38+
run: |
39+
docker exec pipewalker \
40+
meson setup \
41+
-D version=${{ steps.version.outputs.VERSION }} \
42+
-D default_library=static \
43+
-D cpp_link_args='-static' \
44+
--prefix=/ \
45+
--werror \
46+
--strip \
47+
--cross-file=.github/workflows/mingw.txt \
48+
${{ env.BUILD_PATH }}
49+
50+
- name: Compile
51+
run: |
52+
docker exec pipewalker \
53+
meson compile -C ${{ env.BUILD_PATH }}
54+
55+
- name: Install
56+
run: |
57+
docker exec pipewalker \
58+
env DESTDIR=${{ env.INSTALL_PATH }} \
59+
meson install -C ${{ env.BUILD_PATH }}
60+
docker exec pipewalker \
61+
install -m644 --strip --strip-program=x86_64-w64-mingw32-strip \
62+
/usr/x86_64-w64-mingw32/bin/SDL3.dll \
63+
${{ env.INSTALL_PATH }}/PipeWalker-${{ steps.version.outputs.VERSION }}/
64+
65+
- name: Upload dist
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: pipewalker-${{ steps.version.outputs.VERSION }}-win64
69+
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)