Guidance on packaging Ruby gem `nokolexbor` in Nixpkgs

Hello everyone,

I’d like to package the Ruby gem nokolexbor in Nixpkgs, but I ran into a problem.

Gem details:

Issue:

  • Nokolexbor includes a native C extension that links against the Lexbor C library. (The good news is that lexbor is already packaged in Nix.)
  • Its build also requires CMake, which does not seem to be automatically handled by the standard Ruby gem packaging in Nixpkgs.

Question:

Given these native dependencies, what is the recommended approach for packaging this gem in Nixpkgs?

Any guidance would be greatly appreciated!

I think you can take inspiration from how the rugged gem is packaged (or any other that requires cmake), see the code for it.

I’ve followed the docs about adding a gem to the default gemset and more generally the ruby section to package gems (working on a PR as I write this).

I think you just need something like:

nokolexbor = {
  nativeBuildInputs = [
    cmake
    lexbor
  ];
};

but no guarantees, I’m quite new to this game too :sweat_smile:

Thanks for your input. I made a PR here.