git.iko.soy/typeable/nixpkgs
on master help sign in
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

commitbb104abf63657ad485a5fff68962b80fbe8d57d5 author(cdep)illabout <cdep.illabout@gmail.com> dateFri 29 Nov 2019, 10:13 (7 years ago) parent60779d0
5 files changed+109
pkgs/development/haskell-modules/configuration-hackage2nix.yaml+1 pkgs/development/haskell-modules/configuration-nix.nix+56 pkgs/development/haskell-modules/non-hackage-packages.nix+3 pkgs/development/tools/purescript/spago/default.nix+47 pkgs/top-level/all-packages.nix+2
pkgs/development/haskell-modules/configuration-hackage2nix.yaml+1
@@ -2594,6 +2594,7 @@ package-maintainers:
25942594 cdepillabout:
25952595 - pretty-simple
25962596 - purescript
2597+ - spago
25972598 - termonad
25982599
25992600unsupported-platforms:
pkgs/development/haskell-modules/configuration-nix.nix+56
@@ -636,4 +636,60 @@ self: super: builtins.intersectAttrs super {
636636 # need it during the build itself, too.
637637 cairo = addBuildTool super.cairo self.buildHaskellPackages.gtk2hs-buildtools;
638638 pango = disableHardening (addBuildTool super.pango self.buildHaskellPackages.gtk2hs-buildtools) ["fortify"];
639+
640+ spago =
641+ let
642+ # Spago basically compiles with LTS-14, but it requires a newer version
643+ # of directory. This is to work around a bug only present on windows, so
644+ # we can safely jailbreak spago and use the older directory package from
645+ # LTS-14.
646+ spagoWithOverrides = doJailbreak (super.spago.override {
647+ # spago requires the latest version of dhall.
648+ directory = self.dhall_1_27_0;
649+ });
650+
651+ docsSearchAppJsFile = pkgs.fetchurl {
652+ url = "https://github.com/spacchetti/purescript-docs-search/releases/download/v0.0.5/docs-search-app.js";
653+ sha256 = "11721x455qzh40vzfmralaynn9v8b5wix86r107hhs08vhryjib2";
654+ };
655+
656+ purescriptDocsSearchFile = pkgs.fetchurl {
657+ url = "https://github.com/spacchetti/purescript-docs-search/releases/download/v0.0.5/purescript-docs-search";
658+ sha256 = "16p1fmdvpwz1yswav8qjsd26c9airb22xncqw1rjnbd8lcpqx0p5";
659+ };
660+
661+ spagoFixHpack = overrideCabal spagoWithOverrides (drv: {
662+ postUnpack = (drv.postUnpack or "") + ''
663+ # The source for spago is pulled directly from GitHub. It uses a
664+ # package.yaml file with hpack, not a .cabal file. In the package.yaml file,
665+ # it uses defaults from the master branch of the hspec repo. It will try to
666+ # fetch these at build-time (but it will fail if running in the sandbox).
667+ #
668+ # The following line modifies the package.yaml to not pull in
669+ # defaults from the hspec repo.
670+ substituteInPlace "$sourceRoot/package.yaml" --replace 'defaults: hspec/hspec@master' ""
671+
672+ # Spago includes the following two files directly into the binary
673+ # with Template Haskell. They are fetched at build-time from the
674+ # `purescript-docs-search` repo above. If they cannot be fetched at
675+ # build-time, they are pulled in from the `templates/` directory in
676+ # the spago source.
677+ #
678+ # However, they are not actually available in the spago source, so they
679+ # need to fetched with nix and put in the correct place.
680+ # https://github.com/spacchetti/spago/issues/510
681+ cp ${docsSearchAppJsFile} "$sourceRoot/templates/docs-search-app.js"
682+ cp ${purescriptDocsSearchFile} "$sourceRoot/templates/purescript-docs-search"
683+ '';
684+ });
685+
686+ # Haddock generation is broken for spago.
687+ # https://github.com/spacchetti/spago/issues/511
688+ spagoWithoutHaddocks = dontHaddock spagoFixHpack;
689+
690+ # Because of the problem above with pulling in hspec defaults to the
691+ # package.yaml file, the tests are disabled.
692+ spagoWithoutChecks = dontCheck spagoWithoutHaddocks;
693+ in
694+ spagoWithoutChecks;
639695}
pkgs/development/haskell-modules/non-hackage-packages.nix+3
@@ -13,4 +13,7 @@ self: super: {
1313 # https://github.com/channable/vaultenv/issues/1
1414 vaultenv = self.callPackage ../tools/haskell/vaultenv { };
1515
16+ # spago is not released to Hackage.
17+ # https://github.com/spacchetti/spago/issues/512
18+ spago = self.callPackage ../tools/purescript/spago { };
1619}
pkgs/development/tools/purescript/spago/default.nixnew file+47
@@ -0,0 +1,47 @@
1+{ mkDerivation, aeson, aeson-pretty, ansi-terminal, async-pool
2+, base, bower-json, bytestring, Cabal, containers, dhall, directory
3+, either, exceptions, extra, fetchgit, file-embed, filepath, foldl
4+, fsnotify, github, Glob, hpack, hspec, hspec-discover
5+, hspec-megaparsec, http-client, http-conduit, lens-family-core
6+, megaparsec, mtl, network-uri, open-browser, optparse-applicative
7+, prettyprinter, process, QuickCheck, retry, rio, rio-orphans, safe
8+, semver-range, stdenv, stm, tar, template-haskell, temporary, text
9+, time, transformers, turtle, unliftio, unordered-containers
10+, vector, versions, zlib
11+}:
12+mkDerivation {
13+ pname = "spago";
14+ version = "0.12.1.0";
15+ src = fetchgit {
16+ url = "https://github.com/spacchetti/spago";
17+ sha256 = "17xgp75yxangmb65sv3raysad31kmc109c4q4aj9dgcdqz23fcn2";
18+ rev = "a4679880402ead320f8be2f091b25d30e27b62df";
19+ fetchSubmodules = true;
20+ };
21+ isLibrary = true;
22+ isExecutable = true;
23+ libraryHaskellDepends = [
24+ aeson aeson-pretty ansi-terminal async-pool base bower-json
25+ bytestring Cabal containers dhall directory either exceptions
26+ file-embed filepath foldl fsnotify github Glob http-client
27+ http-conduit lens-family-core megaparsec mtl network-uri
28+ open-browser prettyprinter process retry rio rio-orphans safe
29+ semver-range stm tar template-haskell temporary text time
30+ transformers turtle unliftio unordered-containers vector versions
31+ zlib
32+ ];
33+ libraryToolDepends = [ hpack ];
34+ executableHaskellDepends = [
35+ aeson-pretty async-pool base bytestring containers dhall filepath
36+ github lens-family-core megaparsec optparse-applicative process
37+ retry stm temporary text time turtle vector
38+ ];
39+ testHaskellDepends = [
40+ base containers directory extra hspec hspec-megaparsec megaparsec
41+ process QuickCheck temporary text turtle versions
42+ ];
43+ testToolDepends = [ hspec-discover ];
44+ prePatch = "hpack";
45+ homepage = "https://github.com/spacchetti/spago#readme";
46+ license = stdenv.lib.licenses.bsd3;
47+}
pkgs/top-level/all-packages.nix+2
@@ -8111,6 +8111,8 @@ in
81118111 psc-package = haskell.lib.justStaticExecutables
81128112 (haskellPackages.callPackage ../development/compilers/purescript/psc-package { });
81138113
8114+ spago = haskell.lib.justStaticExecutables haskellPackages.spago;
8115+
81148116 tacacsplus = callPackage ../servers/tacacsplus { };
81158117
81168118 tamarin-prover =