Commit af961e01 authored by Robert Schütz's avatar Robert Schütz
Browse files
parent 6079ac3b
Loading
Loading
Loading
Loading
+28 −4
Original line number Diff line number Diff line
{
  aiohttp,
  alive-progress,
  appdirs,
  appnope,
  black,
@@ -10,6 +11,7 @@
  coloredlogs,
  coverage,
  cryptography,
  debugpy,
  diskcache,
  fetchFromGitHub,
  fetchpatch,
@@ -40,6 +42,7 @@
  psutil,
  ptpython,
  pyelftools,
  pyfakefs,
  pygments,
  pykwalify,
  pylint,
@@ -47,6 +50,7 @@
  pyserial,
  python,
  python-daemon,
  python-path,
  pythonOlder,
  pyyaml,
  requests,
@@ -57,6 +61,7 @@
  sphinx-design,
  stdenv,
  stringcase,
  tabulate,
  toml,
  tornado,
  types-protobuf,
@@ -72,14 +77,14 @@

stdenv.mkDerivation rec {
  pname = "home-assistant-chip-wheels";
  version = "2025.4.0";
  version = "2025.7.0";
  src = fetchFromGitHub {
    owner = "home-assistant-libs";
    repo = "chip-wheels";
    tag = version;
    fetchSubmodules = false;
    leaveDotGit = true;
    hash = "sha256-20dqVXHPgSxBveTxlbHEjTtp9NI1oVCVpBTDbjDI2QA=";
    hash = "sha256-SfhsM2RPghFPx0qtoHsXVymwmOWFiEGAyLx6FeB++dg=";
    postFetch = ''
      cd $out
      # Download connectedhomeip.
@@ -115,6 +120,7 @@ stdenv.mkDerivation rec {
    click
    jinja2
    lark
    python-path
    setuptools
    stringcase
    build
@@ -140,6 +146,14 @@ stdenv.mkDerivation rec {
      extraPrefix = "connectedhomeip/third_party/pigweed/repo/";
      hash = "sha256-6ss3j8j69w7EMio9mFP/EL2oPqQ2sLh67eWsJjHdDa8=";
    })
    # fix `ModuleNotFoundError: No module named 'matter'`
    # https://github.com/project-chip/connectedhomeip/pull/39826
    (fetchpatch {
      url = "https://github.com/project-chip/connectedhomeip/commit/78c6a7e15658f66658eb9f780e1a0c0c176a67d7.patch";
      stripLen = 1;
      extraPrefix = "connectedhomeip/";
      hash = "sha256-s5t9DvmZVpnVelrN9+Ekn0OJl/VouXUGKCgu/PTLHBI=";
    })
  ];

  postPatch = ''
@@ -155,7 +169,7 @@ stdenv.mkDerivation rec {
    # unpin dependencies
    # there are many files to modify, in different formats
    sed -i 's/==.*$//' third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/virtualenv_setup/python_base_requirements.txt
    sed -i 's/==[^;]*//' scripts/setup/constraints.txt
    sed -i 's/==[^;]*//' scripts/setup/constraints.txt scripts/tests/requirements.txt
    sed -i 's/\(^ \+[a-zA-Z0-9-]*\)[=~><]=[^;]*/\1/' third_party/pigweed/repo/pw_protobuf_compiler/py/setup.cfg third_party/pigweed/repo/pw_protobuf/py/setup.cfg third_party/pigweed/repo/pw_protobuf_compiler/py/setup.cfg
    # remove a few dependencies not packaged in nixpkgs and which are apparently
    # not needed to build the python bindings of chip
@@ -166,6 +180,11 @@ stdenv.mkDerivation rec {

    # some code is generated by a templating tool (zap-cli)
    scripts/codepregen.py ./zzz_pregenerated/

    # `pip._internal.exceptions.InstallationError: ''${PW_PROJECT_ROOT}/scripts/py_matter_idl is not a valid editable requirement`
    substituteInPlace scripts/tests/requirements.txt \
      --replace-fail '-e ''${PW_PROJECT_ROOT}/scripts/py_matter_idl' "" \
      --replace-fail '-e ''${PW_PROJECT_ROOT}/scripts/py_matter_yamltests' ""
  '';

  # the python parts of the build system work as follows
@@ -188,6 +207,7 @@ stdenv.mkDerivation rec {
    let
      dependencies = [
        aiohttp
        alive-progress
        appdirs
        appnope
        black
@@ -197,6 +217,7 @@ stdenv.mkDerivation rec {
        coverage
        click
        cryptography
        debugpy
        diskcache
        googleapis-common-protos
        google-cloud-storage
@@ -217,13 +238,15 @@ stdenv.mkDerivation rec {
        protobuf
        psutil
        ptpython
        pyfakefs
        pyelftools
        pygments
        pykwalify
        (pylint.overridePythonAttrs { doCheck = pythonOlder "3.13"; })
        pylint
        pyperclip
        pyserial
        python-daemon
        python-path
        pyyaml
        requests
        setuptools
@@ -232,6 +255,7 @@ stdenv.mkDerivation rec {
        sphinx-argparse
        sphinx-design
        stringcase
        tabulate
        toml
        tornado
        types-protobuf