mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 12:53:59 +03:00
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:
parent
1515dbf962
commit
0fac38fd48
@ -9,34 +9,32 @@
|
|||||||
# ‘reload’ and similar functions should all work as long as the user
|
# ‘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
|
# doesn't need new libraries at which point they should add them to
|
||||||
# extraPackages and rebuild from the expression.
|
# 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 {
|
cabal.mkDerivation (self: rec {
|
||||||
pname = "yi-custom";
|
pname = "yi-custom";
|
||||||
version = "0.0.0.1";
|
version = "0.0.0.1";
|
||||||
src = ./yi-custom-cabal;
|
src = ./yi-custom-cabal;
|
||||||
isLibrary = true;
|
isLibrary = true;
|
||||||
buildDepends = extraPackages ++ [ yi ];
|
buildDepends = [ yi ];
|
||||||
buildTools = [ makeWrapper ];
|
buildTools = [ makeWrapper ];
|
||||||
noHaddock = true;
|
noHaddock = true;
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
# Allows Yi to find the libraries it needs at runtime. We drop ‘:’
|
# put custom GHC env in front which stops crap from being picked up
|
||||||
# from this GHC_PACKAGE_PATH because we're wrapping over a different
|
# from user database
|
||||||
# wrapper that used --prefix: if we didn't, we end up with a
|
|
||||||
# double-colon, confusing GHC.
|
|
||||||
postInstall = ''
|
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 = {
|
meta = {
|
||||||
homepage = "http://haskell.org/haskellwiki/Yi";
|
homepage = "http://haskell.org/haskellwiki/Yi";
|
||||||
description = "Wrapper over user-specified Haskell libraries for use in Yi config";
|
description = "Wrapper over user-specified Haskell libraries for use in Yi config";
|
||||||
license = self.stdenv.lib.licenses.publicDomain;
|
license = self.stdenv.lib.licenses.publicDomain;
|
||||||
platforms = self.ghc.meta.platforms;
|
platforms = self.ghc.meta.platforms;
|
||||||
maintainers = with self.stdenv.lib.maintainers; [ fuuzetsu ];
|
maintainers = with self.stdenv.lib.maintainers; [ fuuzetsu ];
|
||||||
# The wrapper does not yet work properly if we actually try to use it.
|
|
||||||
broken = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
})
|
})
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
{ cabal, binary, Cabal, cautiousFile, dataDefault, derive, dlist
|
{ cabal, binary, Cabal, cautiousFile, dataDefault, derive, dlist
|
||||||
, dynamicState, dyre, filepath, glib, gtk, hashable, hint, HUnit
|
, dynamicState, dyre, filepath, glib, gtk, hashable, hint, HUnit
|
||||||
, lens, makeWrapper, mtl, ooPrototypes, pango, parsec, pointedlist
|
, lens, mtl, ooPrototypes, pango, parsec, pointedlist, QuickCheck
|
||||||
, QuickCheck, random, regexBase, regexTdfa, safe, semigroups, split
|
, random, regexBase, regexTdfa, safe, semigroups, split, tagged
|
||||||
, tagged, tasty, tastyHunit, tastyQuickcheck, text, time
|
, tasty, tastyHunit, tastyQuickcheck, text, time, transformersBase
|
||||||
, transformersBase, unixCompat, unorderedContainers, utf8String
|
, unixCompat, unorderedContainers, utf8String, vty, wordTrie
|
||||||
, vty, wordTrie, xdgBasedir, yiLanguage, yiRope
|
, xdgBasedir, yiLanguage, yiRope
|
||||||
}:
|
}:
|
||||||
|
|
||||||
cabal.mkDerivation (self: {
|
cabal.mkDerivation (self: {
|
||||||
@ -27,12 +27,8 @@ cabal.mkDerivation (self: {
|
|||||||
filepath HUnit lens QuickCheck semigroups tasty tastyHunit
|
filepath HUnit lens QuickCheck semigroups tasty tastyHunit
|
||||||
tastyQuickcheck text yiLanguage yiRope
|
tastyQuickcheck text yiLanguage yiRope
|
||||||
];
|
];
|
||||||
buildTools = [ makeWrapper ];
|
|
||||||
configureFlags = "-fpango -fvty";
|
configureFlags = "-fpango -fvty";
|
||||||
noHaddock = self.stdenv.lib.versionOlder self.ghc.version "7.8";
|
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 = {
|
meta = {
|
||||||
homepage = "http://haskell.org/haskellwiki/Yi";
|
homepage = "http://haskell.org/haskellwiki/Yi";
|
||||||
description = "The Haskell-Scriptable Editor";
|
description = "The Haskell-Scriptable Editor";
|
||||||
|
@ -3097,14 +3097,14 @@ self : let callPackage = x : y : modifyPrio (newScope self x y); in
|
|||||||
|
|
||||||
wordTrie = callPackage ../development/libraries/haskell/word-trie {};
|
wordTrie = callPackage ../development/libraries/haskell/word-trie {};
|
||||||
|
|
||||||
# You should prefer ‘yiCustom’ over ‘yi’ unless you never plan to
|
# This is an unwrapped version of Yi, it will not behave well (no
|
||||||
# use any external libraries in your config.
|
# M-x or reload). Use ‘yiCustom’ instead.
|
||||||
yi = callPackage ../applications/editors/yi/yi.nix { };
|
yi = callPackage ../applications/editors/yi/yi.nix { };
|
||||||
|
|
||||||
yiContrib = callPackage ../development/libraries/haskell/yi-contrib {};
|
yiContrib = callPackage ../development/libraries/haskell/yi-contrib {};
|
||||||
|
|
||||||
yiCustom = callPackage ../applications/editors/yi/yi-custom.nix {
|
yiCustom = callPackage ../applications/editors/yi/yi-custom.nix {
|
||||||
extraPackages = [];
|
extraPackages = pkgs: [];
|
||||||
};
|
};
|
||||||
|
|
||||||
yiLanguage = callPackage ../development/libraries/haskell/yi-language {};
|
yiLanguage = callPackage ../development/libraries/haskell/yi-language {};
|
||||||
|
Loading…
Reference in New Issue
Block a user