summary refs log tree commit diff
path: root/pkgs/development/haskell-modules
diff options
context:
space:
mode:
author(cdep)illabout <cdep.illabout@gmail.com>2019-11-29 10:13:35 +0900
committer(cdep)illabout <cdep.illabout@gmail.com>2019-11-29 10:13:35 +0900
commitbb104abf63657ad485a5fff68962b80fbe8d57d5 (patch)
tree927405cd6bdb8c235c7e58686baa3f8aa0e3cdee /pkgs/development/haskell-modules
parent60779d004ea0b6db1e931c1bd249a113e7b5824c (diff)
downloadnixpkgs-bb104abf63657ad485a5fff68962b80fbe8d57d5.tar
nixpkgs-bb104abf63657ad485a5fff68962b80fbe8d57d5.tar.gz
nixpkgs-bb104abf63657ad485a5fff68962b80fbe8d57d5.tar.bz2
nixpkgs-bb104abf63657ad485a5fff68962b80fbe8d57d5.tar.lz
nixpkgs-bb104abf63657ad485a5fff68962b80fbe8d57d5.tar.xz
nixpkgs-bb104abf63657ad485a5fff68962b80fbe8d57d5.tar.zst
nixpkgs-bb104abf63657ad485a5fff68962b80fbe8d57d5.zip
spago: init at 0.12.1.0
This commit adds the spago package, a PureScript package manager and build tool.

https://github.com/spacchetti/spago
Diffstat (limited to 'pkgs/development/haskell-modules')
-rw-r--r--pkgs/development/haskell-modules/configuration-hackage2nix.yaml1
-rw-r--r--pkgs/development/haskell-modules/configuration-nix.nix56
-rw-r--r--pkgs/development/haskell-modules/non-hackage-packages.nix3
3 files changed, 60 insertions, 0 deletions
diff --git a/pkgs/development/haskell-modules/configuration-hackage2nix.yaml b/pkgs/development/haskell-modules/configuration-hackage2nix.yaml
index f57768ecb77..088af0d0805 100644
--- a/pkgs/development/haskell-modules/configuration-hackage2nix.yaml
+++ b/pkgs/development/haskell-modules/configuration-hackage2nix.yaml
@@ -2594,6 +2594,7 @@ package-maintainers:
   cdepillabout:
     - pretty-simple
     - purescript
+    - spago
     - termonad
 
 unsupported-platforms:
diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix
index dbdad1ddf1d..4ebfa2322a8 100644
--- a/pkgs/development/haskell-modules/configuration-nix.nix
+++ b/pkgs/development/haskell-modules/configuration-nix.nix
@@ -636,4 +636,60 @@ self: super: builtins.intersectAttrs super {
   # need it during the build itself, too.
   cairo = addBuildTool super.cairo self.buildHaskellPackages.gtk2hs-buildtools;
   pango = disableHardening (addBuildTool super.pango self.buildHaskellPackages.gtk2hs-buildtools) ["fortify"];
+
+  spago =
+    let
+      # Spago basically compiles with LTS-14, but it requires a newer version
+      # of directory.  This is to work around a bug only present on windows, so
+      # we can safely jailbreak spago and use the older directory package from
+      # LTS-14.
+      spagoWithOverrides = doJailbreak (super.spago.override {
+        # spago requires the latest version of dhall.
+        directory = self.dhall_1_27_0;
+      });
+
+      docsSearchAppJsFile = pkgs.fetchurl {
+        url = "https://github.com/spacchetti/purescript-docs-search/releases/download/v0.0.5/docs-search-app.js";
+        sha256 = "11721x455qzh40vzfmralaynn9v8b5wix86r107hhs08vhryjib2";
+      };
+
+      purescriptDocsSearchFile = pkgs.fetchurl {
+        url = "https://github.com/spacchetti/purescript-docs-search/releases/download/v0.0.5/purescript-docs-search";
+        sha256 = "16p1fmdvpwz1yswav8qjsd26c9airb22xncqw1rjnbd8lcpqx0p5";
+      };
+
+      spagoFixHpack = overrideCabal spagoWithOverrides (drv: {
+        postUnpack = (drv.postUnpack or "") + ''
+          # The source for spago is pulled directly from GitHub.  It uses a
+          # package.yaml file with hpack, not a .cabal file.  In the package.yaml file,
+          # it uses defaults from the master branch of the hspec repo.  It will try to
+          # fetch these at build-time (but it will fail if running in the sandbox).
+          #
+          # The following line modifies the package.yaml to not pull in
+          # defaults from the hspec repo.
+          substituteInPlace "$sourceRoot/package.yaml" --replace 'defaults: hspec/hspec@master' ""
+
+          # Spago includes the following two files directly into the binary
+          # with Template Haskell.  They are fetched at build-time from the
+          # `purescript-docs-search` repo above.  If they cannot be fetched at
+          # build-time, they are pulled in from the `templates/` directory in
+          # the spago source.
+          #
+          # However, they are not actually available in the spago source, so they
+          # need to fetched with nix and put in the correct place.
+          # https://github.com/spacchetti/spago/issues/510
+          cp ${docsSearchAppJsFile} "$sourceRoot/templates/docs-search-app.js"
+          cp ${purescriptDocsSearchFile} "$sourceRoot/templates/purescript-docs-search"
+        '';
+      });
+
+      # Haddock generation is broken for spago.
+      # https://github.com/spacchetti/spago/issues/511
+      spagoWithoutHaddocks = dontHaddock spagoFixHpack;
+
+      # Because of the problem above with pulling in hspec defaults to the
+      # package.yaml file, the tests are disabled.
+      spagoWithoutChecks = dontCheck spagoWithoutHaddocks;
+    in
+    spagoWithoutChecks;
 }
diff --git a/pkgs/development/haskell-modules/non-hackage-packages.nix b/pkgs/development/haskell-modules/non-hackage-packages.nix
index 8b667a1e669..c292eeec128 100644
--- a/pkgs/development/haskell-modules/non-hackage-packages.nix
+++ b/pkgs/development/haskell-modules/non-hackage-packages.nix
@@ -13,4 +13,7 @@ self: super: {
   # https://github.com/channable/vaultenv/issues/1
   vaultenv = self.callPackage ../tools/haskell/vaultenv { };
 
+  # spago is not released to Hackage.
+  # https://github.com/spacchetti/spago/issues/512
+  spago = self.callPackage ../tools/purescript/spago { };
 }