esphome: build dashboard from source

This commit is contained in:
Martin Weinelt 2024-07-17 15:05:27 +02:00
parent ff58909840
commit 32c08ba0ca
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759

View File

@ -1,19 +1,48 @@
{ lib
, buildPythonPackage
, fetchPypi
, fetchFromGitHub
, fetchNpmDeps
# build-system
, setuptools
, nodejs
, npmHooks
}:
buildPythonPackage rec {
pname = "esphome-dashboard";
version = "20240620.0";
format = "setuptools";
pyproject = true;
src = fetchPypi {
pname = "esphome_dashboard";
inherit version;
hash = "sha256-lx3i8Z2PUefyibCNiQ4zPEwfgXr6r/TVa9TBF0YE5fA=";
src = fetchFromGitHub {
owner = "esphome";
repo = "dashboard";
rev = "refs/tags/${version}";
hash = "sha256-LmIxfX3rcRK90h31J0B5T02f48MCctFERgXxf0zkDm0=";
};
npmDeps = fetchNpmDeps {
inherit src;
hash = "sha256-xMVESS1bPNJF07joUgY8ku+GWtflWhM8mYAv0emggc8=";
};
build-system = [ setuptools ];
nativeBuildInputs = [
nodejs
npmHooks.npmConfigHook
];
postPatch = ''
# https://github.com/esphome/dashboard/pull/639
patchShebangs script/build
'';
preBuild = ''
script/build
'';
# no tests
doCheck = false;