From 4fe4118598b82eed28a53de3ed82edae9920fda5 Mon Sep 17 00:00:00 2001 From: Aaron VonderHaar Date: Mon, 8 Feb 2021 19:48:09 -0800 Subject: [PATCH 1/3] elm-format: 0.8.4 -> 0.8.5 --- pkgs/development/compilers/elm/default.nix | 7 ++- .../compilers/elm/packages/avh4-lib.nix | 29 +++++++++++ .../compilers/elm/packages/bimap.nix | 15 ++++++ .../compilers/elm/packages/elm-format-lib.nix | 33 ++++++++++++ .../elm/packages/elm-format-markdown.nix | 16 ++++++ .../elm/packages/elm-format-test-lib.nix | 27 ++++++++++ .../compilers/elm/packages/elm-format.nix | 50 +++++++++---------- .../compilers/elm/packages/indents.nix | 2 +- 8 files changed, 152 insertions(+), 27 deletions(-) create mode 100644 pkgs/development/compilers/elm/packages/avh4-lib.nix create mode 100644 pkgs/development/compilers/elm/packages/bimap.nix create mode 100644 pkgs/development/compilers/elm/packages/elm-format-lib.nix create mode 100644 pkgs/development/compilers/elm/packages/elm-format-markdown.nix create mode 100644 pkgs/development/compilers/elm/packages/elm-format-test-lib.nix diff --git a/pkgs/development/compilers/elm/default.nix b/pkgs/development/compilers/elm/default.nix index 7ee9e6e5d617..2522bb76cd3d 100644 --- a/pkgs/development/compilers/elm/default.nix +++ b/pkgs/development/compilers/elm/default.nix @@ -7,7 +7,7 @@ let fetchElmDeps = import ./fetchElmDeps.nix { inherit stdenv lib fetchurl; }; - hsPkgs = haskell.packages.ghc883.override { + hsPkgs = haskell.packages.ghc8103.override { overrides = self: super: with haskell.lib; with lib; let elmPkgs = rec { elm = overrideCabal (self.callPackage ./packages/elm.nix { }) (drv: { @@ -79,6 +79,11 @@ let # Needed for elm-format indents = self.callPackage ./packages/indents.nix {}; + bimap = self.callPackage ./packages/bimap.nix {}; + avh4-lib = self.callPackage ./packages/avh4-lib.nix {}; + elm-format-lib = self.callPackage ./packages/elm-format-lib.nix {}; + elm-format-test-lib = self.callPackage ./packages/elm-format-test-lib.nix {}; + elm-format-markdown = self.callPackage ./packages/elm-format-markdown.nix {}; }; }; diff --git a/pkgs/development/compilers/elm/packages/avh4-lib.nix b/pkgs/development/compilers/elm/packages/avh4-lib.nix new file mode 100644 index 000000000000..cd3df7d67a96 --- /dev/null +++ b/pkgs/development/compilers/elm/packages/avh4-lib.nix @@ -0,0 +1,29 @@ +{ mkDerivation, ansi-terminal, ansi-wl-pprint, array, base, bimap +, binary, bytestring, containers, directory, fetchgit, filepath +, lib, mtl, process, relude, tasty, tasty-discover, tasty-hspec +, tasty-hunit, text +}: +mkDerivation { + pname = "avh4-lib"; + version = "0.0.0.1"; + src = fetchgit { + url = "https://github.com/avh4/elm-format"; + sha256 = "0bcjkcs1dy1csz0mpk7d4b5wf93fsj9p86x8fp42mb0pipdd0bh6"; + rev = "80f15d85ee71e1663c9b53903f2b5b2aa444a3be"; + fetchSubmodules = true; + }; + postUnpack = "sourceRoot+=/avh4-lib; echo source root reset to $sourceRoot"; + libraryHaskellDepends = [ + ansi-terminal ansi-wl-pprint array base bimap binary bytestring + containers directory filepath mtl process relude text + ]; + testHaskellDepends = [ + ansi-terminal ansi-wl-pprint array base bimap binary bytestring + containers directory filepath mtl process relude tasty tasty-hspec + tasty-hunit text + ]; + testToolDepends = [ tasty-discover ]; + doHaddock = false; + description = "Common code for haskell projects"; + license = lib.licenses.bsd3; +} diff --git a/pkgs/development/compilers/elm/packages/bimap.nix b/pkgs/development/compilers/elm/packages/bimap.nix new file mode 100644 index 000000000000..41412d1639c7 --- /dev/null +++ b/pkgs/development/compilers/elm/packages/bimap.nix @@ -0,0 +1,15 @@ +{ mkDerivation, base, containers, exceptions, lib, QuickCheck +, template-haskell +}: +mkDerivation { + pname = "bimap"; + version = "0.3.3"; + sha256 = "73829355c7bcbd3eedba22a382a04a3ab641702b00828790ec082ec2db3a8ad1"; + libraryHaskellDepends = [ base containers exceptions ]; + testHaskellDepends = [ + base containers exceptions QuickCheck template-haskell + ]; + homepage = "https://github.com/joelwilliamson/bimap"; + description = "Bidirectional mapping between two key types"; + license = lib.licenses.bsd3; +} diff --git a/pkgs/development/compilers/elm/packages/elm-format-lib.nix b/pkgs/development/compilers/elm/packages/elm-format-lib.nix new file mode 100644 index 000000000000..7beb52e8006e --- /dev/null +++ b/pkgs/development/compilers/elm/packages/elm-format-lib.nix @@ -0,0 +1,33 @@ +{ mkDerivation, ansi-terminal, ansi-wl-pprint, array, avh4-lib +, base, bimap, binary, bytestring, containers, directory +, elm-format-markdown, elm-format-test-lib, fetchgit, filepath +, indents, json, lib, mtl, optparse-applicative, parsec, process +, relude, split, tasty, tasty-discover, tasty-hspec, tasty-hunit +, text +}: +mkDerivation { + pname = "elm-format-lib"; + version = "0.0.0.1"; + src = fetchgit { + url = "https://github.com/avh4/elm-format"; + sha256 = "0bcjkcs1dy1csz0mpk7d4b5wf93fsj9p86x8fp42mb0pipdd0bh6"; + rev = "80f15d85ee71e1663c9b53903f2b5b2aa444a3be"; + fetchSubmodules = true; + }; + postUnpack = "sourceRoot+=/elm-format-lib; echo source root reset to $sourceRoot"; + libraryHaskellDepends = [ + ansi-terminal ansi-wl-pprint array avh4-lib base bimap binary + bytestring containers directory elm-format-markdown filepath + indents json mtl optparse-applicative parsec process relude text + ]; + testHaskellDepends = [ + ansi-terminal ansi-wl-pprint array avh4-lib base bimap binary + bytestring containers directory elm-format-markdown + elm-format-test-lib filepath indents json mtl optparse-applicative + parsec process relude split tasty tasty-hspec tasty-hunit text + ]; + testToolDepends = [ tasty-discover ]; + doHaddock = false; + description = "Common code used by elm-format and elm-refactor"; + license = lib.licenses.bsd3; +} diff --git a/pkgs/development/compilers/elm/packages/elm-format-markdown.nix b/pkgs/development/compilers/elm/packages/elm-format-markdown.nix new file mode 100644 index 000000000000..ae3b40347dbb --- /dev/null +++ b/pkgs/development/compilers/elm/packages/elm-format-markdown.nix @@ -0,0 +1,16 @@ +{ mkDerivation, base, containers, fetchgit, lib, mtl, text }: +mkDerivation { + pname = "elm-format-markdown"; + version = "0.0.0.1"; + src = fetchgit { + url = "https://github.com/avh4/elm-format"; + sha256 = "0bcjkcs1dy1csz0mpk7d4b5wf93fsj9p86x8fp42mb0pipdd0bh6"; + rev = "80f15d85ee71e1663c9b53903f2b5b2aa444a3be"; + fetchSubmodules = true; + }; + postUnpack = "sourceRoot+=/elm-format-markdown; echo source root reset to $sourceRoot"; + libraryHaskellDepends = [ base containers mtl text ]; + doHaddock = false; + description = "Markdown parsing for Elm documentation comments"; + license = lib.licenses.bsd3; +} diff --git a/pkgs/development/compilers/elm/packages/elm-format-test-lib.nix b/pkgs/development/compilers/elm/packages/elm-format-test-lib.nix new file mode 100644 index 000000000000..729c2d678fce --- /dev/null +++ b/pkgs/development/compilers/elm/packages/elm-format-test-lib.nix @@ -0,0 +1,27 @@ +{ mkDerivation, avh4-lib, base, containers, fetchgit, filepath +, hspec-core, hspec-golden, lib, mtl, split, tasty, tasty-discover +, tasty-hspec, tasty-hunit, text +}: +mkDerivation { + pname = "elm-format-test-lib"; + version = "0.0.0.1"; + src = fetchgit { + url = "https://github.com/avh4/elm-format"; + sha256 = "0bcjkcs1dy1csz0mpk7d4b5wf93fsj9p86x8fp42mb0pipdd0bh6"; + rev = "80f15d85ee71e1663c9b53903f2b5b2aa444a3be"; + fetchSubmodules = true; + }; + postUnpack = "sourceRoot+=/elm-format-test-lib; echo source root reset to $sourceRoot"; + libraryHaskellDepends = [ + avh4-lib base containers filepath hspec-core hspec-golden mtl split + tasty tasty-hspec tasty-hunit text + ]; + testHaskellDepends = [ + avh4-lib base containers filepath hspec-core hspec-golden mtl split + tasty tasty-hspec tasty-hunit text + ]; + testToolDepends = [ tasty-discover ]; + doHaddock = false; + description = "Test helpers used by elm-format-tests and elm-refactor-tests"; + license = lib.licenses.bsd3; +} diff --git a/pkgs/development/compilers/elm/packages/elm-format.nix b/pkgs/development/compilers/elm/packages/elm-format.nix index b2f655d4f1c5..2d2cbcf3bc94 100644 --- a/pkgs/development/compilers/elm/packages/elm-format.nix +++ b/pkgs/development/compilers/elm/packages/elm-format.nix @@ -1,40 +1,40 @@ -{ mkDerivation, fetchgit, ansi-terminal, ansi-wl-pprint, array, base, binary -, bytestring, cmark, containers, directory, filepath, free, HUnit -, indents, json, mtl, optparse-applicative, parsec, process -, QuickCheck, quickcheck-io, split, lib, tasty, tasty-golden -, tasty-hunit, tasty-quickcheck, text +{ mkDerivation, ansi-wl-pprint, avh4-lib, base, bimap, cmark +, containers, elm-format-lib, elm-format-test-lib, fetchgit, json +, lib, mtl, optparse-applicative, parsec, QuickCheck, quickcheck-io +, relude, tasty, tasty-hspec, tasty-hunit, tasty-quickcheck, text }: mkDerivation { pname = "elm-format"; - version = "0.8.4"; + version = "0.8.5"; src = fetchgit { url = "https://github.com/avh4/elm-format"; - sha256 = "0cxlhhdjx4h9g03z83pxv91qrysbi0ab92rl52jb0yvkaix989ai"; - rev = "5bd4fbe591fe8b456160c180cb875ef60bc57890"; + sha256 = "0bcjkcs1dy1csz0mpk7d4b5wf93fsj9p86x8fp42mb0pipdd0bh6"; + rev = "80f15d85ee71e1663c9b53903f2b5b2aa444a3be"; + fetchSubmodules = true; }; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = [ + ansi-wl-pprint avh4-lib base containers elm-format-lib json + optparse-applicative relude text + ]; + testHaskellDepends = [ + ansi-wl-pprint avh4-lib base bimap cmark containers elm-format-lib + elm-format-test-lib json mtl optparse-applicative parsec QuickCheck + quickcheck-io relude tasty tasty-hspec tasty-hunit tasty-quickcheck + text + ]; + doHaddock = false; + homepage = "https://elm-lang.org"; + description = "A source code formatter for Elm"; + license = lib.licenses.bsd3; postPatch = '' mkdir -p ./generated cat < ./generated/Build_elm_format.hs module Build_elm_format where gitDescribe :: String - gitDescribe = "0.8.4" + gitDescribe = "0.8.5" EOHS ''; - isLibrary = false; - isExecutable = true; - libraryHaskellDepends = [ - ansi-terminal ansi-wl-pprint array base binary bytestring - containers directory filepath free indents json mtl - optparse-applicative parsec process split text - ]; - executableHaskellDepends = [ base ]; - testHaskellDepends = [ - base cmark containers HUnit mtl parsec QuickCheck quickcheck-io - split tasty tasty-golden tasty-hunit tasty-quickcheck text - ]; - doHaddock = false; - homepage = "https://elm-lang.org"; - description = "A source code formatter for Elm"; - license = lib.licenses.bsd3; } diff --git a/pkgs/development/compilers/elm/packages/indents.nix b/pkgs/development/compilers/elm/packages/indents.nix index d196e8d0fbf6..85e765db3e50 100644 --- a/pkgs/development/compilers/elm/packages/indents.nix +++ b/pkgs/development/compilers/elm/packages/indents.nix @@ -1,4 +1,4 @@ -{ mkDerivation, base, concatenative, mtl, parsec, lib }: +{ mkDerivation, base, concatenative, lib, mtl, parsec }: mkDerivation { pname = "indents"; version = "0.3.3"; From c16cecdcd65b8cfcb00af22d7103bed54343a0eb Mon Sep 17 00:00:00 2001 From: Aaron VonderHaar Date: Tue, 9 Feb 2021 00:21:28 -0800 Subject: [PATCH 2/3] Add maintainer: avh4 --- maintainers/maintainer-list.nix | 6 ++++++ pkgs/development/compilers/elm/default.nix | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 17ced60c6849..ba59b3fc5f57 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -904,6 +904,12 @@ githubId = 687218; name = "averelld"; }; + avh4 = { + email = "gruen0aermel@gmail.com"; + github = "avh4"; + githubId = 1222; + name = "Aaron VonderHaar"; + }; avitex = { email = "theavitex@gmail.com"; github = "avitex"; diff --git a/pkgs/development/compilers/elm/default.nix b/pkgs/development/compilers/elm/default.nix index 2522bb76cd3d..557dcf968307 100644 --- a/pkgs/development/compilers/elm/default.nix +++ b/pkgs/development/compilers/elm/default.nix @@ -41,7 +41,7 @@ let description = "Formats Elm source code according to a standard set of rules based on the official Elm Style Guide"; homepage = "https://github.com/avh4/elm-format"; license = licenses.bsd3; - maintainers = with maintainers; [ turbomack ]; + maintainers = with maintainers; [ avh4 turbomack ]; })); elmi-to-json = justStaticExecutables (overrideCabal (self.callPackage ./packages/elmi-to-json.nix {}) (drv: { From bdf0239c3f83ee985901e930d87659731e02c8e2 Mon Sep 17 00:00:00 2001 From: Aaron VonderHaar Date: Tue, 9 Feb 2021 11:27:30 -0800 Subject: [PATCH 3/3] elm-format: simplify the nix expression --- pkgs/development/compilers/elm/packages/elm-format.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/elm/packages/elm-format.nix b/pkgs/development/compilers/elm/packages/elm-format.nix index 2d2cbcf3bc94..6b583a6edde2 100644 --- a/pkgs/development/compilers/elm/packages/elm-format.nix +++ b/pkgs/development/compilers/elm/packages/elm-format.nix @@ -3,7 +3,7 @@ , lib, mtl, optparse-applicative, parsec, QuickCheck, quickcheck-io , relude, tasty, tasty-hspec, tasty-hunit, tasty-quickcheck, text }: -mkDerivation { +mkDerivation rec { pname = "elm-format"; version = "0.8.5"; src = fetchgit { @@ -34,7 +34,7 @@ mkDerivation { module Build_elm_format where gitDescribe :: String - gitDescribe = "0.8.5" + gitDescribe = "${version}" EOHS ''; }