maintainers/scripts/haskell/regenerate-hackage-packages.sh: Small improvents and encoding workaround
This commit is contained in:
parent
6a0d9e5242
commit
66de11da71
|
@ -1,12 +1,12 @@
|
||||||
#! /usr/bin/env nix-shell
|
#! /usr/bin/env nix-shell
|
||||||
#! nix-shell -i bash -p coreutils haskellPackages.cabal2nix-unstable git nix -I nixpkgs=.
|
#! nix-shell -i bash -p coreutils haskellPackages.cabal2nix-unstable git nix -I nixpkgs=.
|
||||||
|
|
||||||
# This script is used to regenerate nixpkgs' Haskell package set, using a tool
|
# This script is used to regenerate nixpkgs' Haskell package set, using the
|
||||||
# called hackage2nix. hackage2nix looks at the config files in
|
# tool hackage2nix from the nixos/cabal2nix repo. hackage2nix looks at the
|
||||||
# pkgs/development/haskell-modules/configuration-hackage2nix and generates
|
# config files in pkgs/development/haskell-modules/configuration-hackage2nix
|
||||||
# a Nix expression for package version specified there, using the Cabal files
|
# and generates a Nix expression for package version specified there, using the
|
||||||
# from the Hackage database (available under all-cabal-hashes) and its
|
# Cabal files from the Hackage database (available under all-cabal-hashes) and
|
||||||
# companion tool cabal2nix.
|
# its companion tool cabal2nix.
|
||||||
#
|
#
|
||||||
# Related scripts are update-hackage.sh, for updating the snapshot of the
|
# Related scripts are update-hackage.sh, for updating the snapshot of the
|
||||||
# Hackage database used by hackage2nix, and update-cabal2nix-unstable.sh,
|
# Hackage database used by hackage2nix, and update-cabal2nix-unstable.sh,
|
||||||
|
@ -14,10 +14,15 @@
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
# To prevent hackage2nix fails because of encoding.
|
||||||
|
# See: https://github.com/NixOS/nixpkgs/pull/122023
|
||||||
|
export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
extraction_derivation='with import ./. {}; runCommand "unpacked-cabal-hashes" { } "tar xf ${all-cabal-hashes} --strip-components=1 --one-top-level=$out"'
|
extraction_derivation='with import ./. {}; runCommand "unpacked-cabal-hashes" { } "tar xf ${all-cabal-hashes} --strip-components=1 --one-top-level=$out"'
|
||||||
unpacked_hackage="$(nix-build -E "$extraction_derivation" --no-out-link)"
|
unpacked_hackage="$(nix-build -E "$extraction_derivation" --no-out-link)"
|
||||||
config_dir=pkgs/development/haskell-modules/configuration-hackage2nix
|
config_dir=pkgs/development/haskell-modules/configuration-hackage2nix
|
||||||
|
|
||||||
|
echo "Starting hackage2nix to regenerate pkgs/development/haskell-modules/hackage-packages.nix ..."
|
||||||
hackage2nix \
|
hackage2nix \
|
||||||
--hackage "$unpacked_hackage" \
|
--hackage "$unpacked_hackage" \
|
||||||
--preferred-versions <(for n in "$unpacked_hackage"/*/preferred-versions; do cat "$n"; echo; done) \
|
--preferred-versions <(for n in "$unpacked_hackage"/*/preferred-versions; do cat "$n"; echo; done) \
|
||||||
|
@ -35,3 +40,5 @@ hackage-packages.nix: Regenerate based on current config
|
||||||
This commit has been generated by maintainers/scripts/haskell/regenerate-hackage-packages.sh
|
This commit has been generated by maintainers/scripts/haskell/regenerate-hackage-packages.sh
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Regeneration of hackage-packages.nix finished."
|
||||||
|
|
Loading…
Reference in New Issue