I'm bundling a `.cpp` program that depends on `libxml`, but `g++` cannot find it. I've done the appropriate steps to make `libxml` available, however the directory structure is slightly different than the source expects. I want to know about nix-based solutions to this problem. 

The compiler (from a nix-shell session) says that `libxml` is not in my system path: 

```
fatal error: libxml/encoding.h: No such file or directory
#include <libxml/encoding.h>

```

However, it should be. In my .nix file I made sure to included `libxml2`

```
buildInputs = [ ... libxml2 ...];

```

and my `nix-shell` environment confirms that the library is present:

```
NIX_CFLAGS_COMPILE= [...] -isystem /nix/store/zf1nyqyx2zd6y944ln2rxnhd5m4265n4-libxml2-2.9.9-dev/include  [...]

```

If I look in that directory, I find the search path is off. The path to the file is actually (relative to NIX\_CFLAGS\_COMPILE path):

```
libxml2/libxml/encoding.h

```

I found that I can compensate for this off-by-one path error by adding the following option to my compile command:

```
-isystem /nix/store/zf1nyqyx2zd6y944ln2rxnhd5m4265n4-libxml2-2.9.9-dev/include/libxml2

```

(The same path as the `NIX_CFLAGS_COMPILE`, but starting at the `libxml2` directory.)

Given that information, I am wondering about a nix-based solution to this problem. The source is not mine, so changing them is the last thing I want to do. I see two other options. 

First, I could add the path in the makefile that is triggered during `buildPhase`. However, I'm not exactly sure how to simply grab that path. For instance, inheriting `libxml2` in my derivation makes the `libxm2-2.9.9-bin` directory available, when I need the `libxml2-2.9.9-dev`. I suppose I could `grep` or `sed` on the `NIX_CFLAGS_COMPILE` path, but I'd rather not.

My preferred solution would be to make a simple `libxml` derivation based off the `libxml2` and just add that to my buildInputs, but that seems like it might not be simple either.