mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 15:22:59 +01:00
cbcf1d977b
https://github.com/evcc-io/evcc/releases/tag/0.123.7 https://github.com/evcc-io/evcc/releases/tag/0.123.6 https://github.com/evcc-io/evcc/releases/tag/0.123.5 https://github.com/evcc-io/evcc/releases/tag/0.123.4 https://github.com/evcc-io/evcc/releases/tag/0.123.3
104 lines
1.9 KiB
Nix
104 lines
1.9 KiB
Nix
{ lib
|
|
, buildGoModule
|
|
, fetchFromGitHub
|
|
, fetchNpmDeps
|
|
, fetchpatch
|
|
, cacert
|
|
, go
|
|
, git
|
|
, enumer
|
|
, mockgen
|
|
, nodejs
|
|
, npmHooks
|
|
, nix-update-script
|
|
, nixosTests
|
|
, stdenv
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "evcc";
|
|
version = "0.123.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "evcc-io";
|
|
repo = "evcc";
|
|
rev = version;
|
|
hash = "sha256-I8qcKrCuiUpDdsWDMiEZdo+PBkMELo5V6GW+nKFaD3Y=";
|
|
};
|
|
|
|
patches = [
|
|
(fetchpatch {
|
|
# https://github.com/evcc-io/evcc/pull/11547
|
|
name = "evcc-mockgen.patch";
|
|
url = "https://github.com/evcc-io/evcc/commit/5ec02a9dba79a733f71fc02a9552eb01e4e08f0b.patch";
|
|
hash = "sha256-uxKdtwdhUcMFCMkG756OD9aSMP9rdOL4Tg0HBWwp3kw=";
|
|
})
|
|
];
|
|
|
|
vendorHash = "sha256-FKF6+64mjrKgzFAb+O0QCURieOoRB//QNbpMFMcNG8s=";
|
|
|
|
npmDeps = fetchNpmDeps {
|
|
inherit src;
|
|
hash = "sha256-a3AyqQ8GYP3g9KGbjtLHjHBrJGHg2sNjAQlMUa26pOY=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
nodejs
|
|
npmHooks.npmConfigHook
|
|
];
|
|
|
|
overrideModAttrs = _: {
|
|
nativeBuildInputs = [
|
|
enumer
|
|
go
|
|
git
|
|
cacert
|
|
mockgen
|
|
];
|
|
|
|
inherit patches;
|
|
|
|
preBuild = ''
|
|
make assets
|
|
'';
|
|
};
|
|
|
|
tags = [
|
|
"release"
|
|
"test"
|
|
];
|
|
|
|
ldflags = [
|
|
"-X github.com/evcc-io/evcc/server.Version=${version}"
|
|
"-X github.com/evcc-io/evcc/server.Commit=${src.rev}"
|
|
"-s"
|
|
"-w"
|
|
];
|
|
|
|
preBuild = ''
|
|
make ui
|
|
'';
|
|
|
|
doCheck = !stdenv.isDarwin; # tries to bind to local network, doesn't work in darwin sandbox
|
|
|
|
preCheck = ''
|
|
# requires network access
|
|
rm meter/template_test.go
|
|
rm charger/template_test.go
|
|
'';
|
|
|
|
passthru = {
|
|
tests = {
|
|
inherit (nixosTests) evcc;
|
|
};
|
|
updateScript = nix-update-script { };
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "EV Charge Controller";
|
|
homepage = "https://evcc.io";
|
|
changelog = "https://github.com/evcc-io/evcc/releases/tag/${version}";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ hexa ];
|
|
};
|
|
}
|