From e6ef81d433cb172b24d6905833b725d065b5e935 Mon Sep 17 00:00:00 2001 From: Sander Date: Mon, 23 Jun 2025 19:20:09 +0200 Subject: [PATCH] elmPackages: update and run the `update.sh` script - Vendored the post-patch script for elm-format. - Updated `update.sh` and committed the changes. --- .../packages/ghc9_6/ansi-wl-pprint/default.nix | 2 +- .../compilers/elm/packages/ghc9_6/elm/default.nix | 2 +- .../compilers/elm/packages/ghc9_8/default.nix | 15 +++++++++++---- .../elm/packages/ghc9_8/elm-format/elm-format.nix | 15 +++------------ pkgs/development/compilers/elm/update.sh | 6 +++--- 5 files changed, 19 insertions(+), 21 deletions(-) diff --git a/pkgs/development/compilers/elm/packages/ghc9_6/ansi-wl-pprint/default.nix b/pkgs/development/compilers/elm/packages/ghc9_6/ansi-wl-pprint/default.nix index 53b9b6865f89..4d9092e5b684 100644 --- a/pkgs/development/compilers/elm/packages/ghc9_6/ansi-wl-pprint/default.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_6/ansi-wl-pprint/default.nix @@ -21,6 +21,6 @@ mkDerivation { base ]; 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; } diff --git a/pkgs/development/compilers/elm/packages/ghc9_6/elm/default.nix b/pkgs/development/compilers/elm/packages/ghc9_6/elm/default.nix index 954d15f92e74..253a9986ac64 100644 --- a/pkgs/development/compilers/elm/packages/ghc9_6/elm/default.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_6/elm/default.nix @@ -83,7 +83,7 @@ mkDerivation { zip-archive ]; homepage = "https://elm-lang.org"; - description = "`elm` command line interface"; + description = "The `elm` command line interface"; license = lib.licenses.bsd3; mainProgram = "elm"; } diff --git a/pkgs/development/compilers/elm/packages/ghc9_8/default.nix b/pkgs/development/compilers/elm/packages/ghc9_8/default.nix index 0e8cf8749d96..8e6078f81876 100644 --- a/pkgs/development/compilers/elm/packages/ghc9_8/default.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_8/default.nix @@ -8,12 +8,19 @@ pkgs.haskell.packages.ghc98.override { inherit (pkgs.haskell.lib.compose) justStaticExecutables overrideCabal; elmPkgs = { - /* - The elm-format expression is updated via a script in the https://github.com/avh4/elm-format repo: - `package/nix/build.sh` - */ + # Post-patch override taken from the upstream repository: + # https://github.com/avh4/elm-format/blob/e7e5da37716acbfb4954a88128b5cc72b2c911d9/package/nix/generate_derivation.sh elm-format = justStaticExecutables ( overrideCabal (drv: { + postPatch = '' + mkdir -p ./generated + cat < ./generated/Build_elm_format.hs + module Build_elm_format where + gitDescribe :: String + gitDescribe = "${drv.version}" + EOHS + ''; + homepage = "https://github.com/avh4/elm-format"; maintainers = with lib.maintainers; [ avh4 diff --git a/pkgs/development/compilers/elm/packages/ghc9_8/elm-format/elm-format.nix b/pkgs/development/compilers/elm/packages/ghc9_8/elm-format/elm-format.nix index b7a805abb57b..1b50f8d8384a 100644 --- a/pkgs/development/compilers/elm/packages/ghc9_8/elm-format/elm-format.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_8/elm-format/elm-format.nix @@ -20,13 +20,13 @@ tasty-quickcheck, text, }: -mkDerivation rec { +mkDerivation { pname = "elm-format"; version = "0.8.8"; src = fetchgit { url = "https://github.com/avh4/elm-format"; - sha256 = "0klhnfvy1l6mck46qwk6pp4d66cvj0m5w91ylghdcr4fb6ka1gp0"; - rev = "b06902f1e450f8be1e7b318caab7ccb1950893fa"; + sha256 = "13i1wgva6p9zsx1a7sfb3skc0rv187isb920chkhljyh48c12k8l"; + rev = "d07fddc8c0eef412dba07be4ab8768d6abcca796"; fetchSubmodules = true; }; isLibrary = false; @@ -66,13 +66,4 @@ mkDerivation rec { description = "A source code formatter for Elm"; license = lib.licenses.bsd3; mainProgram = "elm-format"; - postPatch = '' - mkdir -p ./generated - cat < ./generated/Build_elm_format.hs - module Build_elm_format where - - gitDescribe :: String - gitDescribe = "${version}" - EOHS - ''; } diff --git a/pkgs/development/compilers/elm/update.sh b/pkgs/development/compilers/elm/update.sh index 06840608e271..5e47110d4a2f 100755 --- a/pkgs/development/compilers/elm/update.sh +++ b/pkgs/development/compilers/elm/update.sh @@ -3,10 +3,10 @@ # Update all cabal packages. 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' \ - --subpath $subpath > packages/ghc9_2/elm-format/${subpath}.nix + cabal2nix --no-haddock 'https://github.com/avh4/elm-format' --revision '0.8.8' \ + --subpath $subpath > packages/ghc9_8/elm-format/${subpath}.nix 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 # We're building binaries from commit that npm installer is using since