about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/purescript
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-01-11 23:37:02 +0000
committerAlyssa Ross <hi@alyssa.is>2020-01-11 23:41:30 +0000
commit6c557e3f1c28cf87e9fba232811d6875dd1399c1 (patch)
tree035a071d5d8980df6de0fa42e2ef8fc0cce7055e /nixpkgs/pkgs/development/tools/purescript
parentda7500bc026e937ac7fce7b50f67a0e1765737a7 (diff)
parente4134747f5666bcab8680aff67fa3b63384f9a0f (diff)
downloadnixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.gz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.bz2
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.lz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.xz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.zst
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.zip
Merge commit 'e4134747f5666bcab8680aff67fa3b63384f9a0f'
Diffstat (limited to 'nixpkgs/pkgs/development/tools/purescript')
-rw-r--r--nixpkgs/pkgs/development/tools/purescript/spago/default.nix14
-rw-r--r--nixpkgs/pkgs/development/tools/purescript/spago/spago.nix47
-rwxr-xr-xnixpkgs/pkgs/development/tools/purescript/spago/update.sh30
3 files changed, 91 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/purescript/spago/default.nix b/nixpkgs/pkgs/development/tools/purescript/spago/default.nix
new file mode 100644
index 000000000000..2fc5efedb20b
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/purescript/spago/default.nix
@@ -0,0 +1,14 @@
+{ haskellPackages
+, haskell
+, lib
+}:
+
+haskell.lib.justStaticExecutables (haskell.lib.overrideCabal haskellPackages.spago (oldAttrs: {
+  maintainers = (oldAttrs.maintainers or []) ++ [
+    lib.maintainers.cdepillabout
+  ];
+
+  passthru = (oldAttrs.passthru or {}) // {
+    updateScript = ./update.sh;
+  };
+}))
diff --git a/nixpkgs/pkgs/development/tools/purescript/spago/spago.nix b/nixpkgs/pkgs/development/tools/purescript/spago/spago.nix
new file mode 100644
index 000000000000..c85cff2f03a4
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/purescript/spago/spago.nix
@@ -0,0 +1,47 @@
+{ mkDerivation, aeson, aeson-pretty, ansi-terminal, async-pool
+, base, bower-json, bytestring, Cabal, containers, dhall, directory
+, either, exceptions, extra, fetchgit, file-embed, filepath, foldl
+, fsnotify, github, Glob, hpack, hspec, hspec-discover
+, hspec-megaparsec, http-client, http-conduit, lens-family-core
+, megaparsec, mtl, network-uri, open-browser, optparse-applicative
+, prettyprinter, process, QuickCheck, retry, rio, rio-orphans, safe
+, semver-range, stdenv, stm, tar, template-haskell, temporary, text
+, time, transformers, turtle, unliftio, unordered-containers
+, vector, versions, zlib
+}:
+mkDerivation {
+  pname = "spago";
+  version = "0.13.0";
+  src = fetchgit {
+    url = "https://github.com/spacchetti/spago.git";
+    sha256 = "158xq5zn32iwswxmpma92763hl6kzq7kb01cyvphmmlilx55b6yk";
+    rev = "426838670ba9de4593f4c533a6947efb2d8ad4ba";
+    fetchSubmodules = true;
+  };
+  isLibrary = true;
+  isExecutable = true;
+  libraryHaskellDepends = [
+    aeson aeson-pretty ansi-terminal async-pool base bower-json
+    bytestring Cabal containers dhall directory either exceptions
+    file-embed filepath foldl fsnotify github Glob http-client
+    http-conduit lens-family-core megaparsec mtl network-uri
+    open-browser prettyprinter process retry rio rio-orphans safe
+    semver-range stm tar template-haskell temporary text time
+    transformers turtle unliftio unordered-containers vector versions
+    zlib
+  ];
+  libraryToolDepends = [ hpack ];
+  executableHaskellDepends = [
+    aeson-pretty async-pool base bytestring containers dhall filepath
+    github lens-family-core megaparsec optparse-applicative process
+    retry stm temporary text time turtle vector
+  ];
+  testHaskellDepends = [
+    base containers directory extra hspec hspec-megaparsec megaparsec
+    process QuickCheck temporary text turtle versions
+  ];
+  testToolDepends = [ hspec-discover ];
+  prePatch = "hpack";
+  homepage = "https://github.com/spacchetti/spago#readme";
+  license = stdenv.lib.licenses.bsd3;
+}
diff --git a/nixpkgs/pkgs/development/tools/purescript/spago/update.sh b/nixpkgs/pkgs/development/tools/purescript/spago/update.sh
new file mode 100755
index 000000000000..00c9c6d85f1d
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/purescript/spago/update.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p cabal2nix curl jq
+#
+# This script will update the spago derivation to the latest version using
+# cabal2nix.
+#
+# Note that you should always try building spago after updating it here, since
+# some of the overrides in pkgs/development/haskell/configuration-nix.nix may
+# need to be updated/changed.
+
+set -eo pipefail
+
+# This is the directory of this update.sh script.
+script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+
+# Spago derivation created with cabal2nix.
+spago_derivation_file="${script_dir}/spago.nix"
+
+# This is the current revision of spago in Nixpkgs.
+old_version="$(sed -En 's/.*\bversion = "(.*?)".*/\1/p' "$spago_derivation_file")"
+
+# This is the latest release version of spago on GitHub.
+new_version=$(curl --silent "https://api.github.com/repos/spacchetti/spago/releases" | jq '.[0].tag_name' --raw-output)
+
+echo "Updating spago from old version $old_version to new version $new_version."
+echo "Running cabal2nix and outputting to ${spago_derivation_file}..."
+
+cabal2nix --revision "$new_version" "https://github.com/spacchetti/spago.git" > "$spago_derivation_file"
+
+echo "Finished."