commit 625c880b3e925e1ff837ccf342378f8153619782
parent 47d31876446da4cfe9d918459c26283f0d23da6b
Author: MTRNord <mtrnord1@gmail.com>
Date: Sat, 30 Sep 2023 20:23:57 +0200
Improve CI for bindgen
Diffstat:
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/nixos/common/lib/github-runner.nix b/nixos/common/lib/github-runner.nix
@@ -1,4 +1,4 @@
-{ lib, pkgs, config, ... }:
+{ lib, pkgs, config, stdenv, ... }:
{
users.users."node-yara-rs-runner" = { isNormalUser = false; };
services.github-runners = {
@@ -27,6 +27,18 @@
(pkgs.yara.override { enableStatic = true; })
pkgs.gcc
];
+ extraEnvironment = {
+ YARA_LIBRARY_PATH = "${pkgs.yara}/lib";
+ YARA_INCLUDE_DIR = "${pkgs.yara}/include";
+ LIBCLANG_PATH = "${llvmPackages.libclang}/lib";
+ BINDGEN_EXTRA_CLANG_ARGS = "$(< ${stdenv.cc}/nix-support/libc-crt1-cflags) \
+ $(< ${stdenv.cc}/nix-support/libc-cflags) \
+ $(< ${stdenv.cc}/nix-support/cc-cflags) \
+ $(< ${stdenv.cc}/nix-support/libcxx-cxxflags) \
+ ${lib.optionalString stdenv.cc.isClang "-idirafter ${stdenv.cc.cc}/lib/clang/${lib.getVersion stdenv.cc.cc}/include"} \
+ ${lib.optionalString stdenv.cc.isGNU "-isystem ${stdenv.cc.cc}/include/c++/${lib.getVersion stdenv.cc.cc} -isystem ${stdenv.cc.cc}/include/c++/${lib.getVersion stdenv.cc.cc}/${stdenv.hostPlatform.config} -idirafter ${stdenv.cc.cc}/lib/gcc/${stdenv.hostPlatform.config}/${lib.getVersion stdenv.cc.cc}/include"} \
+ ";
+ };
};
};
}