#!/bin/sh
# Sets GWYDDION_LIBDIR so gwyconvert.real finds the bundled format modules
# instead of the nonexistent path compiled in at build time.
#
# Deliberately does not export DYLD_LIBRARY_PATH: System Integrity
# Protection strips DYLD_* variables when a protected binary spawns a child,
# so it would be dropped. The @loader_path install names that
# bundle-macos.sh rewrote handle library resolution instead.
here="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
export GWYDDION_LIBDIR="$here/lib"
# Keep stderr for real diagnostics. Otherwise GTK loads its accessibility
# modules and GdkPixbuf hunts for a loader cache at a path baked in by the
# build container, warning on every run including successful ones. Neither
# is needed: gwyconvert draws nothing and the bundle ships no pixmap
# module. Clearing both leaves the format list and every conversion
# unchanged.
export GTK_MODULES=""
export GDK_PIXBUF_MODULE_FILE=/dev/null
exec "$here/lib/gwyconvert.real" "$@"
