summary refs log tree commit diff
path: root/pkgs/applications/editors/yi
diff options
context:
space:
mode:
authorMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2014-10-17 00:06:07 +0100
committerMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2014-10-17 00:39:31 +0100
commit0fac38fd48f3cdad917025d331ee42d6007aa555 (patch)
tree41fb98391d6315d0ad0999771328a1ab9c10e9f6 /pkgs/applications/editors/yi
parent1515dbf962d7a7d045f0706e8525266d6e92b140 (diff)
downloadnixlib-0fac38fd48f3cdad917025d331ee42d6007aa555.tar
nixlib-0fac38fd48f3cdad917025d331ee42d6007aa555.tar.gz
nixlib-0fac38fd48f3cdad917025d331ee42d6007aa555.tar.bz2
nixlib-0fac38fd48f3cdad917025d331ee42d6007aa555.tar.lz
nixlib-0fac38fd48f3cdad917025d331ee42d6007aa555.tar.xz
nixlib-0fac38fd48f3cdad917025d331ee42d6007aa555.tar.zst
nixlib-0fac38fd48f3cdad917025d331ee42d6007aa555.zip
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
Diffstat (limited to 'pkgs/applications/editors/yi')
-rw-r--r--pkgs/applications/editors/yi/yi-custom.nix20
-rw-r--r--pkgs/applications/editors/yi/yi.nix14
2 files changed, 14 insertions, 20 deletions
diff --git a/pkgs/applications/editors/yi/yi-custom.nix b/pkgs/applications/editors/yi/yi-custom.nix
index 59436392408f..9d63b3808032 100644
--- a/pkgs/applications/editors/yi/yi-custom.nix
+++ b/pkgs/applications/editors/yi/yi-custom.nix
@@ -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;
   };
 
 })
\ No newline at end of file
diff --git a/pkgs/applications/editors/yi/yi.nix b/pkgs/applications/editors/yi/yi.nix
index c1d1e52db3d7..d6a601a0aef3 100644
--- a/pkgs/applications/editors/yi/yi.nix
+++ b/pkgs/applications/editors/yi/yi.nix
@@ -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";