Nix package PoC
Allows to build explicitcad with Nix using nix-build. Afterwards it can be launched using ./result/bin/explicitcad wrapper, which also sets PATH correctly to contain extopenscad binary so stuff just works^TM.
Creating a draft PR so I don't forget about this - let me know when you feel like it's a good time to submit this as a NixOS package, ideally some releases/tags would be cool so I don't have to pick arbitrary commits from master.
I like the the idea of Nix-ifying the build, however I'm quite new to Nix.
A couple of things though:
- Can you use CMake instead of qmake? I prefer CMake over qmake because it tells me when depedendencies are missing instead of just failing at build (what qmake does). Maybe I'm using qmake wrong, though.
- Can you write a flakes.nix? 😬 It is my understanding that this way you dont need to PR to upstream Nix anymore? Do you know how they differ from a "normal" nix file?
I feel like there was a '3.' but I cant think of it now ;)
As for releases: I want to be able to build distributable packages for at least two OSs before doing that and then have CI create a package with each release. I have a PoC to build a *.dmg or macOS and I've set up a Windows and Linux test machine … releases coming "soon"-ish :)
Oh, I rembered 3: adding nix-build to the CI ;) Doesn't mean you have to do it, specifically, but if the feature "builds under Nix" is in the software I want it at least tested.
- Ad 1 - Looks like
cmakebuild works (you can trys/qmake/cmake/g) but it misses install target and the executable is calledexplicitCAD. - Ad 2 - I think for now it's better to just submit a PR to
nixpkgsas that makes the package instantly available for all nixpkgs users. It's not quite clear how to splitnixpkgscurrently and it will probably remain in monorepo state with some parts (like autogenerated Haskell package set and similar split into flakes). Flake for a package is relatively straightforward - just define an overlay like
(self: super: {
explicitcad = self.libsForQt5.callPackage ./explicitcad.nix {};
})
and expose it via flake.nix
it misses install target
so did qmake …
and the executable is called
explicitCAD.
which is imo the correct capitalization. Or "ExplicitCAD" … idk.
- Ad 2 - I think for now it's better to just submit a PR to
nixpkgsas that makes the package instantly available for all nixpkgs users. It's not quite clear how to splitnixpkgscurrently and it will probably remain in monorepo state with some parts (like autogenerated Haskell package set and similar split into flakes). Flake for a package is relatively straightforward - just define an overlay like
Ok, good to know.
I took the liberty of rebasing the changes in this PR on top of the current master. I hope I did it right and didn't break anything.
LGTM! :+1: I've marked it is ready, feel free to squash / merge / reword my XXX commit.