summaryrefslogtreecommitdiffstats
path: root/pkgs/tools/graphics/diagrams-builder
diff options
context:
space:
mode:
authorRaymond Gauthier <jraygauthier@gmail.com>2015-04-29 21:45:57 -0400
committerRaymond Gauthier <jraygauthier@gmail.com>2015-04-29 21:46:39 -0400
commit6119355c9cecbdc8f49abf0b7b4502c78a931d83 (patch)
tree7871bf3741405919efc7ec39d580eba25796717f /pkgs/tools/graphics/diagrams-builder
parent76a8089d96670fbb5dd35edaea7e83877c35a7ad (diff)
Simplify standalone `diagrams-builder` expression.
Diffstat (limited to 'pkgs/tools/graphics/diagrams-builder')
-rw-r--r--pkgs/tools/graphics/diagrams-builder/default.nix35
1 files changed, 18 insertions, 17 deletions
diff --git a/pkgs/tools/graphics/diagrams-builder/default.nix b/pkgs/tools/graphics/diagrams-builder/default.nix
index fc7766b403c4..a12e5dbb8bb3 100644
--- a/pkgs/tools/graphics/diagrams-builder/default.nix
+++ b/pkgs/tools/graphics/diagrams-builder/default.nix
@@ -11,32 +11,33 @@
*/
{ stdenv, ghcWithPackages, makeWrapper, diagrams-builder, extraPackages ? (self: []) }:
+
let
+
# Used same technique as for the yiCustom package.
- w = ghcWithPackages
+ wrappedGhc = ghcWithPackages
(self: [ diagrams-builder ] ++ extraPackages self);
- wrappedGhc = w.override { ignoreCollisions = true; };
- ghcVersion = w.version;
+ ghcVersion = wrappedGhc.version;
+
+ 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}
+ '';
+
+ backends = ["svg" "cairo" "ps"];
+
in
+
stdenv.mkDerivation {
name = "diagrams-builder";
+
buildInputs = [ makeWrapper ];
- buildCommand = ''
- makeWrapper \
- "${diagrams-builder}/bin/diagrams-builder-svg" "$out/bin/diagrams-builder-svg" \
- --set NIX_GHC ${wrappedGhc}/bin/ghc \
- --set NIX_GHC_LIBDIR ${wrappedGhc}/lib/ghc-${ghcVersion}
- makeWrapper \
- "${diagrams-builder}/bin/diagrams-builder-cairo" "$out/bin/diagrams-builder-cairo" \
- --set NIX_GHC ${wrappedGhc}/bin/ghc \
- --set NIX_GHC_LIBDIR ${wrappedGhc}/lib/ghc-${ghcVersion}
+ buildCommand = with stdenv.lib;
+ concatStrings (intersperse "\n" (map exeWrapper backends));
- makeWrapper \
- "${diagrams-builder}/bin/diagrams-builder-ps" "$out/bin/diagrams-builder-ps" \
- --set NIX_GHC ${wrappedGhc}/bin/ghc \
- --set NIX_GHC_LIBDIR ${wrappedGhc}/lib/ghc-${ghcVersion}
- '';
# Will be faster to build the wrapper locally then to fetch it from a binary cache.
preferLocalBuild = true;
meta = diagrams-builder.meta;