Skip to content
Jeffrey Carpenter edited this page Jul 2, 2026 · 37 revisions

scratchpad

nomlib-builder

docker images

  • i8degrees/nomlib-builder:0.13.1-amd64

  • i8degrees/nomlib-builder:0.13.1-amd64-libs

nomlib-builder

amd64/libs

  • cleanup after each build, i.e.:
    • make distclean || make clean

osx

  1. git clone git@github.com:i8degrees/nomlib.git
  2. download existing deps from nomlib.479831.xyz/frs -- common and osx
  3. extract to third-party/common and third-party/osx
  4. mkdir build && cd build
  5. cmake -DDEBUG=on -DDEBUG_ASSERT=on -DEXAMPLES=on -DNOM_BUILD_TESTS=off -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 -DCMAKE_INSTALL_PREFIX=$HOME/Library/Frameworks ..

x86_64-apple-darwin22.4-clang x86_64-apple-darwin22.4-clang++

windows

cmake -S $(pwd) -B $(pwd)/build --preset build-debug-clang-cl ...

clang-cl

linux

cmake -S $(pwd) -B $(pwd)/build --preset build-debug-clang-linux

cmake -S/app --preset debug-clang-linux
cmake --build /app/build/debug-clang-linux
cmake --build /app/build/debug-clang-linux --target help
cmake --build /app/build/debug-clang-linux --target device_info

macos

docker run --rm -it -v /home/jeff/Projects/nomlib.git:/app
-v nomlib-libs:/app/vendor
i8degrees/nomlib-builder:0.13.1-amd64-macos

cmake -S/app -B/app/build.osx.test.2 -DFRAMEWORK=off -DEXAMPLES=on
-DNOM_BUILD_TESTS=off -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9
-DCMAKE_TOOLCHAIN_FILE=/app/cmake/toolchains/osxcross.cmake
-DNOMLIB_DEPS_DIR=/app/third-party/osx
-DSDL2_LIBRARY=/app/third-party/osx/SDL2.framework
-DSDL2_INCLUDE_DIR=/app/third-party/osx/SDL2.framework/Headers/
-DSDL2_IMAGE_LIBRARY=/app/third-party/osx/SDL2_image.framework/
-DSDL2_IMAGE_INCLUDE_DIR=/app/third-party/osx/SDL2_image.framework/Headers
-DSDL2_TTF_LIBRARY=/app/third-party/osx/SDL2_ttf.framework/
-DSDL2_TTF_INCLUDE_DIR=/app/third-party/osx/SDL2_ttf.framework/Headers
-DLIBROCKET_CORE_LIBRARY=/app/third-party/osx/librocket/lib/libRocketCore.1.dylib
-DLIBROCKET_CONTROLS_LIBRARY=/app/third-party/osx/librocket/lib/libRocketControls.1.dylib
-DLIBROCKET_DEBUGGER_LIBRARY=/app/third-party/osx/librocket/lib/libRocketDebugger.1.dylib
-DLIBROCKET_CORE_INCLUDE_DIR=/app/third-party/osx/librocket/include
-DLIBROCKET_CONTROLS_INCLUDE_DIR=/app/third-party/osx/librocket/include
-DLIBROCKET_DEBUGGER_INCLUDE_DIR=/app/third-party/osx/librocket/include

SDL2_IMAGE_INCLUDE_DIR:PATH=/usr/local/osxcross/target/macports/pkgs/opt/local/include/SDL2/SDL_image.h SDL2_IMAGE_LIBRARY:FILEPATH=/usr/local/osxcross/target/macports/pkgs/opt/local/lib/libSDL2_image-2.0.0.dylib SDL2_INCLUDE_DIR:PATH=/usr/local/osxcross/target/macports/pkgs/opt/local/include/SDL2 SDL2_LIBRARY:STRING=/usr/local/osxcross/target/macports/pkgs/opt/local/lib/libSDL2.dylib SDL2_TTF_INCLUDE_DIR:PATH=/usr/local/osxcross/target/macports/pkgs/opt/local/include/SDL2/SDL_ttf.h SDL2_TTF_LIBRARY:FILEPATH=/usr/local/osxcross/target/macports/pkgs/opt/local/lib/libSDL2_ttf-2.0.0.dylib

