2014-01-04 22:46:05 +00:00
|
|
|
{ cabal, alex, binary, Cabal, cautiousFile, concreteTyperep
|
2014-04-12 16:18:50 +01:00
|
|
|
, dataDefault, derive, Diff, dlist, dyre, filepath, fingertree
|
|
|
|
, glib, gtk, hashable, hint, HUnit, lens, mtl, pango, parsec
|
|
|
|
, pointedlist, QuickCheck, random, regexBase, regexTdfa, safe
|
|
|
|
, split, tasty, tastyHunit, tastyQuickcheck, time, transformersBase
|
|
|
|
, uniplate, unixCompat, unorderedContainers, utf8String, vty
|
2014-02-28 09:43:47 +00:00
|
|
|
, xdgBasedir
|
2014-06-07 20:04:16 +01:00
|
|
|
, withPango ? true
|
|
|
|
|
|
|
|
# User may need extra dependencies for their configuration file so we
|
|
|
|
# want to specify it here to have them available when wrapping the
|
|
|
|
# produced binary.
|
|
|
|
, extraDepends ? [ ]
|
2014-01-04 22:46:05 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
cabal.mkDerivation (self: {
|
|
|
|
pname = "yi";
|
2014-04-12 16:18:50 +01:00
|
|
|
version = "0.8.1";
|
|
|
|
sha256 = "1hyqlydc0na9pkb3fkbp13c6vnp4f80z8237bvrv12wkk5syyn23";
|
2014-01-04 22:46:05 +00:00
|
|
|
isLibrary = true;
|
|
|
|
isExecutable = true;
|
|
|
|
buildDepends = [
|
2014-04-12 16:18:50 +01:00
|
|
|
binary Cabal cautiousFile concreteTyperep dataDefault derive Diff
|
2014-06-07 20:04:16 +01:00
|
|
|
dlist dyre filepath fingertree hashable hint lens mtl
|
|
|
|
parsec pointedlist QuickCheck random regexBase regexTdfa safe
|
2014-04-12 16:18:50 +01:00
|
|
|
split time transformersBase uniplate unixCompat unorderedContainers
|
|
|
|
utf8String vty xdgBasedir
|
2014-06-07 20:04:16 +01:00
|
|
|
] ++ (if withPango then [ pango gtk glib ] else [ ]) ++ extraDepends;
|
2014-01-04 22:46:05 +00:00
|
|
|
testDepends = [
|
2014-04-12 16:18:50 +01:00
|
|
|
filepath HUnit QuickCheck tasty tastyHunit tastyQuickcheck
|
2014-01-04 22:46:05 +00:00
|
|
|
];
|
|
|
|
buildTools = [ alex ];
|
2014-06-07 20:04:16 +01:00
|
|
|
configureFlags = if withPango then "-fpango" else "-f-pango";
|
2014-01-09 10:29:13 +00:00
|
|
|
doCheck = false;
|
2014-06-07 20:04:16 +01:00
|
|
|
|
|
|
|
# https://ghc.haskell.org/trac/ghc/ticket/9170
|
|
|
|
noHaddock = self.ghc.version == "7.6.3";
|
|
|
|
|
|
|
|
# Allows Yi to find the libraries it needs at runtime.
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/bin/yi $out/bin/.yi-wrapped
|
|
|
|
cat - > $out/bin/yi <<EOF
|
|
|
|
#! ${self.stdenv.shell}
|
|
|
|
# Trailing : is necessary for it to pick up Prelude &c.
|
|
|
|
export GHC_PACKAGE_PATH=$(${self.ghc.GHCGetPackages} ${self.ghc.version} \
|
|
|
|
| sed 's/-package-db\ //g' \
|
|
|
|
| sed 's/^\ //g' \
|
|
|
|
| sed 's/\ /:/g')\
|
|
|
|
:$out/lib/ghc-${self.ghc.version}/package.conf.d/yi-$version.installedconf:
|
|
|
|
|
|
|
|
eval exec $out/bin/.yi-wrapped "\$@"
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/yi
|
|
|
|
'';
|
|
|
|
|
2014-01-04 22:46:05 +00:00
|
|
|
meta = {
|
|
|
|
homepage = "http://haskell.org/haskellwiki/Yi";
|
|
|
|
description = "The Haskell-Scriptable Editor";
|
2014-06-07 20:04:16 +01:00
|
|
|
license = self.stdenv.lib.licenses.gpl2;
|
2014-01-04 22:46:05 +00:00
|
|
|
platforms = self.ghc.meta.platforms;
|
2014-06-07 20:04:16 +01:00
|
|
|
maintainers = [ self.stdenv.lib.maintainers.fuuzetsu ];
|
2014-01-04 22:46:05 +00:00
|
|
|
};
|
|
|
|
})
|