Hi, I’m trying to compile Emacs vterm module (emacs-libvterm). I created the following shell.nix:
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "myenv";
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ glib libvterm ];
}
When I try to compile emacs-libvterm (after running cmake), I get the following error:
In file included from /home/pdm/install/emacs-libvterm/vterm-module.h:7,
from /home/pdm/install/emacs-libvterm/vterm-module.c:1:
/nix/store/wkbqhxih8d7m6mm591cs8ijs4xrfng23-libvterm-0.99.7/include/vterm.h:29:10: fatal error: glib.h: No such file or directory
29 | #include <glib.h>
| ^~~~~~~~
Looking into $NIX_CFLAGS_COMPILE, it looks like glib-2.0
prefix is missing in the include but when I attempt to add -isystem /nix/store/hb6idpb0z1h019bb0hslj9wj3h3qdfhq-glib-2.68.2-dev/include/glib-2.0
there, I get another error:
In file included from /nix/store/hb6idpb0z1h019bb0hslj9wj3h3qdfhq-glib-2.68.2-dev/include/glib-2.0/glib/galloca.h:32,
from /nix/store/hb6idpb0z1h019bb0hslj9wj3h3qdfhq-glib-2.68.2-dev/include/glib-2.0/glib.h:30,
from /nix/store/wkbqhxih8d7m6mm591cs8ijs4xrfng23-libvterm-0.99.7/include/vterm.h:29,
from /home/pdm/install/emacs-libvterm/vterm-module.h:7,
from /home/pdm/install/emacs-libvterm/vterm-module.c:1:
/nix/store/hb6idpb0z1h019bb0hslj9wj3h3qdfhq-glib-2.68.2-dev/include/glib-2.0/glib/gtypes.h:32:10: fatal error: glibconfig.h: No such file or directory
32 | #include <glibconfig.h>
| ^~~~~~~~~~~~~~
What am I missing and how can I compile the Emacs vterm module on NixOS?