Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix package PoC #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Nix package PoC #7

wants to merge 4 commits into from

Conversation

sorki
Copy link
Contributor

@sorki sorki commented Oct 24, 2020

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.

@hannesweisbach
Copy link
Collaborator

I like the the idea of Nix-ifying the build, however I'm quite new to Nix.

A couple of things though:

  1. 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.
  2. 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 :)

@hannesweisbach
Copy link
Collaborator

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.

@sorki
Copy link
Contributor Author

sorki commented Oct 27, 2020

  • Ad 1 - Looks like cmake build works (you can try s/qmake/cmake/g) but it misses install target and the executable is called explicitCAD.
  • Ad 2 - I think for now it's better to just submit a PR to nixpkgs as that makes the package instantly available for all nixpkgs users. It's not quite clear how to split nixpkgs currently 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

@hannesweisbach
Copy link
Collaborator

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 nixpkgs as that makes the package instantly available for all nixpkgs users. It's not quite clear how to split nixpkgs currently 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.

sorki and others added 4 commits October 30, 2020 10:26
@hannesweisbach
Copy link
Collaborator

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.

@sorki sorki marked this pull request as ready for review December 3, 2020 15:42
@sorki
Copy link
Contributor Author

sorki commented Dec 3, 2020

LGTM! 👍 I've marked it is ready, feel free to squash / merge / reword my XXX commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants