# TODO: investigate something in scopes flake to automate or abstract this
featherDevSetupHook = ''
export NIX_CFLAGS_COMPILE="''${NIX_CFLAGS_COMPILE:-} $(pkg-config --cflags libcjson libsail)"
export LD_LIBRARY_PATH=${devshell-ldpath}:''${LD_LIBRARY_PATH:-}
'';
The feathergui flake contains this hook which sets up paths for scopes. Scopes needs NIX_CFLAGS_COMPILE to contain the -I/nix/store/hash/include/lib paths and LD_LIBRARY_PATH to contain the paths to the .sos for each library to find them.
It's also possible to set up these paths in __env.sc instead of using the above env vars, and potentially generating one of those or suggesting a particular format for it which runs pkg-config would work. This would have the advantage of working with non-Nix build systems. NIX_CFLAGS_COMPILE is not portable.
Maybe it would be better if scopes supported pkg-config more directly in some way?
https://github.com/Fundament-Software/feathergui/blob/9ff6331f9ad610d1bd9810e5283c3d6e688b9b4d/flake.nix#L33
The
feathergui
flake contains this hook which sets up paths for scopes. Scopes needsNIX_CFLAGS_COMPILE
to contain the-I/nix/store/hash/include/lib
paths andLD_LIBRARY_PATH
to contain the paths to the.so
s for each library to find them.It's also possible to set up these paths in
__env.sc
instead of using the above env vars, and potentially generating one of those or suggesting a particular format for it which runspkg-config
would work. This would have the advantage of working with non-Nix build systems.NIX_CFLAGS_COMPILE
is not portable.Maybe it would be better if scopes supported
pkg-config
more directly in some way?