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

Installing texmath binary as dependency in Nix project #226

Closed
dpk opened this issue Sep 16, 2023 · 2 comments
Closed

Installing texmath binary as dependency in Nix project #226

dpk opened this issue Sep 16, 2023 · 2 comments

Comments

@dpk
Copy link

dpk commented Sep 16, 2023

I have a non-Haskell project which depends on the texmath binary. I’m trying to set this up as a dependency in Nix and am not getting very far.

nixpkgs.haskellPackages.texmath does not include the binary (also not the server binary). I tried adding the texmath repo as a submodule and adding its default.nix as a build input, but that gave this error when I tried to start the shell:

bash: pop_var_context: head of shell_variables not a function context
bash: pop_var_context: head of shell_variables not a function context

and I’m not sure how I’d go about adapting that to also install the binary anyway.

@jgm
Copy link
Owner

jgm commented Sep 16, 2023

I can't help with nix, but to get the executable you need to set the executable flag when compiling, e.g. -fexecutable when using cabal.

@dpk
Copy link
Author

dpk commented Sep 16, 2023

This did it:

let
  pkgs = import <nixpkgs> {};
  texmath = pkgs.haskellPackages.texmath;
  texmath-executable = pkgs.haskell.lib.addBuildDepends (pkgs.haskell.lib.enableCabalFlag texmath "executable") [ pkgs.haskellPackages.network-uri ];
in
pkgs.mkShell {
  buildInputs = [
    texmath-executable
  ];
}

@dpk dpk closed this as completed Sep 16, 2023
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

No branches or pull requests

2 participants