markus1189 / dyalog-nixos

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

Fix and clean up the Dyalog derivation #11

Closed TomaSajt closed 1 year ago

TomaSajt commented 1 year ago

This PR updates the dyalox.nix script.

Some of the libraries that patchelf used weren't the correct ones, so I tracked them down using github:mic92/nix-index-database, and swapped them out. I also used autoPatchelfHook, because I think it's a much tidier way of doing patching.

The other changes in the code include removing broken and unused files.

all of these combined take the final package from ~500 MiB to ~2MiB (sadly the initial download is still the whole package)

Some features that remain to be untested whether or not they work: Conga, APSQL (and probably some others I don't even know about)

I'm not sure how needed this PR is, or if I went a bit overboard with the file removal, so I'd appreciate some feedback.

TomaSajt commented 1 year ago

Just another thing: in the original there was a line setting the TERM variable to some default value (which I kept in, just to be sure). I see that it was added initially to the Dyalog 17.0 derivation, maybe it's no longer needed in 18.2?

MaxCan-Code commented 1 year ago

Nice work!

  • I also removed the built in RIDEapp directory and everything related to it, because I don't think that the dyalog script would ever need RIDE to run. (If anyone knows why it's even included, please do tell me)

Try RIDE_INIT=HTTP:*:4502 dyalog and visit http://localhost:4502 Explanation from https://docs.dyalog.com/latest/RIDE%20User%20Guide.pdf:

On non-Windows platforms, the Zero Footprint RIDE is automatically installed to the default location ([DYALOG]/RIDEapp)

For more see https://help.dyalog.com/latest/Content/UserGuide/Installation%20and%20Configuration/Configuration%20Parameters/RIDE_Init.htm

  • The .NET stuff could also be removed, as you can't even install dotnet-sdk_3 from nixpkgs anymore, and that's the only version Dyalog 18.2 supports (according to the docs).

nix shell nixpkgs/nixos-22.11#dotnet-sdk_3 is possible

  • There were also some miscellaneous files and directories removed.

    • one of them is the help directory, which contains the .pdfs you could find online. (I doubt anyone would go looking in the nix store for documentation.)

I use ln -s $out/{help,share/doc/dyalog} in installPhase to read it on /etc/profiles/per-user/$USER/share/doc/dyalog, but I'm fine with removing the help files

  • another is the mapl script and the scripts it would call

Should be fine to remove Docs on mapl: https://help.dyalog.com/latest/Content/UNIX_IUG/Starting%20APL.htm

all of these combined take the final package from ~500 MiB to ~2MiB (sadly the initial download is still the whole package)

Impressive

I'm not sure how needed this PR is, or if I went a bit overboard with the file removal, so I'd appreciate some feedback.

I like the bold changes

markus1189 commented 1 year ago

I'm not a poweruser myself, but I like the size reduction. I'm fine with merging this, if there is something missing later on we can iterate.

Thanks for the work!