pandoc icon indicating copy to clipboard operation
pandoc copied to clipboard

WIP: Create a working `flake.nix`

Open srid opened this issue 1 year ago • 4 comments

  • [x] Bootstrap flake.nix based on haskell-flake, overriding dependencies
  • [ ] nix build to work
  • [ ] devShell (nix develop) to work
  • [ ] HLS to work
  • [ ] Upstream skylighting Nix
  • [ ] How should Nix package deal with cabal flags?

srid avatar Jul 04 '24 23:07 srid

Got all the dependencies building, as well as the pandoc sources to build, but the installPhase is failing:

$ nix build -L
...
pandoc> Running phase: installPhase
pandoc> Installing internal library xml-light in /nix/store/6hj2lf84wl10hqmymp8xz9m772g6hdw6-pandoc-3.2.1/lib/ghc-9.6.5/lib/aarch64-osx-ghc-9.6.5/pandoc-3.2.1-5gNPAzSbfOpCcG9wr5Jih8-xml-light
pandoc> Installing library in /nix/store/6hj2lf84wl10hqmymp8xz9m772g6hdw6-pandoc-3.2.1/lib/ghc-9.6.5/lib/aarch64-osx-ghc-9.6.5/pandoc-3.2.1-Cyanjkwa9raImcHGQJDkHy
pandoc> mv: missing destination file operand after '/nix/store/6hj2lf84wl10hqmymp8xz9m772g6hdw6-pandoc-3.2.1/share/man/man1/'
pandoc> Try 'mv --help' for more information.
pandoc> /nix/store/ashgigyp2dkvfi1spyl9nsnirvbk67vh-stdenv-darwin/setup: line 140: pop_var_context: head of shell_variables not a function context

srid avatar Jul 04 '24 23:07 srid

This feel closer to the goal than where it started, but without a working installPhase even nix run isn't usable on the flake. It looks like the trouble is with moving the man page to the right destination. Where is that command coming from?

alerque avatar Jul 23 '24 11:07 alerque

It is probably something to do with this:

https://github.com/jgm/pandoc/blob/2f36df65e6b8aa9b12551b3773d55a855c24a03d/pandoc-cli/pandoc-cli.cabal#L17-L21

And how https://github.com/NixOS/cabal2nix (which haskell-flake, via nixpkgs, uses) handles it.

srid avatar Jul 23 '24 15:07 srid

Perhaps use one of the early (postUnpack?) stages to patch that out of the sources and see what happens?

alerque avatar Jul 23 '24 20:07 alerque