wondering if anyone has recommendations on how to write a nix derivation for a project that is built with meson and that relies on wrapped subprojects with patches.
One approach i have seen so far consists in removing the wrap file, and replacing the corresponding directory (via a symlink) with a fetched package (e.g. from github). That seems to work, but then the project may be missing patches, and a meson.build which are defined under subprojects/packagefiles/..., which meson usually applies when “unwrapping” or processing the .wrap file.
I’m wondering how people handle this. I started to browse the nixpkgs repo, but have yet to find an example that deals with patches and missing meson.build files.
No good reason, there are so many parts of the nix ecosystem I don’t know much about and NUR is one of them
There was some recent discussion about this here and I tend to agree that I’d rather fetch the subprojects “myself” in the nix code. But the postFetch stuff is a lot more concise for sure.
Thanks for sharing your thoughts, folks! It’s really helpful to hear about your experiences and different strategies for dealing with Meson-wrapped subprojects in Nix. I’ll definitely look into using the postFetch attribute for a cleaner solution in my own projects. Also, I’ll explore adding my packages to the Nix User Repository (NUR) to make them more widely available. Your advice is much appreciated
I used a strategy pretty similar to the one above, though I didn’t use nativeBuildInputs, because I assumed it’s not supported inside fetchers. Nice to know.
Edit: turns out you can’t use nativeBuildInputs if fetchSubmodules is enabled too.