markus1189 / dyalog-nixos

Run dyalog APL and RIDE on nixos
21 stars 5 forks source link

Build RIDE from Dyalog/ride instead of patching .deb release #10

Closed TomaSajt closed 1 year ago

TomaSajt commented 1 year ago

This PR adds build instructions for the RIDE repo, essentially simulating what their mk script does. The nixpkgs flake input was also updated, as npm i failed without it (probably some new package or something)

TomaSajt commented 1 year ago

I noticed while testing, that the Dyalog .deb release also contains a RIDE release inside. Maybe in the future we could symlink that directory to the one generated here, but that's out of the scope of this PR.

MaxCan-Code commented 1 year ago

What do you think of adding the RIDE repo as a flake input? Starting with

inputs.ride.url = github:Dyalog/ride;
inputs.ride.flake = false;

in flake.nix

TomaSajt commented 1 year ago

What do you think of adding the RIDE repo as a flake input?

I don't think it's the best idea, because the build process uses the git revision itself.

Although we could use fake info there, if that's considered good practice. If there is a clean method of getting git metadata from a flake input, we could use that.

(I also hard-coded the timestamp of the last commit, maybe there's a way of getting that also)

here's the link to the mk script, where it queries the metadata: https://github.com/Dyalog/ride/blob/246649aad81daadfa8ac7e0af7c0206e49b4e337/mk#L36

(RIDE crashes without the version info, iirc)

TomaSajt commented 1 year ago

This commit adds github:Dyalog/ride as a flake input. It also adds an explicit nixpkgs input. It uses the flake.lock file to get the revision info (a bit weird, but it works). I couldn't figure out any way to get the other git metadata, so I just left them out

(I also did some cleanup to reduce the final package size)

TomaSajt commented 1 year ago

My concern is that the npmDepsHash could be invalid if a used npm package gets updated. It could happen when someone overrides the nixpkgs input to follow their own config's input.

MaxCan-Code commented 1 year ago

Should be fine if they follow the instructions on https://nixos.wiki/wiki/Node.js

markus1189 commented 1 year ago

Thanks for all the work! I'm happy with the improvement and will merge this