2023-04-29 16:46:19 +00:00
|
|
|
{ lib, fetchFromGitHub, fetchpatch, crystal }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
crystal.buildCrystalPackage rec {
|
|
|
|
pname = "ameba";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "1.4.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "crystal-ameba";
|
|
|
|
repo = "ameba";
|
2023-03-04 12:14:45 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-04-12 12:48:02 +00:00
|
|
|
hash = "sha256-pc9mtVR/PBhM5l1PnDkm+y+McxbrfAmQzxmLi761VF4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/crystal-ameba/ameba/commit/c7f2cba409787a1928fbb54494b4645ec11005cc.patch";
|
|
|
|
hash = "sha256-tYEPke6omMdCGG2llJGXDZ3jTO4YAqpknzTPi2576UI=";
|
|
|
|
})
|
2023-07-15 17:15:38 +00:00
|
|
|
(fetchpatch {
|
|
|
|
# Fixes: Error: type must be Ameba::Severity, not (Ameba::Severity | Nil)
|
|
|
|
name = "crystal-1.9-compatibility-1.patch";
|
|
|
|
url = "https://github.com/crystal-ameba/ameba/commit/d0d8b18c8365fd956d1e65ae6051e83a5e129f18.patch";
|
|
|
|
hash = "sha256-NmA3OoS5aOW+28TV/D/LUKEEu3lzHlcpolggHBB/wHE=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
# Ignore some failing lints on the Ameba codebase run during the check phase.
|
|
|
|
name = "crystal-1.9-compatibility-2.patch";
|
|
|
|
url = "https://github.com/crystal-ameba/ameba/commit/c9d25f3409e6a127bbd7188267810657a2c2924e.patch";
|
|
|
|
hash = "sha256-JMKiO0izSXfgw7uM9XXQ0r/ntOwRnjzYeVHqVLAvLXo=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
# Fixes test failures due to Crystal compiler error messages changing.
|
|
|
|
name = "crystal-1.9-compatibility-3.patch";
|
|
|
|
url = "https://github.com/crystal-ameba/ameba/commit/db59b23f9bfcf53dbe53d2918bd9c3d79ac24bb6.patch";
|
|
|
|
hash = "sha256-MKbEm9CR4+VzioCjcOFuFF0xnc1Ty0Ij4d3FcvQO6hY=";
|
|
|
|
})
|
2023-04-29 16:46:19 +00:00
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
format = "make";
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A static code analysis tool for Crystal";
|
|
|
|
homepage = "https://crystal-ameba.github.io";
|
2023-03-04 12:14:45 +00:00
|
|
|
changelog = "https://github.com/crystal-ameba/ameba/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ kimburgess ];
|
|
|
|
};
|
|
|
|
}
|