what the hell

This commit is contained in:
Charlotte 🦝 Delenk 2023-03-25 15:45:28 +01:00
parent 34ab04d233
commit d6ac10ad8a
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122

View file

@ -2,6 +2,7 @@
stdenvNoCC,
rustBuilder,
fetchFromGitHub,
fetchzip,
}: let
sourceJson = builtins.fromJSON (builtins.readFile ./source.json);
source = stdenvNoCC.mkDerivation {
@ -19,6 +20,21 @@
cp ${./Cargo.lock} $out
'';
};
rustCxxHeader = stdenvNoCC.mkDerivation {
pname = "cxx-headers";
version = "1.0.93";
src = fetchzip {
extension = "tar.gz";
url = "https://crates.io/api/v1/crates/cxx/1.0.93/download";
sha256 = "sha256-YRmV+d9EwX5D68paAMgl+nUVPdLtoh2uiAlQB5idUy4=";
};
buildPhase = "";
installPhase = ''
mkdir -p $out/include/rust
cp include/cxx.h $out/include/rust
'';
};
in
rustBuilder.makePackageSet {
rustChannel = "stable";
@ -29,7 +45,12 @@ in
overrideAttrs = drv: {
propagatedBuildInputs = drv.propagatedBuildInputs or [] ++ [
pkgs.nix.dev
pkgs.boost.dev
rustCxxHeader
pkgs.libclang.lib
];
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.nix.dev}/include -I${pkgs.gcc-unwrapped}/include/c++/${pkgs.gcc.version} -I${pkgs.gcc-unwrapped}/include/c++/${pkgs.gcc.version}/${pkgs.targetPlatform.config} -I${pkgs.glibc.dev}/include -I${pkgs.boost.dev}/include -I${pkgs.nlohmann_json}/include -I${pkgs.gcc-unwrapped}/lib/gcc/${pkgs.targetPlatform.config}/${pkgs.gcc.version}/include -I${pkgs.gcc-unwrapped}/lib/gcc/${pkgs.targetPlatform.config}/${pkgs.gcc.version}/include-fixed";
};
})
];