Skip to content

refactor: move tinyscheme to thirdparty/ directory#357

Merged
spe-ciellt merged 4 commits intogerbv:developfrom
SourceParts:refactor/tinyscheme-thirdparty
Mar 5, 2026
Merged

refactor: move tinyscheme to thirdparty/ directory#357
spe-ciellt merged 4 commits intogerbv:developfrom
SourceParts:refactor/tinyscheme-thirdparty

Conversation

@rampageservices
Copy link
Copy Markdown
Contributor

Summary

  • Moves vendored TinyScheme 1.35 from src/ into thirdparty/tinyscheme/ for consistency with the dxflib bundling approach from fix: DXF export renders arcs as straight lines #296
  • Creates a tinyscheme_bundled static library CMake target (mirrors the dxflib_bundled pattern)
  • Adds a VERSION file tracking the bundled version and license

Files moved

From To
src/scheme.c thirdparty/tinyscheme/scheme.c
src/scheme.h thirdparty/tinyscheme/scheme.h
src/scheme-private.h thirdparty/tinyscheme/scheme-private.h
src/opdefines.h thirdparty/tinyscheme/opdefines.h
src/dynload.c thirdparty/tinyscheme/dynload.c
src/dynload.h thirdparty/tinyscheme/dynload.h
src/init.scm thirdparty/tinyscheme/init.scm
COPYING.tinyscheme thirdparty/tinyscheme/COPYING

Build changes

  • tinyscheme_bundled is a STATIC library linked by gerbv-app, keeping tinyscheme sources out of the application target
  • Include path uses thirdparty/ (PUBLIC), so consumers include as <tinyscheme/scheme-private.h> — same convention as <dxflib/dl_dxf.h>
  • init.scm installed via install(FILES) instead of PUBLIC_HEADER since it moved out of src/

Other updates

  • locale/CMakeLists.txt — gettext source path for dynload.c
  • .mc/windows_amd64/opt/package.sh — Windows packaging paths
  • README.md — license file link

Test plan

  • Linux CMake build succeeds
  • Windows cross-compilation build succeeds
  • init.scm installs to the correct BACKEND_DIR path
  • Project file loading still works (scheme interpreter functional)

Closes #350

Move vendored TinyScheme 1.35 from src/ into thirdparty/tinyscheme/
for consistency with the dxflib bundling approach introduced in gerbv#296.

Files moved:
  src/{scheme.c,scheme.h,scheme-private.h,opdefines.h} -> thirdparty/tinyscheme/
  src/{dynload.c,dynload.h,init.scm}                   -> thirdparty/tinyscheme/
  COPYING.tinyscheme                                    -> thirdparty/tinyscheme/COPYING

CMake changes:
  - Add tinyscheme_bundled static library target (mirrors dxflib_bundled)
  - Remove tinyscheme sources from gerbv-app, link tinyscheme_bundled instead
  - Install init.scm via install(FILES) since it moved out of src/

Also updates locale/CMakeLists.txt (gettext source path), package.sh
(Windows packaging paths), and README.md (license link).

Closes gerbv#350
dynload.c included two gerbv headers that broke after moving to
thirdparty/:

- gerb_file.h: completely unused, removed the dead include
- common.h: provides the _() gettext macro used in error messages;
  add src/ as a PRIVATE include directory for tinyscheme_bundled so
  common.h (and its transitive gettext.h/locale.h) can be found
dynload.c includes common.h which includes gettext.h which includes
libintl.h. On macOS, libintl.h is provided by the Intl package and
requires its include path. Move the tinyscheme block after
find_package(Intl) and conditionally link Intl::Intl.
Point GERBV_SCHEMEINIT to thirdparty/tinyscheme where init.scm
now lives after the tinyscheme directory move.
@spe-ciellt spe-ciellt added the enhancement New feature or request label Mar 5, 2026
@spe-ciellt spe-ciellt merged commit a37c9d3 into gerbv:develop Mar 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tinyscheme move to third party library

2 participants