MacOSX11.1.sdk

NOMLIB_DEPS_DIR=$2 # script arg
# "$HOME/Projects/nomlib.git/third-party/vcpkg_vendor.zip"
BUILD_DIR=$1 # script arg
# ~/Projects/nomlib.git/build/debug/
mkdir $BUILD_DIR && cd $BUILD_DIR
bsdtar -xf ~/Projects/nomlib.git/third-party/vcpkg_vendor.zip --strip-components 1

VCPKG_ROOT=/home/jeff/.local/share/vcpkg VCPKG_OVERLAY_PORTS=$VCPKG_ROOT/ports/librocket VCPKG_TARGET_TRIPLET=x64-linux CMAKE_TOOLCHAIN_FILE=/home/jeff/.local/share/vcpkg/scripts/buildsystems/vcpkg.cmake

  • fix link errors by investigating the API (diff) for the two method calls:
/usr/bin/ld: CMakeFiles/libRocketDataGridTest.dir/datagrid/CardsPageDataSource.cpp.o: undefined reference to symbol '_ZN6Rocket8Controls10DataSource15NotifyRowChangeERKNS_4Core10StringBaseIcEE'
/usr/bin/ld: /home/jeff/Projects/nomlib.git/build/release/vcpkg_installed/x64-linux-dynamic/lib/libRocketControls.so.1: error adding symbols: DSO missing from command line

/usr/bin/ld: CMakeFiles/libRocketTest.dir/libRocketTest.cpp.o: undefined reference to symbol '_ZN6Rocket4Core7Element11SetPropertyERKNS0_10StringBaseIcEERKNS0_8PropertyE'
/usr/bin/ld: /home/jeff/Projects/nomlib.git/build/release/vcpkg_installed/x64-linux-dynamic/lib/libRocketCore.so.1: error adding symbols: DSO missing from command line
  • investigate why libRocket is returning custom for its version

  • file bug for renderfont example, the given file path should be transformed into an absolute path, or we should append the current working directory to the path that is given;

    • add cwd.currentPath() to file path
  • file bug for resolving ImageDiffTest errors due to resources path; add + "tests" + p.native()

    • const std::string RESOURCES_PATH = cwd.currentPath() + p.native() + "Resources" + p.native() + "tests" + p.native() + "ImageDiffTest" + p.native();
  • We must rethink nom::init() with the automatic current working directory path being set is what produces errors like the above and also seen in nom_font exe and likely others

    • The existing implementation is correct for when the executable is executed from within an isolated bundle, i.e.: MacOSX application or framework, or AppImage / Flatpak, but otherwise breaks for when the exe is operating within a global filesystem space such as when running from a terminal

cmake -S . --preset release-static cmake -S . --preset release-dynamic

cmake --build build/release-static --target all cmake --build build/release-dynamic --target all

cmake --install build/release-static
--component Runtime --component Development --component Documentation
--component Core

cmake --install build/release-dynamic
--component Runtime --component Development --component Documentation
--component Core

  • move unused cmake modules at cmake/modules/ to Resources/CMake or so

  • remove cmake/toolchains/vcpkg.cmake

  • add init_nom_cmdline_args function using TCLAP (privately)

  • add example with three cmdline args -- input & output filename and rescale algo (hqx or scale2x) -- for rescaling an image

  • pull latest gamecontrollerdb.txt from db in a FetchContent call inside vendor/CMakeLists.txt and add it to Resources/SharedSupport for redistribution

  • add license to licenses

  • wiki.git/patches/microtar.cmake
  • wiki.git/patches/CPackConfig.cmake

Clone this wiki locally