You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make style.json runtime path configurable via PREFIX
style.cpp's getConfigPath() searches three hardcoded paths for the
plugin's style.json. The second of these was a literal
/usr/local/etc/magnetophon/style/style.json, which downstream
packagers (Nix, distros installing to non-/usr/local prefixes)
had to rewrite via sed/substituteInPlace to point at their actual
install location.
Replace the hardcoded literal with a MAGNETOPHON_SYSCONFDIR
compile-time macro, fallback /usr/local/etc/magnetophon. The
top-level Makefile derives this from $(PREFIX)/etc/$(pkgname)
and passes it to the common sub-make as SYSCONFDIR, which adds
-DMAGNETOPHON_SYSCONFDIR="$(SYSCONFDIR)" to style.cpp's compile
line specifically. C++ adjacent string literal concatenation then
joins the path with '/style/style.json' at the call site.
Use runtime_sysconfdir = $(PREFIX)/etc rather than $(sysconfdir)
= $(DESTDIR)$(PREFIX)/etc, because the compile-time path should
reflect where the file ends up after installation, not where a
staged install temporarily writes it.
Also switch the shebangs of generate-ttl.sh and patch/apply.sh
from #!/bin/bash to #!/usr/bin/env bash. Both scripts are
POSIX-compatible anyway; env-based shebangs work uniformly across
build environments (Nix sandbox, BSD, macOS-with-Homebrew-bash)
without requiring patchShebangs.
Allows the nixpkgs derivation to drop both substituteInPlace and
patchShebangs from its postPatch hook, and switch installFlags to
makeFlags so PREFIX reaches both the build (for the macro) and
the install (for destination paths).
0 commit comments