1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 03:30:45 +00:00

elvis: init at 1.0.1

This commit is contained in:
David 2021-07-04 19:41:33 +02:00 committed by Raphael Megzari
parent 79b7bd36a3
commit 53072cc066
4 changed files with 216 additions and 1 deletions

View file

@ -39,6 +39,7 @@ let
erlang-ls = callPackage ./erlang-ls { };
erlfmt = callPackage ./erlfmt { };
elvis-erlang = callPackage ./elvis-erlang { };
# BEAM-based languages.
elixir = elixir_1_12;

View file

@ -0,0 +1,46 @@
{ fetchFromGitHub, fetchgit, fetchHex, rebar3WithPlugins, rebar3-nix, rebar3Relx
, buildRebar3, writeScript, lib }:
let
owner = "inaka";
repo = "elvis";
in rebar3Relx rec {
releaseType = "escript";
# The package name "elvis" is already taken
pname = "elvis-erlang";
version = "1.0.1";
src = fetchFromGitHub {
inherit owner repo;
sha256 = "139mgd4cwc0vazxfnssyym61jd9g45wn1nc53mjfzx5dkrrn4dc5";
rev = version;
};
beamDeps = builtins.attrValues (import ./rebar-deps.nix {
inherit fetchHex fetchgit fetchFromGitHub;
builder = buildRebar3;
});
passthru.updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash common-updater-scripts git nix-prefetch-git gnutar gzip "rebar3WithPlugins {globalPlugins = [beamPackages.rebar3-nix];}"
set -euo pipefail
latest=$(list-git-tags https://github.com/${owner}/${repo}.git | sort -V | tail -1)
if [ "$latest" != "${version}" ]; then
nixpkgs="$(git rev-parse --show-toplevel)"
nix_path="$nixpkgs/pkgs/development/beam-modules/elvis-erlang"
update-source-version elvis-erlang "$latest" --version-key=version --print-changes --file="$nix_path/default.nix"
tmpdir=$(mktemp -d)
cp -R $(nix-build $nixpkgs --no-out-link -A elvis-erlang.src)/* "$tmpdir"
(cd "$tmpdir" && HOME=. rebar3 nix lock -o "$nix_path/rebar-deps.nix")
else
echo "${repo} is already up-to-date"
fi
'';
meta = with lib; {
homepage = "https://github.com/inaka/elvis";
description = "Erlang Style Reviewer";
platforms = platforms.unix;
license = licenses.asl20;
maintainers = with lib.maintainers; [ dlesl ];
};
}

View file

@ -0,0 +1,168 @@
# Generated by rebar3_nix
let fetchOnly = { src, ... }: src;
in { builder ? fetchOnly, fetchHex, fetchgit, fetchFromGitHub, overrides ? (x: y: { }) }:
let
self = packages // (overrides self packages);
packages = with self; {
unicode_util_compat = builder {
name = "unicode_util_compat";
version = "0.7.0";
src = fetchHex {
pkg = "unicode_util_compat";
version = "0.7.0";
sha256 = "sha256-Je7m1n32GWDPanlCOVZlmbCeF+Zo03ACR7xJhjgVJSE=";
};
beamDeps = [ ];
};
ssl_verify_fun = builder {
name = "ssl_verify_fun";
version = "1.1.6";
src = fetchHex {
pkg = "ssl_verify_fun";
version = "1.1.6";
sha256 = "sha256-vbDSRx9FPIj/OQjnaG+G+b4yfQZcwewW+kVAGX6gRoA=";
};
beamDeps = [ ];
};
parse_trans = builder {
name = "parse_trans";
version = "3.4.0";
src = fetchHex {
pkg = "parse_trans";
version = "3.4.0";
sha256 = "sha256-+Z42iDC+pEVSIk434ElDpUh08IuFkEhd6NE4MrY6LcM=";
};
beamDeps = [ ];
};
mimerl = builder {
name = "mimerl";
version = "1.2.0";
src = fetchHex {
pkg = "mimerl";
version = "1.2.0";
sha256 = "sha256-8nhYVlCqWBmGJkY46/aY+LsZ3yl/Zq2RsYkQ38bhkyM=";
};
beamDeps = [ ];
};
metrics = builder {
name = "metrics";
version = "1.0.1";
src = fetchHex {
pkg = "metrics";
version = "1.0.1";
sha256 = "sha256-abCa3dxPdKQHFq5U0UD5O+sPuJeNhjbq3tDDG28JnxY=";
};
beamDeps = [ ];
};
idna = builder {
name = "idna";
version = "6.1.1";
src = fetchHex {
pkg = "idna";
version = "6.1.1";
sha256 = "sha256-kjdut4lEEu0ZrEdeSob3tBPBufu1vRbczVeTQVeUTOo=";
};
beamDeps = [ unicode_util_compat ];
};
certifi = builder {
name = "certifi";
version = "2.6.1";
src = fetchHex {
pkg = "certifi";
version = "2.6.1";
sha256 = "sha256-UkyXtJkbOEndXBemMSI4licsawr0RneLpGdaHf9Tu34=";
};
beamDeps = [ ];
};
zipper = builder {
name = "zipper";
version = "1.0.1";
src = fetchHex {
pkg = "zipper";
version = "1.0.1";
sha256 = "sha256-ah/T4fDMHR31ZCyaDOIXgDZBGwpclkKFHR2idr1zfC0=";
};
beamDeps = [ ];
};
lager = builder {
name = "lager";
version = "3.9.1";
src = fetchHex {
pkg = "lager";
version = "3.9.1";
sha256 = "sha256-P1m6daBKmeXxi/kcifRtzlNvg8bLQV/ibm51pivvN9w=";
};
beamDeps = [ goldrush ];
};
katana_code = builder {
name = "katana_code";
version = "1.1.2";
src = fetchHex {
pkg = "katana_code";
version = "1.1.2";
sha256 = "sha256-5+YWKkToJqA/aLUDt9kpgbiUv4NMHvDmR3g/fWaIAhw=";
};
beamDeps = [ ];
};
jsx = builder {
name = "jsx";
version = "2.10.0";
src = fetchHex {
pkg = "jsx";
version = "2.10.0";
sha256 = "sha256-moPjcEgHKYAWlo21Bvn60PAn3jdUbrg4s64QZMOgrWI=";
};
beamDeps = [ ];
};
hackney = builder {
name = "hackney";
version = "1.17.1";
src = fetchHex {
pkg = "hackney";
version = "1.17.1";
sha256 = "sha256-0sup48gQOtAyBiPp8cM+jTeKFeqr4u6K5EGJjz01oYw=";
};
beamDeps = [ certifi idna metrics mimerl parse_trans ssl_verify_fun unicode_util_compat ];
};
goldrush = builder {
name = "goldrush";
version = "0.1.9";
src = fetchHex {
pkg = "goldrush";
version = "0.1.9";
sha256 = "sha256-mctBKM/8syJ1geXU2APVQT+mQ/TrllI/d9nmk32ZTOs=";
};
beamDeps = [ ];
};
getopt = builder {
name = "getopt";
version = "1.0.2";
src = fetchHex {
pkg = "getopt";
version = "1.0.2";
sha256 = "sha256-oAKa6kMi+4KmH2h2ptnGbcmHi2y2H6oT3zGHOE/U6iY=";
};
beamDeps = [ ];
};
elvis_core = builder {
name = "elvis_core";
version = "1.1.2";
src = fetchHex {
pkg = "elvis_core";
version = "1.1.2";
sha256 = "sha256-xO5Cp6fC/FZ/Pqa1FQFkzWgpDxEA6bGaTPiG2Kocpzw=";
};
beamDeps = [ katana_code zipper ];
};
egithub = builder {
name = "egithub";
version = "0.7.0";
src = fetchHex {
pkg = "egithub";
version = "0.7.0";
sha256 = "sha256-4AnOEe/YAI0PntWdnEiOPpq+MCoPLNbWY+TMJnVvzEw=";
};
beamDeps = [ goldrush hackney jsx lager ];
};
};
in self

View file

@ -12343,7 +12343,7 @@ in
erlang_nox = beam_nox.interpreters.erlang;
inherit (beam.packages.erlang)
erlang-ls erlfmt
erlang-ls erlfmt elvis-erlang
rebar rebar3 rebar3WithPlugins
fetchHex beamPackages;