Re: [Tuxpaint-devel] Started the port to SDL3
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
From: Bill K. <nb...@so...> - 2025-07-25 00:42:49
|
On Sun, Jun 29, 2025 at 02:03:11PM +0200, Pere Pujal i Carabantes wrote: > Hi all, > > About three months ago I started that port, now after the release of 0.9.35 I am continuing it :) > > The source code is currently inside the sdl3 branch in my personal fork at SourceForge > https://sourceforge.net/u/perepujal/tuxpaint/ci/master/tree/ > > It needs SDL3_gfx which is still not in my distro(Debian Sid), so I've picked this one: > https://github.com/sabdul-khabir/SDL3_gfx > > And needs also SDL3_Pango wich I have working but needs a lot of cleaning > before it gets ready for a merge request, > I blindly ran some sed scripts that affected tons of files. Sorry Mark :) > https://provant.freeddns.org/pere/public_html/Tux%20Paint/devel/20250629/ > > After installing them, and the SDL3* libraries that come in my distribution, > I am able to compile and run Tux Paint in my box :) > Painting, lines, shapes, stamps, text, open, save, slideshow, erase and magic alien seems to work fine. > im and labels too but they are not tested hard. There is not yet a release of SDL3_mixer, so I cloned the repo (https://github.com/libsdl-org/SDL_mixer) but unfortunately cannot build it (`cmake --build build`) due to some compiler errors: [ 3%] Building C object CMakeFiles/SDL3_mixer-shared.dir/src/SDL_mixer.c.o In file included from /home/kendrick/tuxpaint/sdl3-libs/SDL_mixer/src/SDL_mixer.c:24: /home/kendrick/tuxpaint/sdl3-libs/SDL_mixer/src/SDL_mixer_internal.h:139:23: error: expected declaration specifiers or ‘...’ before numeric constant 139 | float SDL_ALIGNED(16) position3d[4]; // we only need the X, Y, and Z coords, but the 4th element makes this SIMD-friendly. | ^~ /home/kendrick/tuxpaint/sdl3-libs/SDL_mixer/src/SDL_mixer.c: In function ‘AudioDeviceChangeEventWatcher’: /home/kendrick/tuxpaint/sdl3-libs/SDL_mixer/src/SDL_mixer.c:218:66: error: ‘MIX_Track’ has no member named ‘position3d’; did you mean ‘position’? 218 | MIX_Spatialize(&track->mixer->vbap2d, track->position3d, track->spatialization_panning, track->spatialization_speakers); | ^~~~~~~~~~ | position [... plus more places where it complaints about `position3d` vs `position` ...] If I try to build Tux Paint without SDL_Mixer support (`make SDL_MIXER_LIB=`), I got a number of errors due to parts of the code trying to use the mixer library (e.g., #include it, or declare variables of type Mix_Chunk). I believe these errors are 'upstream' (i.e., in the main `tuxpaint` project); it's just hard for me to notice them because I _have_ SDL_Mixer (version 2) installed. :-) I'll need to sort that out. Beyond that, I'm also having trouble with SDL3_gfx. When I run `make` to do _anything_, it seems to always show this: Package sdl3-gfx was not found in the pkg-config search path. Perhaps you should add the directory containing `sdl3-gfx.pc' to the PKG_CONFIG_PATH environment variable Package 'sdl3-gfx', required by 'virtual:world', not found Makefile:340: -lSDL3_Mixer failed, no sound for you! Package sdl3-gfx was not found in the pkg-config search path. Perhaps you should add the directory containing `sdl3-gfx.pc' to the PKG_CONFIG_PATH environment variable Package 'sdl3-gfx', required by 'virtual:world', not found make: *** No rule to make target 'nosound'. Stop. And when I get it to compile, and it goes to link, it cannot find `zoomSurface` or `rotozoomSurface`, unsurprisingly: ...Linking Tux Paint... cc -O2 -g -ffast-math -W -Wall -fno-common -ffloat-store -fvisibility=hidden -Wcast-align -Wredundant-decls -Wbad-function-cast -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wstrict-aliasing=2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/local/include -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/local/include -I/usr/include/fribidi -I/usr/include/libxml2 -DVER_DATE=\"2025-07-25\" -DVER_VERSION=\"0.9.36\" -DDATA_PREFIX=\"/usr/local/share/tuxpaint/\" -DDOC_PREFIX=\"/usr/local/share/doc/tuxpaint-0.9.36/\" -DLOCALEDIR=\"/usr/local/share/locale/\" -DIMDIR=\"/usr/local/share/tuxpaint/im/\" -DCONFDIR=\"/usr/local/etc/tuxpaint/\" -DMAGIC_PREFIX=\"/usr/local/lib/tuxpaint/plugins/\" -DNOSOUND \ -o tuxpaint obj/tuxpaint.o obj/i18n.o obj/im.o obj/cursor.o obj/pixels.o obj/rgblinear.o obj/playsound.o obj/fonts.o obj/parse.o obj/fill.o obj/progressbar.o obj/dirwalk.o obj/get_fname.o obj/onscreen_keyboard.o obj/gifenc.o obj/sounds.o obj/postscript_print.o \ -L/usr/local/lib -Wl,-rpath,/usr/local/lib -Wl,--enable-new-dtags -lSDL3 -lSDL3_image -lSDL3_ttf -lz -lpng16 -L/usr/local/lib -lSDL3_Pango -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lharfbuzz -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lharfbuzz -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lharfbuzz -lfontconfig -lfreetype -lrsvg-2 -lm -lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lcairo -lpaper -lfribidi -lxml2 -limagequant -lm /usr/bin/ld: obj/tuxpaint.o: in function `blit_brush': /home/kendrick/tuxpaint/perepujal-tuxpaint/src/tuxpaint.c:7582:(.text+0x750b): undefined reference to `rotozoomSurface' /usr/bin/ld: /home/kendrick/tuxpaint/perepujal-tuxpaint/src/tuxpaint.c:7588:(.text+0x76c4): undefined reference to `rotozoomSurface' /usr/bin/ld: obj/tuxpaint.o: in function `update_stamp_xor': /home/kendrick/tuxpaint/perepujal-tuxpaint/src/tuxpaint.c:20234:(.text+0xff7f): undefined reference to `rotozoomSurface' /usr/bin/ld: obj/tuxpaint.o: in function `stamp_draw': /home/kendrick/tuxpaint/perepujal-tuxpaint/src/tuxpaint.c:8219:(.text+0x11ce0): undefined reference to `rotozoomSurface' /usr/bin/ld: obj/tuxpaint.o: in function `magic_rotate_scale': /home/kendrick/tuxpaint/perepujal-tuxpaint/src/tuxpaint.c:22747:(.text+0x4833): undefined reference to `rotozoomSurface' /usr/bin/ld: obj/onscreen_keyboard.o: in function `osk_create': /home/kendrick/tuxpaint/perepujal-tuxpaint/src/onscreen_keyboard.c:166:(.text+0x1dfd): undefined reference to `zoomSurface' /usr/bin/ld: /home/kendrick/tuxpaint/perepujal-tuxpaint/src/onscreen_keyboard.c:167:(.text+0x1e21): undefined reference to `zoomSurface' /usr/bin/ld: /home/kendrick/tuxpaint/perepujal-tuxpaint/src/onscreen_keyboard.c:168:(.text+0x1e47): undefined reference to `zoomSurface' /usr/bin/ld: /home/kendrick/tuxpaint/perepujal-tuxpaint/src/onscreen_keyboard.c:169:(.text+0x1e6d): undefined reference to `zoomSurface' /usr/bin/ld: /home/kendrick/tuxpaint/perepujal-tuxpaint/src/onscreen_keyboard.c:170:(.text+0x1e96): undefined reference to `zoomSurface' /usr/bin/ld: obj/onscreen_keyboard.o:/home/kendrick/tuxpaint/perepujal-tuxpaint/src/onscreen_keyboard.c:171: more undefined references to `zoomSurface' follow collect2: error: ld returned 1 exit status make: *** [Makefile:1258: tuxpaint] Error 1 However, I see a comment in Makefile that you had trouble with SDL3_gfx pkgconfig. I just ended up hard-coding it, for now: SDL_LIBS+=-lSDL3_gfx Finally, the Magic tools all want SDL_Mixer too, so I just dropped "magic-plugins" from Makefile's "all" target, and it built! I can launch Tux Paint, and see the splash screen, but then it seems to freeze. Okay, it's very late so I need to stop for now. -bill! > > I'd really like reviews and tests, below some things that would need help: > > im subsystem: > I don't know the languages we provide im for, so a test about correctness would be welcome. > Right Alt do not work in the SDL3 version I have installed, so I've added Left Alt to Thai, even if it was explicitly disabled. > Oher languages made use of both, left and right alt, now in my box, only left works. > > > Fill Lineal doesn't work properly on single click inside small circles, without drag, I am currently investigating this... > > > Magic tools: > there are plenty of magic tools in the magic/src/WIP_SDL3 directory that are waiting to be ported. > > > Wew, too long message, thanks for reading, and thaks for any help :) > Pere > > > > > _______________________________________________ > Tuxpaint-devel mailing list > Tux...@li... > https://lists.sourceforge.net/lists/listinfo/tuxpaint-devel > |