Terra heavily depends on its ability to interface with C APIs, but
without scanning NIX_CFLAGS_COMPILE, it's awkward and annoying to set up
imports correctly (by scanning and adding the flags yourself) in every
single project.
Luckily most of the Clang initialization is hidden away, but the Lua
code for the Terra library handles all the high-level stuff, so we patch
it in there.
This allows simple examples like:
C = terralib.includec("zlib.h")
to work instantly, provided `zlib` is a Nix dependency.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
* llvmPackages_35 -> llvmPackages_38
* static llvm no longer needed
* multiple outputs, this generates the following results:
- out/lib/terra.so
- bin/bin/terra
- dev/include/terra/*.h
- static/lib/libterra.a
Contributed with help from @joachifm