haskell-yi: make the wrapper less cumbersome

It still suffers from ‘everything breaks’ if there is any Haskell in
user env: https://github.com/NixOS/nixpkgs/issues/4560
This commit is contained in:
Mateusz Kowalczyk 2014-10-17 00:06:07 +01:00
parent 1515dbf962
commit 0fac38fd48
3 changed files with 17 additions and 23 deletions

View File

@ -9,34 +9,32 @@
# reload and similar functions should all work as long as the user
# doesn't need new libraries at which point they should add them to
# extraPackages and rebuild from the expression.
{ cabal, yi, extraPackages, makeWrapper }:
{ cabal, yi, extraPackages, makeWrapper, ghcWithPackages }:
let
w = ghcWithPackages (self: [ yi ] ++ extraPackages self);
wrappedGhc = w.override { ignoreCollisions = true; };
in
cabal.mkDerivation (self: rec {
pname = "yi-custom";
version = "0.0.0.1";
src = ./yi-custom-cabal;
isLibrary = true;
buildDepends = extraPackages ++ [ yi ];
buildDepends = [ yi ];
buildTools = [ makeWrapper ];
noHaddock = true;
doCheck = false;
# Allows Yi to find the libraries it needs at runtime. We drop :
# from this GHC_PACKAGE_PATH because we're wrapping over a different
# wrapper that used --prefix: if we didn't, we end up with a
# double-colon, confusing GHC.
# put custom GHC env in front which stops crap from being picked up
# from user database
postInstall = ''
makeWrapper ${yi}/bin/yi $out/bin/yi --set GHC_PACKAGE_PATH ''${GHC_PACKAGE_PATH%?}
makeWrapper ${yi}/bin/yi $out/bin/yi --prefix PATH : ${wrappedGhc}/bin
'';
meta = {
homepage = "http://haskell.org/haskellwiki/Yi";
description = "Wrapper over user-specified Haskell libraries for use in Yi config";
license = self.stdenv.lib.licenses.publicDomain;
platforms = self.ghc.meta.platforms;
maintainers = with self.stdenv.lib.maintainers; [ fuuzetsu ];
# The wrapper does not yet work properly if we actually try to use it.
broken = true;
};
})

View File

@ -2,11 +2,11 @@
{ cabal, binary, Cabal, cautiousFile, dataDefault, derive, dlist
, dynamicState, dyre, filepath, glib, gtk, hashable, hint, HUnit
, lens, makeWrapper, mtl, ooPrototypes, pango, parsec, pointedlist
, QuickCheck, random, regexBase, regexTdfa, safe, semigroups, split
, tagged, tasty, tastyHunit, tastyQuickcheck, text, time
, transformersBase, unixCompat, unorderedContainers, utf8String
, vty, wordTrie, xdgBasedir, yiLanguage, yiRope
, lens, mtl, ooPrototypes, pango, parsec, pointedlist, QuickCheck
, random, regexBase, regexTdfa, safe, semigroups, split, tagged
, tasty, tastyHunit, tastyQuickcheck, text, time, transformersBase
, unixCompat, unorderedContainers, utf8String, vty, wordTrie
, xdgBasedir, yiLanguage, yiRope
}:
cabal.mkDerivation (self: {
@ -27,12 +27,8 @@ cabal.mkDerivation (self: {
filepath HUnit lens QuickCheck semigroups tasty tastyHunit
tastyQuickcheck text yiLanguage yiRope
];
buildTools = [ makeWrapper ];
configureFlags = "-fpango -fvty";
noHaddock = self.stdenv.lib.versionOlder self.ghc.version "7.8";
postInstall = ''
wrapProgram $out/bin/yi --suffix GHC_PACKAGE_PATH : $out/lib/ghc-${self.ghc.version}/package.conf.d/yi-$version.installedconf:$GHC_PACKAGE_PATH
'';
meta = {
homepage = "http://haskell.org/haskellwiki/Yi";
description = "The Haskell-Scriptable Editor";

View File

@ -3097,14 +3097,14 @@ self : let callPackage = x : y : modifyPrio (newScope self x y); in
wordTrie = callPackage ../development/libraries/haskell/word-trie {};
# You should prefer yiCustom over yi unless you never plan to
# use any external libraries in your config.
# This is an unwrapped version of Yi, it will not behave well (no
# M-x or reload). Use yiCustom instead.
yi = callPackage ../applications/editors/yi/yi.nix { };
yiContrib = callPackage ../development/libraries/haskell/yi-contrib {};
yiCustom = callPackage ../applications/editors/yi/yi-custom.nix {
extraPackages = [];
extraPackages = pkgs: [];
};
yiLanguage = callPackage ../development/libraries/haskell/yi-language {};