Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
lib,

# The following are only needed for the passthru.tests:
spago,
spago-legacy,
cacert,
git,
nodejs,
purescript,
runCommand,
}:

lib.pipe haskellPackages.spago [
lib.pipe haskellPackages.spago-legacy [
haskell.lib.compose.justStaticExecutables

(haskell.lib.compose.overrideCabal (oldAttrs: {
changelog = "https://github.com/purescript/spago/releases/tag/${oldAttrs.version}";
changelog = "https://github.com/purescript/spago-legacy/releases/tag/${oldAttrs.version}";

passthru = (oldAttrs.passthru or { }) // {
updateScript = ./update.sh;
Expand All @@ -25,18 +25,18 @@ lib.pipe haskellPackages.spago [
# network, so they cannot be run in the nix sandbox. sudo is needed in
# order to change the sandbox option.
#
# $ sudo nix-build -A spago.passthru.tests --option sandbox relaxed
# $ sudo nix-build -A spago-legacy.passthru.tests --option sandbox relaxed
#
tests =
runCommand "spago-tests"
runCommand "spago-legacy-tests"
{
__noChroot = true;
nativeBuildInputs = [
cacert
git
nodejs
purescript
spago
spago-legacy
];
}
''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@
zlib,
}:
mkDerivation {
pname = "spago";
version = "0.21.0";
pname = "spago-legacy";
version = "0.21.1";
src = fetchgit {
url = "https://github.com/purescript/spago.git";
sha256 = "1v5y15nhw6smnir0y7y854pa70iv8asxsqph2y8rz1c9lkz5d41g";
rev = "c354f4a461f65fcb83aaa843830ea1589f6c7179";
url = "https://github.com/purescript/spago-legacy.git";
sha256 = "18p9cic1y9b2v12np4b5sd82rz5njxh8f1vgqs4gwm6xjccmszmr";
rev = "2790261c28f59940f192c56f3b8245b3ae8b798d";
fetchSubmodules = true;
};
isLibrary = true;
Expand Down Expand Up @@ -148,7 +148,7 @@ mkDerivation {
versions
];
testToolDepends = [ hspec-discover ];
homepage = "https://github.com/purescript/spago#readme";
homepage = "https://github.com/purescript/spago-legacy#readme";
license = lib.licenses.bsd3;
mainProgram = "spago";
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq haskellPackages.cabal2nix-unstable.bin nix-prefetch-scripts -I nixpkgs=.
#
# This script will update the spago derivation to the latest version using
# This script will update the spago-legacy derivation to the latest version using
# cabal2nix.
#
# Note that you should always try building spago after updating it here, since
# Note that you should always try building spago-legacy after updating it here, since
# some of the overrides in pkgs/development/haskell/configuration-nix.nix may
# need to be updated/changed.

Expand All @@ -14,26 +14,28 @@ set -eo pipefail
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

# Spago derivation created with cabal2nix.
spago_derivation_file="${script_dir}/spago.nix"
spago_derivation_file="${script_dir}/spago-legacy.nix"

# This is the current revision of spago in Nixpkgs.
# This is the current revision of spago-legacy 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/purescript/spago/releases" | jq '.[0].tag_name' --raw-output)
# This is the latest release version of spago-legacy on GitHub.
new_version=$(curl --silent "https://api.github.com/repos/purescript/spago-legacy/releases" | jq '.[0].tag_name' --raw-output)

echo "Updating spago from old version $old_version to new version $new_version."
echo "Updating spago-legacy from old version $old_version to new version $new_version."
echo "Running cabal2nix and outputting to ${spago_derivation_file}..."

echo "# This has been automatically generated by the script" > "$spago_derivation_file"
echo "# ./update.sh. This should not be changed by hand." >> "$spago_derivation_file"

cabal2nix --revision "$new_version" "https://github.com/purescript/spago.git" >> "$spago_derivation_file"
cabal2nix --revision "$new_version" "https://github.com/purescript/spago-legacy.git" >> "$spago_derivation_file"

nixfmt "$spago_derivation_file"

# TODO: This should ideally also automatically update the docsSearchVersion
# from pkgs/development/haskell/configuration-nix.nix.

echo
echo "Finished. Make sure you run the following commands to confirm Spago builds correctly:"
echo ' - `nix build -L -f ./. spago`'
echo ' - `sudo nix build -L -f ./. spago.passthru.tests --option sandbox relaxed`'
echo ' - `nix build -L -f ./. spago-legacy`'
echo ' - `sudo nix build -L -f ./. spago-legacy.passthru.tests --option sandbox relaxed`'
2 changes: 1 addition & 1 deletion pkgs/development/compilers/purescript/purescript/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ echo
echo "Finished. Make sure you run the following commands to confirm PureScript builds correctly:"
echo ' - `nix build -L -f ./. purescript`'
echo ' - `nix build -L -f ./. purescript.passthru.tests.minimal-module`'
echo ' - `sudo nix build -L -f ./. spago.passthru.tests --option sandbox relaxed`'
echo ' - `sudo nix build -L -f ./. spago-legacy.passthru.tests --option sandbox relaxed`'
1 change: 0 additions & 1 deletion pkgs/development/haskell-modules/configuration-common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2769,7 +2769,6 @@ with haskellLib;
let
# We need to build purescript with these dependencies and thus also its reverse
# dependencies to avoid version mismatches in their dependency closure.
# TODO: maybe unify with the spago overlay in configuration-nix.nix?
purescriptOverlay = self: super: {
# As of 2021-11-08, the latest release of `language-javascript` is 0.7.1.0,
# but it has a problem with parsing the `async` keyword. It doesn't allow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ extra-packages:
- extensions == 0.1.0.1 # 2025-09-21: needed for Cabal 3.10 (fourmolo/ormolu with ghc 9.8)
- fourmolu == 0.14.0.0 # 2023-11-13: for ghc-lib-parser 9.6 compat
- fourmolu == 0.15.0.0 # 2025-09-21: for ghc-lib-parser 9.8 compat
- fsnotify < 0.4 # 2024-04-22: required by spago-0.21
- fuzzyset == 0.2.4 # 2023-12-20: Needed for building postgrest > 10
- ghc-exactprint == 0.6.* # 2022-12-12: needed for GHC < 9.2
- ghc-exactprint == 1.5.* # 2023-03-30: needed for GHC == 9.2
Expand Down Expand Up @@ -116,7 +115,6 @@ extra-packages:
- text-builder < 1 # 2025-08-27: Needed for building postgrest
- text-builder-dev < 0.4 # 2025-08-27: Needed for building postgrest
- text-metrics < 0.3.3 # 2025-02-08: >= 0.3.3 uses GHC2021
- versions < 6 # 2024-04-22: required by spago-0.21
- weeder == 2.3.* # 2022-05-31: preserve for GHC 9.0.2
- weeder == 2.4.* # 2023-02-02: preserve for GHC 9.2.*
# keep-sorted end
Expand Down
76 changes: 35 additions & 41 deletions pkgs/development/haskell-modules/configuration-nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ builtins.intersectAttrs super {
addBuildTool self.buildHaskellPackages.gtk2hs-buildtools super.pango
);

spago =
spago-legacy =
let
docsSearchApp_0_0_10 = pkgs.fetchurl {
url = "https://github.com/purescript/purescript-docs-search/releases/download/v0.0.10/docs-search-app.js";
Expand All @@ -1103,49 +1103,43 @@ builtins.intersectAttrs super {
sha256 = "1hjdprm990vyxz86fgq14ajn0lkams7i00h8k2i2g1a0hjdwppq6";
};
in
lib.pipe
(super.spago.override {
# base <4.19, text <2.1
versions = doJailbreak self.versions_5_0_5;
fsnotify = self.fsnotify_0_3_0_1;
})
[
(overrideCabal (drv: {
postUnpack = (drv.postUnpack or "") + ''
# 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 ${docsSearchApp_0_0_10} "$sourceRoot/templates/docs-search-app-0.0.10.js"
cp ${docsSearchApp_0_0_11} "$sourceRoot/templates/docs-search-app-0.0.11.js"
cp ${purescriptDocsSearch_0_0_10} "$sourceRoot/templates/purescript-docs-search-0.0.10"
cp ${purescriptDocsSearch_0_0_11} "$sourceRoot/templates/purescript-docs-search-0.0.11"

# For some weird reason, on Darwin, the open(2) call to embed these files
# requires write permissions. The easiest resolution is just to permit that
# (doesn't cause any harm on other systems).
chmod u+w \
"$sourceRoot/templates/docs-search-app-0.0.10.js" \
"$sourceRoot/templates/purescript-docs-search-0.0.10" \
"$sourceRoot/templates/docs-search-app-0.0.11.js" \
"$sourceRoot/templates/purescript-docs-search-0.0.11"
'';
}))
lib.pipe super.spago-legacy [
(overrideCabal (drv: {
postUnpack = (drv.postUnpack or "") + ''
# 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 ${docsSearchApp_0_0_10} "$sourceRoot/templates/docs-search-app-0.0.10.js"
cp ${docsSearchApp_0_0_11} "$sourceRoot/templates/docs-search-app-0.0.11.js"
cp ${purescriptDocsSearch_0_0_10} "$sourceRoot/templates/purescript-docs-search-0.0.10"
cp ${purescriptDocsSearch_0_0_11} "$sourceRoot/templates/purescript-docs-search-0.0.11"

# For some weird reason, on Darwin, the open(2) call to embed these files
# requires write permissions. The easiest resolution is just to permit that
# (doesn't cause any harm on other systems).
chmod u+w \
"$sourceRoot/templates/docs-search-app-0.0.10.js" \
"$sourceRoot/templates/purescript-docs-search-0.0.10" \
"$sourceRoot/templates/docs-search-app-0.0.11.js" \
"$sourceRoot/templates/purescript-docs-search-0.0.11"
'';
}))

# Tests require network access.
dontCheck
# Tests require network access.
dontCheck

# Overly strict upper bound on text
doJailbreak
# Overly strict upper bound on text (<1.3)
doJailbreak

# Generate shell completion for spago
(self.generateOptparseApplicativeCompletions [ "spago" ])
];
# Generate shell completion for spago
(self.generateOptparseApplicativeCompletions [ "spago" ])
];

# checks SQL statements at compile time, and so requires a running PostgreSQL
# database to run it's test suite
Expand Down
100 changes: 0 additions & 100 deletions pkgs/development/haskell-modules/hackage-packages.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkgs/development/haskell-modules/non-hackage-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ self: super:
# https://github.com/channable/vaultenv/issues/1
vaultenv = self.callPackage ../tools/haskell/vaultenv { };

# spago is not released to Hackage.
# spago-legacy is not released to Hackage.
# https://github.com/spacchetti/spago/issues/512
spago = self.callPackage ../tools/purescript/spago/spago.nix { };
spago-legacy = self.callPackage ../../by-name/sp/spago-legacy/spago-legacy.nix { };

# Unofficial fork until PRs are merged https://github.com/pcapriotti/optparse-applicative/pulls/roberth
# cabal2nix --maintainer roberth https://github.com/hercules-ci/optparse-applicative.git > pkgs/development/misc/haskell/hercules-ci-optparse-applicative.nix
Expand Down
1 change: 1 addition & 0 deletions pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2340,6 +2340,7 @@ mapAliases {
soundOfSorting = sound-of-sorting; # Added 2023-07-07
SP800-90B_EntropyAssessment = sp800-90b-entropyassessment; # Added on 2024-06-12
SPAdes = spades; # Added 2024-06-12
spago = spago-legacy; # Added 2025-09-23, pkgs.spago should become spago@next which hasn't been packaged yet
spark2014 = gnatprove; # Added 2024-02-25
space-orbit = throw "'space-orbit' has been removed because it is unmaintained; Debian upstream stopped tracking it in 2011."; # Added 2025-06-08
spatialite_gui = throw "spatialite_gui has been renamed to spatialite-gui"; # Added 2025-01-12
Expand Down
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5150,8 +5150,6 @@ with pkgs;

purenix = haskell.lib.compose.justStaticExecutables haskellPackages.purenix;

spago = callPackage ../development/tools/purescript/spago { };

pulp = nodePackages.pulp;

pscid = nodePackages.pscid;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/release-haskell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ let
shellcheck-minimal
sourceAndTags
spacecookie
spago
spago-legacy
specup
splot
stack
Expand Down
Loading