From ae5eab1bf17d71ab2e7c467aa13ccd3811d73fff Mon Sep 17 00:00:00 2001 From: PedroHLC Date: Thu, 28 Mar 2024 12:57:47 -0300 Subject: elm: refactor file structure --- .../elm/packages/ghc9_2/elm-format/avh4-lib.nix | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 pkgs/development/compilers/elm/packages/ghc9_2/elm-format/avh4-lib.nix (limited to 'pkgs/development/compilers/elm/packages/ghc9_2/elm-format/avh4-lib.nix') diff --git a/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/avh4-lib.nix b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/avh4-lib.nix new file mode 100644 index 0000000000000..871394312c049 --- /dev/null +++ b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/avh4-lib.nix @@ -0,0 +1,30 @@ +{ mkDerivation, array, base, bytestring, directory, fetchgit +, filepath, lib, mtl, pooled-io, 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 = "04l1bn4w8q3ifd6mc4mfrqxfbihmqnpfjdn6gr0x2jqcasjbk0bi"; + rev = "b5cca4c26b473dab06e5d73b98148637e4770d45"; + fetchSubmodules = true; + }; + postUnpack = "sourceRoot+=/avh4-lib; echo source root reset to $sourceRoot"; + libraryHaskellDepends = [ + array base bytestring directory filepath mtl pooled-io process + relude text + ]; + testHaskellDepends = [ + array base bytestring directory filepath mtl pooled-io process + relude tasty tasty-hspec tasty-hunit text + ]; + testToolDepends = [ tasty-discover ]; + description = "Common code for haskell projects"; + license = lib.licenses.bsd3; + + # Added manually + configureFlags = [ "--ghc-option=-Wno-error=unused-packages" ]; + doHaddock = false; +} -- cgit 1.4.1 From d546502c7ccdedcb0c51dcdc9aa7ef8727d3d83e Mon Sep 17 00:00:00 2001 From: PedroHLC Date: Thu, 28 Mar 2024 13:57:08 -0300 Subject: elmPackages: move adjusts from cabal2nix-generated files to overrides --- .../compilers/elm/packages/ghc8_10/default.nix | 25 ++++++++++++++++++++++ .../packages/ghc8_10/elm-instrument/default.nix | 18 ++++------------ .../elm/packages/ghc8_10/elmi-to-json/default.nix | 6 +++--- .../compilers/elm/packages/ghc9_2/default.nix | 22 +++++++++++++++---- .../elm/packages/ghc9_2/elm-format/avh4-lib.nix | 4 ---- .../packages/ghc9_2/elm-format/elm-format-lib.nix | 3 --- .../ghc9_2/elm-format/elm-format-markdown.nix | 3 --- .../ghc9_2/elm-format/elm-format-test-lib.nix | 3 --- .../elm/packages/ghc9_2/elm-format/elm-format.nix | 13 +---------- 9 files changed, 51 insertions(+), 46 deletions(-) (limited to 'pkgs/development/compilers/elm/packages/ghc9_2/elm-format/avh4-lib.nix') diff --git a/pkgs/development/compilers/elm/packages/ghc8_10/default.nix b/pkgs/development/compilers/elm/packages/ghc8_10/default.nix index 3414dce836eef..f68e582b3d0b9 100644 --- a/pkgs/development/compilers/elm/packages/ghc8_10/default.nix +++ b/pkgs/development/compilers/elm/packages/ghc8_10/default.nix @@ -6,6 +6,14 @@ self: pkgs.haskell.packages.ghc810.override { elmPkgs = rec { elmi-to-json = justStaticExecutables (overrideCabal (drv: { + version = "unstable-2021-07-19"; + src = pkgs.fetchgit { + url = "https://github.com/stoeffel/elmi-to-json"; + sha256 = "0vy678k15rzpsn0aly90fb01pxsbqkgf86pa86w0gd94lka8acwl"; + rev = "6a42376ef4b6877e130971faf964578cc096e29b"; + fetchSubmodules = true; + }; + prePatch = '' substituteInPlace package.yaml --replace "- -Werror" "" hpack @@ -21,6 +29,23 @@ self: pkgs.haskell.packages.ghc810.override { elm-instrument = justStaticExecutables (overrideCabal (drv: { + version = "unstable-2020-03-16"; + src = pkgs.fetchgit { + url = "https://github.com/zwilias/elm-instrument"; + sha256 = "167d7l2547zxdj7i60r6vazznd9ichwc0bqckh3vrh46glkz06jv"; + rev = "63e15bb5ec5f812e248e61b6944189fa4a0aee4e"; + fetchSubmodules = true; + }; + patches = [ + # Update code after breaking change in optparse-applicative + # https://github.com/zwilias/elm-instrument/pull/5 + (pkgs.fetchpatch { + name = "update-optparse-applicative.patch"; + url = "https://github.com/mdevlamynck/elm-instrument/commit/c548709d4818aeef315528e842eaf4c5b34b59b4.patch"; + sha256 = "0ln7ik09n3r3hk7jmwwm46kz660mvxfa71120rkbbaib2falfhsc"; + }) + ]; + prePatch = '' sed "s/desc <-.*/let desc = \"${drv.version}\"/g" Setup.hs --in-place ''; diff --git a/pkgs/development/compilers/elm/packages/ghc8_10/elm-instrument/default.nix b/pkgs/development/compilers/elm/packages/ghc8_10/elm-instrument/default.nix index cb123d15efc6d..7f6a25905e36f 100644 --- a/pkgs/development/compilers/elm/packages/ghc8_10/elm-instrument/default.nix +++ b/pkgs/development/compilers/elm/packages/ghc8_10/elm-instrument/default.nix @@ -3,26 +3,16 @@ , fetchgit, filepath, free, HUnit, indents, json, lib, mtl , optparse-applicative, parsec, process, QuickCheck, quickcheck-io , split, tasty, tasty-golden, tasty-hunit, tasty-quickcheck, text -, fetchpatch }: mkDerivation { pname = "elm-instrument"; - version = "unstable-2020-03-16"; + version = "0.0.7"; src = fetchgit { url = "https://github.com/zwilias/elm-instrument"; - sha256 = "167d7l2547zxdj7i60r6vazznd9ichwc0bqckh3vrh46glkz06jv"; - rev = "63e15bb5ec5f812e248e61b6944189fa4a0aee4e"; + sha256 = "14yfzwsyvgc6rzn19sdmwk2mc1vma9hcljnmjnmlig8mp0271v56"; + rev = "31b527e405a6afdb25bb87ad7bd14f979e65cff7"; fetchSubmodules = true; }; - patches = [ - # Update code after breaking change in optparse-applicative - # https://github.com/zwilias/elm-instrument/pull/5 - (fetchpatch { - name = "update-optparse-applicative.patch"; - url = "https://github.com/mdevlamynck/elm-instrument/commit/c548709d4818aeef315528e842eaf4c5b34b59b4.patch"; - sha256 = "0ln7ik09n3r3hk7jmwwm46kz660mvxfa71120rkbbaib2falfhsc"; - }) - ]; isLibrary = true; isExecutable = true; setupHaskellDepends = [ base Cabal directory filepath process ]; @@ -37,7 +27,7 @@ mkDerivation { quickcheck-io split tasty tasty-golden tasty-hunit tasty-quickcheck text ]; - homepage = "https://elm-lang.org"; + homepage = "http://elm-lang.org"; description = "Instrumentation library for Elm"; license = lib.licenses.bsd3; mainProgram = "elm-instrument"; diff --git a/pkgs/development/compilers/elm/packages/ghc8_10/elmi-to-json/default.nix b/pkgs/development/compilers/elm/packages/ghc8_10/elmi-to-json/default.nix index 3e61c21b9c3ef..fc2c76149a1a5 100644 --- a/pkgs/development/compilers/elm/packages/ghc8_10/elmi-to-json/default.nix +++ b/pkgs/development/compilers/elm/packages/ghc8_10/elmi-to-json/default.nix @@ -4,11 +4,11 @@ }: mkDerivation { pname = "elmi-to-json"; - version = "unstable-2021-07-19"; + version = "1.3.0"; src = fetchgit { url = "https://github.com/stoeffel/elmi-to-json"; - hash = "sha256-9fScXRSyTkqzeXwh/Jjza6mnENCThlU6KI366CLFcgY="; - rev = "bd18efb59d247439b362272b480e67a16a4e424e"; + sha256 = "0vy678k15rzpsn0aly90fb01pxsbqkgf86pa86w0gd94lka8acwl"; + rev = "6a42376ef4b6877e130971faf964578cc096e29b"; fetchSubmodules = true; }; isLibrary = true; diff --git a/pkgs/development/compilers/elm/packages/ghc9_2/default.nix b/pkgs/development/compilers/elm/packages/ghc9_2/default.nix index de99dfd91dbc0..5ef5eff3bef17 100644 --- a/pkgs/development/compilers/elm/packages/ghc9_2/default.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_2/default.nix @@ -11,6 +11,15 @@ self: pkgs.haskell.packages.ghc92.override { elm-format = justStaticExecutables (overrideCabal (drv: { jailbreak = true; + doHaddock = false; + postPatch = '' + mkdir -p ./generated + cat < ./generated/Build_elm_format.hs + module Build_elm_format where + gitDescribe :: String + gitDescribe = "${drv.version}" + EOHS + ''; 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"; @@ -19,15 +28,20 @@ self: pkgs.haskell.packages.ghc92.override { }) (self.callPackage ./elm-format/elm-format.nix { })); }; + + fixHaddock = overrideCabal (_: { + configureFlags = [ "--ghc-option=-Wno-error=unused-packages" ]; + doHaddock = false; + }); in elmPkgs // { inherit elmPkgs; # Needed for elm-format - avh4-lib = doJailbreak (self.callPackage ./elm-format/avh4-lib.nix { }); - elm-format-lib = doJailbreak (self.callPackage ./elm-format/elm-format-lib.nix { }); - elm-format-test-lib = self.callPackage ./elm-format/elm-format-test-lib.nix { }; - elm-format-markdown = self.callPackage ./elm-format/elm-format-markdown.nix { }; + avh4-lib = fixHaddock (doJailbreak (self.callPackage ./elm-format/avh4-lib.nix { })); + elm-format-lib = fixHaddock (doJailbreak (self.callPackage ./elm-format/elm-format-lib.nix { })); + elm-format-test-lib = fixHaddock (self.callPackage ./elm-format/elm-format-test-lib.nix { }); + elm-format-markdown = fixHaddock (self.callPackage ./elm-format/elm-format-markdown.nix { }); # elm-format requires text >= 2.0 text = self.text_2_0_2; diff --git a/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/avh4-lib.nix b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/avh4-lib.nix index 871394312c049..e320edfd11623 100644 --- a/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/avh4-lib.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/avh4-lib.nix @@ -23,8 +23,4 @@ mkDerivation { testToolDepends = [ tasty-discover ]; description = "Common code for haskell projects"; license = lib.licenses.bsd3; - - # Added manually - configureFlags = [ "--ghc-option=-Wno-error=unused-packages" ]; - doHaddock = false; } diff --git a/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-lib.nix b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-lib.nix index 2f81da176ac04..290534bbea9a5 100644 --- a/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-lib.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-lib.nix @@ -26,7 +26,4 @@ mkDerivation { testToolDepends = [ tasty-discover ]; description = "Common code used by elm-format and elm-refactor"; license = lib.licenses.bsd3; - - # Added manually - doHaddock = false; } diff --git a/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-markdown.nix b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-markdown.nix index 43174cf017254..e57d2127822e7 100644 --- a/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-markdown.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-markdown.nix @@ -12,7 +12,4 @@ mkDerivation { libraryHaskellDepends = [ base containers mtl text ]; description = "Markdown parsing for Elm documentation comments"; license = lib.licenses.bsd3; - - # Added manually - doHaddock = false; } diff --git a/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-test-lib.nix b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-test-lib.nix index 9cd433ad88437..43090abbeae49 100644 --- a/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-test-lib.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format-test-lib.nix @@ -23,7 +23,4 @@ mkDerivation { testToolDepends = [ tasty-discover ]; description = "Test helpers used by elm-format-tests and elm-refactor-tests"; license = lib.licenses.bsd3; - - # Added manually - doHaddock = false; } diff --git a/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format.nix b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format.nix index e57024acd662b..82ec995e1ecc2 100644 --- a/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_2/elm-format/elm-format.nix @@ -3,7 +3,7 @@ , optparse-applicative, QuickCheck, quickcheck-io, relude, tasty , tasty-hspec, tasty-hunit, tasty-quickcheck, text }: -mkDerivation rec { +mkDerivation { pname = "elm-format"; version = "0.8.7"; src = fetchgit { @@ -28,15 +28,4 @@ mkDerivation rec { description = "A source code formatter for Elm"; license = lib.licenses.bsd3; mainProgram = "elm-format"; - - # Added manually (and "rec" above) - doHaddock = false; - postPatch = '' - mkdir -p ./generated - cat < ./generated/Build_elm_format.hs - module Build_elm_format where - gitDescribe :: String - gitDescribe = "${version}" - EOHS - ''; } -- cgit 1.4.1