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 {
|
elmPkgs = rec {
|
||||||
elmi-to-json = justStaticExecutables (overrideCabal
|
elmi-to-json = justStaticExecutables (overrideCabal
|
||||||
(drv: {
|
(drv: {
|
||||||
|
version = "unstable-2021-07-19";
|
||||||
|
src = pkgs.fetchgit {
|
||||||
|
url = "https://github.com/stoeffel/elmi-to-json";
|
||||||
|
sha256 = "0vy678k15rzpsn0aly90fb01pxsbqkgf86pa86w0gd94lka8acwl";
|
||||||
|
rev = "6a42376ef4b6877e130971faf964578cc096e29b";
|
||||||
|
fetchSubmodules = true;
|
||||||
|
};
|
||||||
|
|
||||||
prePatch = ''
|
prePatch = ''
|
||||||
substituteInPlace package.yaml --replace "- -Werror" ""
|
substituteInPlace package.yaml --replace "- -Werror" ""
|
||||||
hpack
|
hpack
|
||||||
|
@ -21,6 +29,23 @@ self: pkgs.haskell.packages.ghc810.override {
|
||||||
|
|
||||||
elm-instrument = justStaticExecutables (overrideCabal
|
elm-instrument = justStaticExecutables (overrideCabal
|
||||||
(drv: {
|
(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 = ''
|
prePatch = ''
|
||||||
sed "s/desc <-.*/let desc = \"${drv.version}\"/g" Setup.hs --in-place
|
sed "s/desc <-.*/let desc = \"${drv.version}\"/g" Setup.hs --in-place
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -3,26 +3,16 @@
|
||||||
, fetchgit, filepath, free, HUnit, indents, json, lib, mtl
|
, fetchgit, filepath, free, HUnit, indents, json, lib, mtl
|
||||||
, optparse-applicative, parsec, process, QuickCheck, quickcheck-io
|
, optparse-applicative, parsec, process, QuickCheck, quickcheck-io
|
||||||
, split, tasty, tasty-golden, tasty-hunit, tasty-quickcheck, text
|
, split, tasty, tasty-golden, tasty-hunit, tasty-quickcheck, text
|
||||||
, fetchpatch
|
|
||||||
}:
|
}:
|
||||||
mkDerivation {
|
mkDerivation {
|
||||||
pname = "elm-instrument";
|
pname = "elm-instrument";
|
||||||
version = "unstable-2020-03-16";
|
version = "0.0.7";
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
url = "https://github.com/zwilias/elm-instrument";
|
url = "https://github.com/zwilias/elm-instrument";
|
||||||
sha256 = "167d7l2547zxdj7i60r6vazznd9ichwc0bqckh3vrh46glkz06jv";
|
sha256 = "14yfzwsyvgc6rzn19sdmwk2mc1vma9hcljnmjnmlig8mp0271v56";
|
||||||
rev = "63e15bb5ec5f812e248e61b6944189fa4a0aee4e";
|
rev = "31b527e405a6afdb25bb87ad7bd14f979e65cff7";
|
||||||
fetchSubmodules = true;
|
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;
|
isLibrary = true;
|
||||||
isExecutable = true;
|
isExecutable = true;
|
||||||
setupHaskellDepends = [ base Cabal directory filepath process ];
|
setupHaskellDepends = [ base Cabal directory filepath process ];
|
||||||
|
@ -37,7 +27,7 @@ mkDerivation {
|
||||||
quickcheck-io split tasty tasty-golden tasty-hunit tasty-quickcheck
|
quickcheck-io split tasty tasty-golden tasty-hunit tasty-quickcheck
|
||||||
text
|
text
|
||||||
];
|
];
|
||||||
homepage = "https://elm-lang.org";
|
homepage = "http://elm-lang.org";
|
||||||
description = "Instrumentation library for Elm";
|
description = "Instrumentation library for Elm";
|
||||||
license = lib.licenses.bsd3;
|
license = lib.licenses.bsd3;
|
||||||
mainProgram = "elm-instrument";
|
mainProgram = "elm-instrument";
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
}:
|
}:
|
||||||
mkDerivation {
|
mkDerivation {
|
||||||
pname = "elmi-to-json";
|
pname = "elmi-to-json";
|
||||||
version = "unstable-2021-07-19";
|
version = "1.3.0";
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
url = "https://github.com/stoeffel/elmi-to-json";
|
url = "https://github.com/stoeffel/elmi-to-json";
|
||||||
hash = "sha256-9fScXRSyTkqzeXwh/Jjza6mnENCThlU6KI366CLFcgY=";
|
sha256 = "0vy678k15rzpsn0aly90fb01pxsbqkgf86pa86w0gd94lka8acwl";
|
||||||
rev = "bd18efb59d247439b362272b480e67a16a4e424e";
|
rev = "6a42376ef4b6877e130971faf964578cc096e29b";
|
||||||
fetchSubmodules = true;
|
fetchSubmodules = true;
|
||||||
};
|
};
|
||||||
isLibrary = true;
|
isLibrary = true;
|
||||||
|
|
|
@ -11,6 +11,15 @@ self: pkgs.haskell.packages.ghc92.override {
|
||||||
elm-format = justStaticExecutables (overrideCabal
|
elm-format = justStaticExecutables (overrideCabal
|
||||||
(drv: {
|
(drv: {
|
||||||
jailbreak = true;
|
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";
|
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";
|
homepage = "https://github.com/avh4/elm-format";
|
||||||
|
@ -19,15 +28,20 @@ self: pkgs.haskell.packages.ghc92.override {
|
||||||
})
|
})
|
||||||
(self.callPackage ./elm-format/elm-format.nix { }));
|
(self.callPackage ./elm-format/elm-format.nix { }));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fixHaddock = overrideCabal (_: {
|
||||||
|
configureFlags = [ "--ghc-option=-Wno-error=unused-packages" ];
|
||||||
|
doHaddock = false;
|
||||||
|
});
|
||||||
in
|
in
|
||||||
elmPkgs // {
|
elmPkgs // {
|
||||||
inherit elmPkgs;
|
inherit elmPkgs;
|
||||||
|
|
||||||
# Needed for elm-format
|
# Needed for elm-format
|
||||||
avh4-lib = doJailbreak (self.callPackage ./elm-format/avh4-lib.nix { });
|
avh4-lib = fixHaddock (doJailbreak (self.callPackage ./elm-format/avh4-lib.nix { }));
|
||||||
elm-format-lib = doJailbreak (self.callPackage ./elm-format/elm-format-lib.nix { });
|
elm-format-lib = fixHaddock (doJailbreak (self.callPackage ./elm-format/elm-format-lib.nix { }));
|
||||||
elm-format-test-lib = self.callPackage ./elm-format/elm-format-test-lib.nix { };
|
elm-format-test-lib = fixHaddock (self.callPackage ./elm-format/elm-format-test-lib.nix { });
|
||||||
elm-format-markdown = self.callPackage ./elm-format/elm-format-markdown.nix { };
|
elm-format-markdown = fixHaddock (self.callPackage ./elm-format/elm-format-markdown.nix { });
|
||||||
|
|
||||||
# elm-format requires text >= 2.0
|
# elm-format requires text >= 2.0
|
||||||
text = self.text_2_0_2;
|
text = self.text_2_0_2;
|
||||||
|
|
|
@ -23,8 +23,4 @@ mkDerivation {
|
||||||
testToolDepends = [ tasty-discover ];
|
testToolDepends = [ tasty-discover ];
|
||||||
description = "Common code for haskell projects";
|
description = "Common code for haskell projects";
|
||||||
license = lib.licenses.bsd3;
|
license = lib.licenses.bsd3;
|
||||||
|
|
||||||
# Added manually
|
|
||||||
configureFlags = [ "--ghc-option=-Wno-error=unused-packages" ];
|
|
||||||
doHaddock = false;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,4 @@ mkDerivation {
|
||||||
testToolDepends = [ tasty-discover ];
|
testToolDepends = [ tasty-discover ];
|
||||||
description = "Common code used by elm-format and elm-refactor";
|
description = "Common code used by elm-format and elm-refactor";
|
||||||
license = lib.licenses.bsd3;
|
license = lib.licenses.bsd3;
|
||||||
|
|
||||||
# Added manually
|
|
||||||
doHaddock = false;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,4 @@ mkDerivation {
|
||||||
libraryHaskellDepends = [ base containers mtl text ];
|
libraryHaskellDepends = [ base containers mtl text ];
|
||||||
description = "Markdown parsing for Elm documentation comments";
|
description = "Markdown parsing for Elm documentation comments";
|
||||||
license = lib.licenses.bsd3;
|
license = lib.licenses.bsd3;
|
||||||
|
|
||||||
# Added manually
|
|
||||||
doHaddock = false;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,4 @@ mkDerivation {
|
||||||
testToolDepends = [ tasty-discover ];
|
testToolDepends = [ tasty-discover ];
|
||||||
description = "Test helpers used by elm-format-tests and elm-refactor-tests";
|
description = "Test helpers used by elm-format-tests and elm-refactor-tests";
|
||||||
license = lib.licenses.bsd3;
|
license = lib.licenses.bsd3;
|
||||||
|
|
||||||
# Added manually
|
|
||||||
doHaddock = false;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
, optparse-applicative, QuickCheck, quickcheck-io, relude, tasty
|
, optparse-applicative, QuickCheck, quickcheck-io, relude, tasty
|
||||||
, tasty-hspec, tasty-hunit, tasty-quickcheck, text
|
, tasty-hspec, tasty-hunit, tasty-quickcheck, text
|
||||||
}:
|
}:
|
||||||
mkDerivation rec {
|
mkDerivation {
|
||||||
pname = "elm-format";
|
pname = "elm-format";
|
||||||
version = "0.8.7";
|
version = "0.8.7";
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
|
@ -28,15 +28,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";
|
||||||
|
|
||||||
# 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