From 5bb589f645262385ccc2c5dbaa636c203d2e125a Mon Sep 17 00:00:00 2001 From: Rostislav Krasny <45571812+rostidev@users.noreply.github.com> Date: Fri, 28 Nov 2025 20:49:20 +0200 Subject: [PATCH 1/5] Add build instructions for Fedora 42+ --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 609e690..5f13738 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,17 @@ Dependencies: [SDL2](https://www.libsdl.org/download-2.0.php) +### Fedora 42+ +Starting with Fedora 42, the native SDL2 library is no longer available. +It was replaced by the SDL3 library. For programs that still require SDL2, +an [`sdl2-compat`](https://github.com/libsdl-org/sdl2-compat) library, +which provids a compatibility layer over SDL3, was introduced. +```console +$ sudo dnf install sdl2-compat-devel libXi-devel libXrandr-devel +$ make +$ ./sowon +``` + ### Debian ```console $ sudo apt-get install libsdl2-dev From b5e9ee2fa934e7f0782b4c83ef68fead684a1ccb Mon Sep 17 00:00:00 2001 From: Rostislav Krasny <45571812+rostidev@users.noreply.github.com> Date: Fri, 28 Nov 2025 21:02:51 +0200 Subject: [PATCH 2/5] Fix include of SDL.h It compiles even without this fix because of `pkg-config --cflags sdl2`, but C/C++ plugin of VS Code shows an error otherwise. --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 3692a9d..24c8835 100644 --- a/src/main.c +++ b/src/main.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include "common.c" From 39e881c896a7f943cc0a0391880811b0dcce53b0 Mon Sep 17 00:00:00 2001 From: Rostislav Krasny <45571812+rostidev@users.noreply.github.com> Date: Fri, 28 Nov 2025 21:17:06 +0200 Subject: [PATCH 3/5] Resolve compilation warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit $ make mkdir -pv build mkdir: created directory 'build' cc -Wall -Wextra -ggdb -std=c99 -pedantic -Ithirdparty -Ibuild -DPENGER -o build/png2c src/png2c.c -lm ./build/png2c ./assets/digits.png digits > build/digits.h ./build/png2c ./assets/penger_walk_sheet.png penger > build/penger_walk_sheet.h cc `pkg-config --cflags sdl2` -Wall -Wextra -ggdb -std=c99 -pedantic -Ithirdparty -Ibuild -DPENGER -o sowon src/main.c `pkg-config --libs sdl2` -lm In file included from src/main.c:10: src/common.c:16:9: warning: ‘CHAR_WIDTH’ redefined 16 | #define CHAR_WIDTH (300 / 2) | ^~~~~~~~~~ In file included from /usr/lib/gcc/x86_64-redhat-linux/15/include/limits.h:210, from /usr/lib/gcc/x86_64-redhat-linux/15/include/syslimits.h:9, from /usr/lib/gcc/x86_64-redhat-linux/15/include/limits.h:34, from /usr/include/SDL2/SDL_config_unix.h:28, from /usr/include/SDL2/SDL_config-x86_64.h:51, from /usr/include/SDL2/SDL_config.h:58, from /usr/include/SDL2/SDL_stdinc.h:33, from /usr/include/SDL2/SDL_main.h:25, from /usr/include/SDL2/SDL.h:31, from src/main.c:8: /usr/include/limits.h:147:11: note: this is the location of the previous definition 147 | # define CHAR_WIDTH 8 | ^~~~~~~~~~ cc -Wall -Wextra -ggdb -std=c99 -pedantic -Ithirdparty -Ibuild -DPENGER -o sowon_rgfw src/main_rgfw.c -lX11 -lXrandr -lGLX -lGL -lm gzip -c docs/sowon.6 > docs/sowon.6.gz --- Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9b379a3..ca4b8ca 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,6 @@ UNAMEOS = $(shell uname) COMMON_CFLAGS= -Wall -Wextra -ggdb -std=c99 -pedantic -Ithirdparty -Ibuild -DPENGER -SDL2_CFLAGS= `pkg-config --cflags sdl2` $(COMMON_CFLAGS) -RGFW_CFLAGS= $(COMMON_CFLAGS) COMMON_LIBS= -lm SDL2_LIBS= `pkg-config --libs sdl2` $(COMMON_LIBS) ifeq ($(UNAMEOS),Darwin) @@ -17,10 +15,10 @@ INSTALL?= install all: Makefile sowon sowon_rgfw man sowon_rgfw: src/main_rgfw.c build/digits.h build/penger_walk_sheet.h - $(CC) $(RGFW_CFLAGS) -o sowon_rgfw src/main_rgfw.c $(RGFW_LIBS) + $(CC) $(COMMON_CFLAGS) -o sowon_rgfw src/main_rgfw.c $(RGFW_LIBS) sowon: src/main.c build/digits.h build/penger_walk_sheet.h - $(CC) $(SDL2_CFLAGS) -o sowon src/main.c $(SDL2_LIBS) + $(CC) $(COMMON_CFLAGS) -o sowon src/main.c $(SDL2_LIBS) build/digits.h: build/png2c ./assets/digits.png ./build/png2c ./assets/digits.png digits > build/digits.h From b8107f7d3ca7828d3b02ff1493ae73b5dd354b43 Mon Sep 17 00:00:00 2001 From: Rostislav Krasny <45571812+rostidev@users.noreply.github.com> Date: Fri, 28 Nov 2025 21:29:22 +0200 Subject: [PATCH 4/5] Pedantic compilation must compile pedantic main() Read 5.1.2.2.1 Program startup https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 24c8835..204be9b 100644 --- a/src/main.c +++ b/src/main.c @@ -115,7 +115,7 @@ void render_penger_at(SDL_Renderer *renderer, SDL_Texture *penger, float time, i } #endif -int main(int argc, char **argv) +int main(int argc, char *argv[]) { State state = {0}; parse_state_from_args(&state, argc, argv); From 2896c9833bea7b9970b310117cdc9685369b6d98 Mon Sep 17 00:00:00 2001 From: Rostislav Krasny <45571812+rostidev@users.noreply.github.com> Date: Fri, 28 Nov 2025 21:38:37 +0200 Subject: [PATCH 5/5] Document undocumented but obvious key --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f13738..803d762 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ $ ./sowon | Key | Description | | --- | --- | | SPACE | Toggle pause | -| = | Zoom in | +| = or + | Zoom in | | - | Zoom out | | 0 | Zoom 100% | | F5 | Restart |