Files
nixpkgs/pkgs/development/compilers/elm/update.sh
Matt McHenry bab9648f11 elmPackages.elm: 0.19.1 -> 0.19.2
two interesting changes here:

first, 0.19.2 needs to be built with GHC 9.8 rather than GHC 9.6.  So,
we move it and ansi-wl-pprint from packages/ghc9_6/ to
packages/ghc9_8/, adding the elmPkgs attributes to
packages/ghc9_8/default.nix.  however, elm-format does *not* want the
older ansi-wl-pprint, so we push its use down inside the 'callPackage
./elm {}' scope.

second, we're picking up a newer version of ansi-terminal than
upstream uses, which has introduced a couple of new
underlining-related constructors.  so, we patch in cases for them
where necessary.  (I was a bit surprised that the existing
SingleUnderline and DoubleUnderline cases in the 'isUnderline'
function did not both evaluate to 'True', so I'm taking my best guess
as to the real intent here; easy enough to fix if we discover these
new cases should be 'True'.)

we also manually preserve the 'description' attribute in
elm/default.nix. (the update script clobbered it.)

other than the above, the update script as modified here produced all
these changes.
2026-07-12 17:12:26 -04:00

29 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=../../../..
#!nix-shell --pure -p nix cacert cabal2nix elm2nix nixfmt -i bash ../../../..
set -o errexit
set -o nounset
# Update all cabal packages.
for subpath in 'avh4-lib' 'elm-format-lib' 'elm-format-markdown' 'elm-format-test-lib'; do
cabal2nix --no-haddock 'https://github.com/avh4/elm-format' --revision '0.8.8' \
--subpath $subpath > packages/ghc9_8/elm-format/${subpath}.nix
done
cabal2nix --no-haddock 'https://github.com/avh4/elm-format' --revision '0.8.8' > packages/ghc9_8/elm-format/elm-format.nix
cabal2nix 'https://github.com/ekmett/ansi-wl-pprint' --revision 'v0.6.8.1' > packages/ghc9_8/ansi-wl-pprint/default.nix
# We're building binaries from commit corresponding to https://github.com/elm/compiler/releases/tag/0.19.2.
# These binaries are built with newer ghc version and also support Aarch64 for Linux and Darwin.
cabal2nix https://github.com/elm/compiler --revision 48befde196cbcbdf459114e36c02b52c49b58050 > packages/ghc9_8/elm/default.nix
echo "need to manually copy registry.dat from an existing elm project"
#elm2nix snapshot > registry.dat
pushd "$(nix-build -A elmPackages.elm.src --no-out-link ../../../..)/reactor"
elm2nix convert > $OLDPWD/packages/elm-srcs.nix
popd
# cabal2nix, elm2nix, etc. may not respect nixpkgs formatting rules
nixfmt .