elmPackages: update and run the update.sh script

- Vendored the post-patch script for elm-format.
- Updated `update.sh` and committed the changes.
This commit is contained in:
Sander 2025-06-23 19:20:09 +02:00
parent dd23e181c8
commit e6ef81d433
No known key found for this signature in database
GPG Key ID: D1A763BC84F34603
5 changed files with 19 additions and 21 deletions

View File

@ -21,6 +21,6 @@ mkDerivation {
base base
]; ];
homepage = "http://github.com/ekmett/ansi-wl-pprint"; homepage = "http://github.com/ekmett/ansi-wl-pprint";
description = "Wadler/Leijen Pretty Printer for colored ANSI terminal output"; description = "The Wadler/Leijen Pretty Printer for colored ANSI terminal output";
license = lib.licenses.bsd3; license = lib.licenses.bsd3;
} }

View File

@ -83,7 +83,7 @@ mkDerivation {
zip-archive zip-archive
]; ];
homepage = "https://elm-lang.org"; homepage = "https://elm-lang.org";
description = "`elm` command line interface"; description = "The `elm` command line interface";
license = lib.licenses.bsd3; license = lib.licenses.bsd3;
mainProgram = "elm"; mainProgram = "elm";
} }

View File

@ -8,12 +8,19 @@ pkgs.haskell.packages.ghc98.override {
inherit (pkgs.haskell.lib.compose) justStaticExecutables overrideCabal; inherit (pkgs.haskell.lib.compose) justStaticExecutables overrideCabal;
elmPkgs = { elmPkgs = {
/* # Post-patch override taken from the upstream repository:
The elm-format expression is updated via a script in the https://github.com/avh4/elm-format repo: # https://github.com/avh4/elm-format/blob/e7e5da37716acbfb4954a88128b5cc72b2c911d9/package/nix/generate_derivation.sh
`package/nix/build.sh`
*/
elm-format = justStaticExecutables ( elm-format = justStaticExecutables (
overrideCabal (drv: { overrideCabal (drv: {
postPatch = ''
mkdir -p ./generated
cat <<EOHS > ./generated/Build_elm_format.hs
module Build_elm_format where
gitDescribe :: String
gitDescribe = "${drv.version}"
EOHS
'';
homepage = "https://github.com/avh4/elm-format"; homepage = "https://github.com/avh4/elm-format";
maintainers = with lib.maintainers; [ maintainers = with lib.maintainers; [
avh4 avh4

View File

@ -20,13 +20,13 @@
tasty-quickcheck, tasty-quickcheck,
text, text,
}: }:
mkDerivation rec { mkDerivation {
pname = "elm-format"; pname = "elm-format";
version = "0.8.8"; version = "0.8.8";
src = fetchgit { src = fetchgit {
url = "https://github.com/avh4/elm-format"; url = "https://github.com/avh4/elm-format";
sha256 = "0klhnfvy1l6mck46qwk6pp4d66cvj0m5w91ylghdcr4fb6ka1gp0"; sha256 = "13i1wgva6p9zsx1a7sfb3skc0rv187isb920chkhljyh48c12k8l";
rev = "b06902f1e450f8be1e7b318caab7ccb1950893fa"; rev = "d07fddc8c0eef412dba07be4ab8768d6abcca796";
fetchSubmodules = true; fetchSubmodules = true;
}; };
isLibrary = false; isLibrary = false;
@ -66,13 +66,4 @@ mkDerivation rec {
description = "A source code formatter for Elm"; description = "A source code formatter for Elm";
license = lib.licenses.bsd3; license = lib.licenses.bsd3;
mainProgram = "elm-format"; mainProgram = "elm-format";
postPatch = ''
mkdir -p ./generated
cat <<EOHS > ./generated/Build_elm_format.hs
module Build_elm_format where
gitDescribe :: String
gitDescribe = "${version}"
EOHS
'';
} }

View File

@ -3,10 +3,10 @@
# Update all cabal packages. # Update all cabal packages.
for subpath in 'avh4-lib' 'elm-format-lib' 'elm-format-markdown' 'elm-format-test-lib'; do for subpath in 'avh4-lib' 'elm-format-lib' 'elm-format-markdown' 'elm-format-test-lib'; do
cabal2nix 'https://github.com/avh4/elm-format' --revision '0.8.7' \ cabal2nix --no-haddock 'https://github.com/avh4/elm-format' --revision '0.8.8' \
--subpath $subpath > packages/ghc9_2/elm-format/${subpath}.nix --subpath $subpath > packages/ghc9_8/elm-format/${subpath}.nix
done done
cabal2nix 'https://github.com/avh4/elm-format' --revision '0.8.7' > packages/ghc9_2/elm-format/elm-format.nix 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_6/ansi-wl-pprint/default.nix cabal2nix 'https://github.com/ekmett/ansi-wl-pprint' --revision 'v0.6.8.1' > packages/ghc9_6/ansi-wl-pprint/default.nix
# We're building binaries from commit that npm installer is using since # We're building binaries from commit that npm installer is using since