elmPackages: move adjusts from cabal2nix-generated files to overrides
This commit is contained in:
parent
13b12a9281
commit
d546502c7c
9 changed files with 51 additions and 46 deletions
|
@ -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
|
||||
'';
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -11,6 +11,15 @@ self: pkgs.haskell.packages.ghc92.override {
|
|||
elm-format = justStaticExecutables (overrideCabal
|
||||
(drv: {
|
||||
jailbreak = true;
|
||||
doHaddock = false;
|
||||
postPatch = ''
|
||||
mkdir -p ./generated
|
||||
cat <<EOHS > ./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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 <<EOHS > ./generated/Build_elm_format.hs
|
||||
module Build_elm_format where
|
||||
gitDescribe :: String
|
||||
gitDescribe = "${version}"
|
||||
EOHS
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue