Commit Graph

1586 Commits

Author SHA1 Message Date
Peter Simons
44d03082d4 haskell-GLUT-2.3.1.0: fix build 2014-05-14 15:02:30 +02:00
Peter Simons
8de3955037 haskell-packages.nix: remove references to parsec2 2014-05-14 15:02:27 +02:00
Peter Simons
fd0f9e6fc1 Re-write the Haskell Platform out of haskell-defaults.nix.
1) Packages formerly called haskell-haskell-platform-ghcXYZ-VVVV.X.Y.Z are
    now called haskell-platform-VVVV.X.Y.Z. The latest version can be
    installed by running "nix-env -i haskell-platform".

 2) The attributes haskellPackages_ghcXYZ.haskellPlatform no longer exist.
    Instead, we have attributes like haskellPlatformPackages."2012_4_0_0".
    (The last numeric bit must be quoted when used in a Nix file, but not on
    the command line to nix-env, nix-build, etc.) The latest Platform has a
    top-level alias called simply haskellPlatform.

 3) The haskellPackages_ghcXYZ package sets offer the latest version of every
    library that GHC x.y.z can compile. For example, if 2.7 is the latest
    version of QuickCheck and if GHC 7.0.4 can compile that version, then
    haskellPackages_ghc704.QuickCheck refers to version 2.7.

 4) All intermediate GHC releases were dropped from all-packages.nix to
    simplify our configuration. What remains is a haskellPackages_ghcXYZ set
    for the latest version of every major release branch, i.e. GHC 6.10.4,
    6.12.3, 7.0.4, 7.2.2, 7.4.2, 7.6.3, 7.8.2, and 7.9.x (HEAD snapshot).

 5) The ghcXYZPrefs functions in haskell-defaults.nix now inherit overrides
    from newer to older compilers, i.e. an override configured for GHC 7.0.4
    will automatically apply to GHC 6.12.3 and 6.10.4, too. This change has
    reduced the redundancy in those configuration functions. The downside is
    that overriding an attribute for only one particular GHC version has become
    more difficult. In practice, this case doesn't occur much, though.

 6) The 'cabal' builder has a brand-new argument called 'extension'. That
    function is "self : super : {}" by default and users can override it to
    mess with the attribute set passed to cabal.mkDerivation. An example use
    would be the definition of darcs in all-packages.nix:

    | darcs = haskellPackages.darcs.override {
    |   cabal = haskellPackages.cabal.override {
    |     extension = self : super : {
    |       isLibrary = false;
    |       configureFlags = "-f-library " + super.configureFlags or "";
    |     };
    |   };
    | };

    In this case, extension disables building the library part of the package
    to give us an executable-only version that has no dependencies on GHC or
    any other Haskell packages.

    The 'self' argument refers to the final version of the attribute set and
    'super' refers to the original attribute set.

Note that ...

 - Haskell Platform packages always provide the Haddock binary that came with
   the compiler.

 - Haskell Platform 2009.2.0.2 is broken because of build failures in cgi and
   cabal-install.

 - Haskell Platform 2010.1.0.0 is broken becasue of build failures in cgi.
2014-05-14 14:59:52 +02:00
Peter Simons
06f9fed0ac Merge pull request #2592 from bennofs/haskell-new-expressions
Add a few haskell expressions
2014-05-09 22:59:40 +02:00
Benno Fünfstück
631e74963f haskell-dynamic-cabal: new expression 2014-05-09 22:50:41 +02:00
Benno Fünfstück
fb2d8ab9aa haskell-th-lift-instances: new expression 2014-05-09 22:50:40 +02:00
Benno Fünfstück
52bd5978a0 haskell-quickcheck-property-monad: new expression 2014-05-09 22:50:39 +02:00
Benno Fünfstück
e61e23b6c7 haskell-hcltest: new expression 2014-05-09 22:50:38 +02:00
Benno Fünfstück
b49de7164e haskell-generate: new expression 2014-05-09 22:50:37 +02:00
Benno Fünfstück
97dde61662 haskell-system-time-monotonic: new expression 2014-05-09 22:50:36 +02:00
Benno Fünfstück
2525aac134 haskell-unix-memory: new expression 2014-05-09 22:50:35 +02:00
Russell O'Connor
46ccebe413 Allow for later binding in ghcPrefs
Now that both self and super are available to prefFun, we can use self, where appropriate to access late bound versions of most
packages.

When extensions are not used, there is no difference between self and super.
2014-05-08 22:01:36 -04:00
Russell O'Connor
d4bd4650d6 Rework the knot-tying code for defining Haskell packages.
The existing knot-tying code I felt was a bit incoherent with result, finalReturn, self, refering to different various forms of the "haskellPackages" value and often
different forms in the same place.

This commit instills some object-oriented discipline to the construction of hasekllPackages using a small number of fundamental OO concepts:

* An class is a open recursive function of the form (self : fooBody) where fooBody is a set.
* An instance of a class is the fixed point of the class.
  This value is sometimes refered to as an object and the values in the resulting set are sometimes refered to as methods.
* A class, foo = self : fooBody, can be extended by an extension which is a function bar = (self : super : barBody) where barBody a set of overrides for fooBody.
  The result of a class extension is a new class whose value is self : foo self // bar self (foo self).
  The super parameter gives access to the original methods that barBody may be overriding.

This commit turns the haskell-packages value into a "class".

The knot-tying, a.k.a the object instanitation, is moved into haskells-defaults.  The "finalReturn" is no longer needed and is eliminated from the body of
haskell-packages. All the work done by prefFun is moved to haskell-defaults, so that parameter is eliminated form haskell-packages.  Notice that the old prefFun took
two pameters named "self" and "super", but both parameters got passed the same value "result".  There seems to have been some confusion in the old code.

Inside haskell-defaults, the haskell-packages class is extended twice before instantiation.  The first extension is done using prefFun argument.
The second extension is done the extension argument, which is a renamed version of extraPrefs.

This two stage approach means that extension's super gets access to the post "perfFun" object while previously the extraPrefs only had access to the pre "prefFun"
object.  Also the extension function has access to both the super (post "perfFun") object and to self, the final object.  With extraPrefs, one needed to use the
"finalReturn" of the haskell packages to get access to the final object.  Due to significant changes in semantics, I thought it best to replace extraPrefs with
extension so that people using extraPrefs know to update thier cod.

Lastly, all the Prefs functions have renamed the "self" parameter to "super".  This is because "self" was never actually a self-reference in the object oriented sense
of the word.  For example

    Cabal_1_18_1_3 = self.Cabal_1_18_1_3.override { deepseq = self.deepseq_1_3_0_2; };

doesn't actually make sense from an object oriented standpoint because, barring further method overriding, the value of Cabal_1_18_1_3 would be trying to override it's
own value which simply causes a loop exception.  Thankfully all these uses of self were really uses of super:

    Cabal_1_18_1_3 = super.Cabal_1_18_1_3.override { deepseq = super.deepseq_1_3_0_2; };

In this notation the overriden Cabal_1_18_1_3 method calls the Cabal_1_18_1_3 of the super-class, which is a well-founded notion.

Below is an example use of using "extension" parameter

{
  packageOverrides = pkgs : {
    testHaskellPackages = pkgs.haskellPackages.override {
      extension = self : super : {
        transformers_0_4_1_0 = self.cabal.mkDerivation (pkgs: {
        pname = "transformers";
        version = "0.4.1.0";
        sha256 = "0jlnz86f87jndv4sifg1zpv5b2g2cxy1x2575x727az6vyaarwwg";
        meta = {
          description = "Concrete functor and monad transformers";
          license = pkgs.stdenv.lib.licenses.bsd3;
          platforms = pkgs.ghc.meta.platforms;
          maintainers = [ pkgs.stdenv.lib.maintainers.andres ];
        };
       });

      transformers = self.transformers_0_4_1_0;

      lensFamilyCore = super.lensFamilyCore.override { transformers = self.transformers_0_3_0_0; };
     };
   };
 };
}

Notice the use of self in the body of the override of the transformers method which references the newly defined transformers_0_4_1_0 method.

With the previous code, one would have to instead akwardly write

      transformers = super.finalReturn.transformers_0_4_1_0;

or use a rec clause, which would prevent futher overriding of transformers_0_4_1_0.
2014-05-08 12:01:45 -04:00
Peter Simons
4ee0cd2bbb haskell-gloss: Revert "update to version 1.8.2.1"
This reverts commit 37df971a49. The new
version doesn't compile.
2014-05-07 19:13:06 +02:00
Peter Simons
ee1a03577c haskell-statistics: drop obsolete version 0.10.5.2 2014-05-07 19:13:06 +02:00
Peter Simons
6f5ee37d5c haskell-HTTP: update to version 4000.2.14 2014-05-07 19:13:04 +02:00
Peter Simons
af8d34c35e Merge pull request #2531 from jwiegley/djinn
Add an expression for the Haskell library djinn
2014-05-07 11:36:56 +02:00
Oliver Charles
fcc3ae1d84 haskellPackages.snapletStripe: New expression 2014-05-07 09:57:27 +01:00
Shea Levy
0d0f7d2681 Merge branch 'buildLocalCabal-drvArgs' of git://github.com/proger/nixpkgs
buildLocalCabal: allow drvArgs in buildLocalCabalWithArgs
2014-05-06 09:27:40 -04:00
Peter Simons
81a05aabbe haskell-packages.nix: update (unused) reference to cabal-install 2014-05-06 10:59:23 +02:00
Vladimir Kirillov
7eff825487 buildLocalCabal: allow cabalDrvArgs in buildLocalCabalWithArgs
allows to write neat expressions like (as we're still generating an
expression string):

```
{
  build = haskellPackages.buildLocalCabalWithArgs {
    inherit src name;
    cabalDrvArgs = {
      jailbreak = false;
      doCheck = false;
    };
  };
}
```

without resorting to weird kung-fu like darcs does:

```
darcs = haskellPackages.darcs.override {
  # A variant of the Darcs derivation that containts only the
  # executable and
  # thus has no dependencies on other Haskell packages.
  cabal = { mkDerivation = x: rec { final = haskellPackages.cabal.mkDerivation (self: (x final) // {
            isLibrary = false;
            configureFlags = "-f-library"; }); }.final;
          };
};
```

While here, move the `jailbreak = true;` as the default `cabalDrvArgs`
option.
2014-05-06 11:00:48 +03:00
John Wiegley
7848f96b58 Add an expression for the Haskell library djinn 2014-05-05 19:48:50 -05:00
Vladimir Kirillov
9aa231abfa buildLocalCabal: include cabalInstall to buildDepends to preserve developer experience 2014-05-05 14:43:55 +03:00
Peter Simons
66997bba1e haskell-gloss: require the latest OpenGL and GLUT libraries 2014-05-05 10:54:12 +02:00
Peter Simons
dbb561ae62 haskell-packages.nix: strip trailing whitespace 2014-05-05 10:52:11 +02:00
Peter Simons
f5a6b58374 cabal-install: update to version 1.20.0.1 2014-05-05 10:46:40 +02:00
Peter Simons
986a42dfe7 haskell-cabal-lenses: add version 0.1 2014-05-05 10:46:39 +02:00
Peter Simons
e7c207e10d haskell-hourglass: add version 0.1.1 2014-05-05 10:46:39 +02:00
Peter Simons
401f4a28c1 cryptol: fix reference to text library 2014-05-04 23:21:39 +02:00
Benno Fünfstück
d385835c38 haskell-profiteur: new expression 2014-05-04 23:02:46 +02:00
Peter Simons
18f49692ec haskell-wreq: fix reference to attoparsec 2014-05-04 22:25:56 +02:00
Peter Simons
911d9d5b1b Merge pull request #2489 from jwiegley/haskexprs
Add several new Haskell expressions
2014-05-04 13:22:13 +02:00
Peter Simons
ce21d883c0 haskell-vinyl: add version 0.3 2014-05-04 13:19:56 +02:00
Peter Simons
c2fd001fd4 Remove obsolete Agda-executable package; the compiler is not part of 'Agda'. 2014-05-04 12:17:35 +02:00
John Wiegley
9bc6893712 Add several new Haskell expressions 2014-05-03 23:01:00 -05:00
Peter Simons
4b307a7b96 haskell-network: update to version 2.5.0.0 2014-05-03 20:03:33 +02:00
Peter Simons
dd1dd06b88 haskell-text: update to version 1.1.1.1 2014-05-03 20:03:32 +02:00
Peter Simons
c1705e8b33 haskell-fgl: add version 5.5.0.1 2014-05-03 20:03:32 +02:00
Peter Simons
eb7958247a haskell-unordered-containers: update to version 0.2.4.0 2014-05-03 20:03:32 +02:00
Peter Simons
074c128fec haskell-attoparsec: update to version 0.11.3.0 2014-05-03 20:03:32 +02:00
Vladimir Kirillov
599f9a09fe haskell: bump ekg to 0.4, add ekg-core 2014-05-03 17:36:03 +03:00
Peter Simons
64d662e056 Agda: move compiler and standard library into a common directory
Also renamed AgdaStdLib attribute to AgdaStdlib, since upstream doesn't
seem to capitalize that name.
2014-05-03 12:37:17 +02:00
Peter Simons
801a4818c8 Merge pull request #2474 from jwiegley/agda-stdlib
Add expression for the Agda standard library
2014-05-03 12:33:26 +02:00
Mateusz Kowalczyk
ab7e2f1dc5 haskell-HTTP: update to version 4000.2.13 2014-05-03 12:27:25 +02:00
Oliver Charles
4e70c764f5 Merge pull request #2473 from jwiegley/these
Add expression for Haskell library 'these'
2014-05-03 11:19:18 +01:00
John Wiegley
7d788d5e4f Add expression for the Agda standard library 2014-05-02 19:15:38 -05:00
John Wiegley
fb778b705f Add expression for Haskell library 'these' 2014-05-02 13:43:34 -05:00
Peter Simons
e81ac36bff haskell-spoon: add version 0.3.1 2014-05-01 21:57:02 +02:00
Peter Simons
39c3cb1d99 haskell-groom: add version 0.1.2 2014-05-01 21:57:02 +02:00
Benno Fünfstück
8310c6a403 haskell-cabal-bounds: use versionOlder
for some reason, versionAtLeast doesn't work
2014-05-01 15:02:50 +02:00