Consume libakgl 0.3.0: every workaround deleted, two capabilities gained

0.3.0 closed all ten API gaps this port had filed. The four workarounds go
with them: the CMake block that declared libakgl's vendored dependencies by
hand, the akgl/actor.h include in three files, and the six vtable pointers
assigned by hand in two more, now akgl_render_bind2d().

Two gaps were capabilities rather than inconveniences, and both are now real:

The line editor takes the composed UTF-8 text the ring carries in preference
to the keycode, so shifted characters, keyboard layouts, compose keys and dead
keys all work. A double quote can be typed, which means a BASIC string literal
can be typed -- the sharp end of the old limitation. Letters are no longer
folded to upper case.

SOUND's dir/min/step reach akgl_audio_sweep instead of being refused. dir 3
sweeps once rather than oscillating and TODO.md section 5 says so. A backend
with no sweep still refuses the swept note and plays the held one.

The adaptors now carry an AKGL_VERSION_AT_LEAST(0, 3, 0) floor, verified by
temporarily demanding 0.4.0 and watching it fire.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-31 13:25:14 -04:00
parent 583c0abbd2
commit fca9ad4a89
16 changed files with 495 additions and 265 deletions

View File

@@ -46,6 +46,14 @@ option(AKBASIC_SANITIZE "Build with ASan + UBSan" OFF
# Rename the dependency's on the way past. Remove this once libakerror applies
# the same CMAKE_SOURCE_DIR test to `coverage` that it already applies to
# `mutation` -- filed in deps/libakstdlib/TODO.md section 2.3.
#
# **Only one project in a tree may shadow add_test(), and this is that project.**
# CMake exposes an overridden command as `_name` and chains exactly one level: a
# second override rebinds `_add_test` to the first override and the builtin
# becomes unreachable to everyone, so our own registrations recurse until CMake
# stops at "Maximum recursion depth of 1000 exceeded". libakgl 0.3.0 briefly
# shadowed it unconditionally and this is exactly what happened; the top-level
# guard it used to have is back, and libakstdlib has always had one.
# ---------------------------------------------------------------------------
set(AKBASIC_SUPPRESS_ADD_TEST TRUE)
@@ -72,26 +80,15 @@ endfunction()
add_subdirectory(deps/libakerror EXCLUDE_FROM_ALL)
add_subdirectory(deps/libakstdlib EXCLUDE_FROM_ALL)
if(AKBASIC_WITH_AKGL)
# libakgl builds its own vendored SDL, SDL_image, SDL_mixer, SDL_ttf and
# jansson only when it is *top-level*. Embedded, it goes down a find_package
# path instead and requires all five installed on the system -- which is a
# surprise, because they are sitting right there in deps/libakgl/deps as
# submodules. Every one of those lookups is guarded with
# if(NOT TARGET ...), so declaring the targets here first satisfies them
# and the vendored copies get used after all. Same trick, and the same
# ordering requirement, that akerror::akerror and akstdlib::akstdlib already
# need above.
# libakgl 0.3.0 adds its own vendored SDL, SDL_image, SDL_mixer, SDL_ttf and
# jansson whether or not it is top-level, so there is nothing to do here but
# add it. Before that it went down a find_package path when embedded and
# required all five installed on the system, and this block declared them by
# hand first -- filed as libakgl API-gap item 5 and resolved there.
#
# Filed upstream: an embedded libakgl should add its own vendored
# dependencies rather than requiring them installed.
set(JANSSON_WITHOUT_TESTS ON CACHE BOOL "Do not build vendored Jansson tests" FORCE)
set(JANSSON_EXAMPLES OFF CACHE BOOL "Do not build vendored Jansson examples" FORCE)
set(JANSSON_BUILD_DOCS OFF CACHE BOOL "Do not build vendored Jansson docs" FORCE)
add_subdirectory(deps/libakgl/deps/jansson EXCLUDE_FROM_ALL)
add_subdirectory(deps/libakgl/deps/SDL EXCLUDE_FROM_ALL)
add_subdirectory(deps/libakgl/deps/SDL_image EXCLUDE_FROM_ALL)
add_subdirectory(deps/libakgl/deps/SDL_mixer EXCLUDE_FROM_ALL)
add_subdirectory(deps/libakgl/deps/SDL_ttf EXCLUDE_FROM_ALL)
# akerror::akerror and akstdlib::akstdlib still have to exist first: libakgl
# guards every dependency with if(NOT TARGET ...), which is what stops its
# vendored copies of those two being declared a second time.
add_subdirectory(deps/libakgl EXCLUDE_FROM_ALL)
endif()