I have written a flake of binder, a C++ binding generator for python. It uses (lib)clang under the hood and clang args can be passed via --extra-args
.
But when running it, it cannot find the C++ standard library. I’ve been trying to add -I/nix/store/...
pathes manually and chasing the errors, but I cannot find the right paths. Always still something is missing (for example stddef.h
or whatever).
How to provide all required and correct include pathes?
{
description = "C++ bindings generator for python";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgs = forAllSystems (system: import nixpkgs { inherit system; });
in {
packages = forAllSystems (system:
let
binderDrv = with pkgs.${system}; stdenv.mkDerivation {
pname = "binder";
version = "1.3.0";
src = fetchurl {
url = "https://github.com/RosettaCommons/binder/archive/refs/tags/v1.3.0.tar.gz";
hash = "sha256-Iqr0rekqis8VGY6Eep9k/9I59DJSryTOqnzIvcRTELI=";
};
nativeBuildInputs = [
cmake
];
buildInputs = [
(python3Packages.pybind11.overrideAttrs (old: {
src = fetchFromGitHub {
owner = "RosettaCommons";
repo = "pybind11";
rev = "5b0a6fc2017fcc176545afe3e09c9f9885283242";
hash = "sha256-n7nLEG2+sSR9wnxM+C8FWc2B+Mx74Pan1+IQf+h2bGU=";
};
}))
libxml2
libffi
libllvm
libclang
];
enableParallelBuilding = true;
cmakeFlags = [ "-DBINDER_ENABLE_TEST=OFF" ];
meta = {
desciption = "binder";
homepage = "https://cppbinder.readthedocs.io/";
platforms = lib.platforms.linux;
};
};
in {
default = binderDrv;
}
);
};
}