mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-11 16:23:26 +00:00
31e60c2fbb
Builder to package up custom components for Home Assistant. These packages use `buildPythonPackage` with `format = "other"` and rely on a custom install phase, that expects a standardized path, and a custom check phase, that for now verifies python dependencies have been satisified. Co-Authored-By: Martin Weinelt <hexa@darmstadt.ccc.de> Co-Authored-By: Sandro Jäckel <sandro.jaeckel@gmail.com>
26 lines
733 B
Bash
26 lines
733 B
Bash
# Setup hook to check HA manifest requirements
|
|
echo "Sourcing manifest-requirements-check-hook"
|
|
|
|
function manifestCheckPhase() {
|
|
echo "Executing manifestCheckPhase"
|
|
runHook preCheck
|
|
|
|
manifests=$(shopt -s nullglob; echo $out/custom_components/*/manifest.json)
|
|
|
|
if [ ! -z "$manifests" ]; then
|
|
echo Checking manifests $manifests
|
|
@pythonCheckInterpreter@ @checkManifest@ $manifests
|
|
else
|
|
echo "No custom component manifests found in $out" >&2
|
|
exit 1
|
|
fi
|
|
|
|
runHook postCheck
|
|
echo "Finished executing manifestCheckPhase"
|
|
}
|
|
|
|
if [ -z "${dontCheckManifest-}" ] && [ -z "${installCheckPhase-}" ]; then
|
|
echo "Using manifestCheckPhase"
|
|
preDistPhases+=" manifestCheckPhase"
|
|
fi
|