diff --git a/flake.lock b/flake.lock index 2aeb087e..638fdb56 100644 --- a/flake.lock +++ b/flake.lock @@ -100,16 +100,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1696697597, - "narHash": "sha256-q26Qv4DQ+h6IeozF2o1secyQG0jt2VUT3V0K58jr3pg=", + "lastModified": 1710021367, + "narHash": "sha256-FuMVdWqXMT38u1lcySYyv93A7B8wU0EGzUr4t4jQu8g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5a237aecb57296f67276ac9ab296a41c23981f56", + "rev": "b94a96839afcc56de3551aa7472b8d9a3e77e05d", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-23.05", + "ref": "nixos-23.11", "type": "indirect" } }, diff --git a/flake.nix b/flake.nix index 9272a745..acdd133e 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "euphonium - Tiny audio platform"; inputs = { - nixpkgs.url = "nixpkgs/nixos-23.05"; + nixpkgs.url = "nixpkgs/nixos-23.11"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; gk-flasher = { diff --git a/nix/esp-idf.nix b/nix/esp-idf.nix index ae06409d..ad73b763 100644 --- a/nix/esp-idf.nix +++ b/nix/esp-idf.nix @@ -1,10 +1,4 @@ -{ stdenv -, lib -, fetchFromGitHub -, python310Packages -, pkgs -, -}: +{ stdenv, lib, fetchFromGitHub, python310Packages, pkgs, }: let idf-component-manager = python310Packages.buildPythonPackage rec { pname = "idf_component_manager"; @@ -74,9 +68,7 @@ let sha256 = "sha256-HD+QlAcHQgwlkKMn0LA24CoNux0IxpORKLYBfYb39JI="; }; doCheck = false; - propagatedBuildInputs = with python310Packages; [ - kconfiglib - ]; + propagatedBuildInputs = with python310Packages; [ kconfiglib ]; }; esp-idf-monitor = python310Packages.buildPythonPackage rec { pname = "esp-idf-monitor"; @@ -116,9 +108,7 @@ let sha256 = "sha256-OzthhzKGjyqDJrmJWs4LMkHz0rAwho+3Pyc2BYFK0EU="; }; doCheck = false; - propagatedBuildInputs = with python310Packages; [ - pyaml - ]; + propagatedBuildInputs = with python310Packages; [ pyaml ]; }; freertos-gdb = python310Packages.buildPythonPackage rec { pname = "freertos-gdb"; @@ -128,15 +118,26 @@ let sha256 = "sha256-o0ZoTy7OLVnrhSepya+MwaILgJSojs2hfmI86D9C3cs="; }; doCheck = false; - propagatedBuildInputs = with python310Packages; [ - setuptools - wheel - ]; + propagatedBuildInputs = with python310Packages; [ setuptools wheel ]; }; toolchain = pkgs.callPackage ./toolchain.nix { }; - idf-python-env = (pkgs.python310.withPackages (p: with p; [ pip idf-component-manager esptool esp-coredump esp-idf-monitor esp-idf-kconfig freertos-gdb p.protobuf grpcio-tools pyparsing esp-idf-size esp-idf-panic-decoder ])); -in -stdenv.mkDerivation rec { + idf-python-env = (pkgs.python310.withPackages (p: + with p; [ + pip + idf-component-manager + esptool + esp-coredump + esp-idf-monitor + esp-idf-kconfig + freertos-gdb + p.protobuf + grpcio-tools + pyparsing + esp-idf-size + esp-idf-panic-decoder + filelock + ])); +in stdenv.mkDerivation rec { pname = "esp-idf"; version = "5.1"; src = fetchFromGitHub { @@ -148,6 +149,8 @@ stdenv.mkDerivation rec { sha256 = "sha256-uEf3/3NPH+E39VgQ02AbxTG7nmG5bQlhwk/WcTeAUfg="; }; + patches = [ ./neutralize-python-dependency-checks.patch ]; + nativeBuildInputs = [ pkgs.makeWrapper ]; propagatedBuildInputs = with pkgs; [ @@ -164,6 +167,9 @@ stdenv.mkDerivation rec { runHook preUnpack mkdir sdk cp -r $src/* sdk + chmod -R +w sdk + # permits the patchPhase to modify the sources + # (for some reason cp makes them read-only, even though we are the owner of the files) runHook postUnpack ''; @@ -207,7 +213,7 @@ stdenv.mkDerivation rec { export PATH="${lib.makeBinPath propagatedBuildInputs}":$PATH ''; - phases = [ "unpackPhase" "preBuildPhase" "installPhase" ]; + phases = ["unpackPhase" "patchPhase" "preBuildPhase" "installPhase" ]; dontConfigure = true; diff --git a/nix/neutralize-python-dependency-checks.patch b/nix/neutralize-python-dependency-checks.patch new file mode 100644 index 00000000..c679b782 --- /dev/null +++ b/nix/neutralize-python-dependency-checks.patch @@ -0,0 +1,10 @@ +--- a/sdk/tools/check_python_dependencies.py ++++ b/sdk/tools/check_python_dependencies.py +@@ -142,6 +142,6 @@ if __name__ == '__main__': + if not idf_python_env_path or idf_python_env_path not in sys.executable: + print(' Warning: python interpreter not running from IDF_PYTHON_ENV_PATH') + print(' PATH: {}'.format(os.getenv('PATH'))) +- sys.exit(1) ++ # sys.exit(1) # neutralized not to break nix build + + print('Python requirements are satisfied.')