about summary refs log tree commit diff
path: root/pkgs/tools/graphics/diagrams-builder
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2024-04-04 10:48:34 +0200
committerNaïm Favier <n@monade.li>2024-04-04 10:49:45 +0200
commit7eb7e71eb8bcb439b7425c781ae71d5381598d5c (patch)
treebab09f9e8e17357c73791bf9098bb9267aa5ad41 /pkgs/tools/graphics/diagrams-builder
parent5d1a8fcb6673545419b4b00e2c0351b5ee662991 (diff)
mueval,diagrams-builder: fix GHC libdir
Rather than hardcoding the path to GHC's libdir which may change, use
`ghc --print-libdir` in wrappers.

Another option would be to expose mkGhcLibdir from generic-builder.nix.

Also add a test for mueval.
Diffstat (limited to 'pkgs/tools/graphics/diagrams-builder')
-rw-r--r--pkgs/tools/graphics/diagrams-builder/default.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkgs/tools/graphics/diagrams-builder/default.nix b/pkgs/tools/graphics/diagrams-builder/default.nix
index 85f4fdc83efa7..b88e4e517364f 100644
--- a/pkgs/tools/graphics/diagrams-builder/default.nix
+++ b/pkgs/tools/graphics/diagrams-builder/default.nix
@@ -17,13 +17,13 @@ let
   # Used same technique as for the yiCustom package.
   wrappedGhc = ghcWithPackages
     (self: [ diagrams-builder ] ++ extraPackages self);
-  ghcVersion = wrappedGhc.version;
+  ghc = lib.getExe' wrappedGhc "ghc";
 
   exeWrapper = backend : ''
     makeWrapper \
     "${diagrams-builder}/bin/diagrams-builder-${backend}" "$out/bin/diagrams-builder-${backend}" \
-      --set NIX_GHC ${wrappedGhc}/bin/ghc \
-      --set NIX_GHC_LIBDIR ${wrappedGhc}/lib/ghc-${ghcVersion}
+      --set NIX_GHC ${ghc} \
+      --set NIX_GHC_LIBDIR "$(${ghc} --print-libdir)"
   '';
 
   backends = ["svg" "cairo" "ps"];