diff --git a/pkgs/applications/editors/yi/yi-custom-cabal/LICENSE b/pkgs/applications/editors/yi/yi-custom-cabal/LICENSE new file mode 100644 index 000000000000..cf1ab25da034 --- /dev/null +++ b/pkgs/applications/editors/yi/yi-custom-cabal/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/pkgs/applications/editors/yi/yi-custom-cabal/yi-custom.cabal b/pkgs/applications/editors/yi/yi-custom-cabal/yi-custom.cabal new file mode 100644 index 000000000000..d9ffbb8e4817 --- /dev/null +++ b/pkgs/applications/editors/yi/yi-custom-cabal/yi-custom.cabal @@ -0,0 +1,17 @@ +name: yi-custom +version: 0.0.0.1 +category: Yi +synopsis: Convenience wrapper for nix +description: Convenience wrapper for nix +license: PublicDomain +license-file: LICENSE +author: Mateusz Kowalczyk +maintainer: fuuzetsu@fuuzetsu.co.uk +Cabal-Version: >= 1.10 +build-type: Simple + +library + hs-source-dirs: . + default-language: Haskell2010 + build-depends: base, yi + ghc-options: -threaded diff --git a/pkgs/applications/editors/yi/yi-custom.nix b/pkgs/applications/editors/yi/yi-custom.nix new file mode 100644 index 000000000000..05b26f7046f2 --- /dev/null +++ b/pkgs/applications/editors/yi/yi-custom.nix @@ -0,0 +1,40 @@ +# This is a manually-written expression over an in-tree cabal file. +# It's awkward but this way allows the package user to pass in +# extraPackages without much extra hassle on their end, similarly how +# the XMonad service handles it: the difference is that we don't have +# anything like XMONAD_GHC… +# +# The idea is that the user changes their configs using any libraries +# he likes and then builds it using this expression. Once that's done, +# ‘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.mkDerivation (self: rec { + pname = "yi-custom"; + version = "0.0.0.1"; + src = ./yi-custom-cabal; + isLibrary = true; + buildDepends = extraPackages ++ [ 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. + postInstall = '' + makeWrapper ${yi}/bin/yi $out/bin/yi --set GHC_PACKAGE_PATH ''${GHC_PACKAGE_PATH%?} + ''; + + 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 ]; + }; + +}) \ No newline at end of file diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index 738884865a29..619c75effb3c 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -3090,10 +3090,16 @@ 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. yi = callPackage ../applications/editors/yi/yi.nix { }; yiContrib = callPackage ../development/libraries/haskell/yi-contrib {}; + yiCustom = callPackage ../applications/editors/yi/yi-custom.nix { + extraPackages = []; + }; + yiLanguage = callPackage ../development/libraries/haskell/yi-language {}; yiRope = callPackage ../development/libraries/haskell/yi-rope {};