Package Godot Projects to nixpkgs

I Would like to package some godot projects:
https://github.com/YuriSizov/boscaceoil-blue
https://github.com/RodZill4/material-maker
I looked up at the nixos documentation and found nothing about it, so i was wondering what to do,
compile from source ?? or try packaging the binaries from the releases. If you know what sould be the correct step, could you link a guide i can follow to package them myself. Thanks

The typical Nix package compiles from source. But I don’t have experience with godot.

There are a few Godot projects in nixpkgs already, which you might find useful:

Maybe we can extract similar patterns from these and create some documentation for Godot.

2 Likes

For now i managed to get material maker sort of working, i dont have any nodes but it runs, and i cant manage to make bosca-ceoil blue work because for some reason i cant export it to linux via the godot3-headless export :

last 10 log lines:
       > ERROR: Invalid export preset name: Linux/X11.
       > The following presets were detected in this project's `export_presets.cfg`:
       >
       >         "Windows - x86_64"
       >         "Windows - x86_32"
       >         "Android - Universal"
       >
       >    at: _fs_changed (editor/editor_node.cpp:818)
       > reimport: end
       > EditorSettings: Save OK!

You can see the files i made in my dotfiles in the modules directory GitHub - aurreland/Messy-Dotfiles

1 Like

For Material Maker, i think i need to use fetchurl and get the bin because it contains folder different than src that the programs need to run, will look into it tommorow.

Where Should i put the folders from the binary (there is the bin file and folder that are required). Should i put it in the same place at the bin or an other ?

Which folder is that, exactly? Would it be material_maker?

I found the flatpak installation source and it copies these folders from that one (there is no export though):

I’m having a go at this as well using Godot 4, but I haven’t had much luck with both packages. It’s nice that Material Maker starts with Godot 3, though.

By the way, the Linux export name for bosca-ceoil is Linux - x86_64 according to their export_presets.cfg file.

The export can be found inside the tar.gz of the binary not the source files.
Thanks for the flatpak install, will be useful i think.

inside material_maker there are folder with same name, export is in misc tho, but the content seems to be different, i think we should pull from bin

1 Like

ive made this :

everything works but for some reasons when i put material_marker.x86_64 but if i remove the filetype name it doesnt work

1 Like

Nice work! At this point though, I think it would be best if we just patch the binary release if we’re gonna end up downloading it anyways as that would be cleaner and easier.

This way, we’d also be sure that the package is working properly, because we don’t know how the program would behave when compiled with a different Godot version from what it was intended.

Interesting. What if you put it in a wrapper?

If you could pass me a link to some doc about wrappers that would be awesome.
Tho the binary should already be patched as i use autoPatchelfHook in the nativeBuildInputs as stated in the doc https://wiki.nixos.org/wiki/Packaging/Binaries

I think i managed to get it working, just need to clean up the package as i think some dependencies i added are not needed, i will try this approach for bosca-ceoil as it doesnt work with source files.
If you can lookup to my file and point out if thereare any errors. https://github.com/aurreland/Messy-Dotfiles/blob/a03b3cae2339aa63261a2a65d0ae2876bafb7f21/modules/material-maker.nix

1 Like

The manual does a great job of explaining it. You can also check out makeWrapper arguments and the other wrappers in the setup hooks folder.

Sure. Would it be possible to open a PR? This would make reviewing much easier.

1 Like

Im planning to do a PR this afternoon or tonight, will update you as soon as possible.

1 Like