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
This commit is contained in:
@@ -2594,6 +2594,7 @@ package-maintainers:
|
||||
cdepillabout:
|
||||
- pretty-simple
|
||||
- purescript
|
||||
- spago
|
||||
- termonad
|
||||
|
||||
unsupported-platforms:
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 { };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user