diff --git a/overlay.nix b/overlay.nix index 762175f..0252b12 100644 --- a/overlay.nix +++ b/overlay.nix @@ -4,7 +4,7 @@ rec { esp-idf-esp32 = esp-idf-full.override { toolsToInclude = [ - "xtensa-esp32-elf" + "xtensa-esp-elf" "esp32ulp-elf" "openocd-esp32" "xtensa-esp-elf-gdb" @@ -23,7 +23,7 @@ rec { esp-idf-esp32s2 = esp-idf-full.override { toolsToInclude = [ - "xtensa-esp32s2-elf" + "xtensa-esp-elf" "esp32ulp-elf" "openocd-esp32" "xtensa-esp-elf-gdb" @@ -32,7 +32,7 @@ rec { esp-idf-esp32s3 = esp-idf-full.override { toolsToInclude = [ - "xtensa-esp32s3-elf" + "xtensa-esp-elf" "esp32ulp-elf" "openocd-esp32" "xtensa-esp-elf-gdb" diff --git a/pkgs/esp-idf/default.nix b/pkgs/esp-idf/default.nix index 9ad01a0..8117d1e 100644 --- a/pkgs/esp-idf/default.nix +++ b/pkgs/esp-idf/default.nix @@ -1,11 +1,9 @@ -{ rev ? "v5.1.3" -, sha256 ? "sha256-0QsIFOcSx1N15t5po3TyOaNvpzBUfKaFdsRODOBoXCI=" +{ rev ? "v5.2.2" +, sha256 ? "sha256-I4YxxSGdQT8twkoFx3zmZhyLTSagmeLD2pygVfY/pEk=" , toolsToInclude ? [ "xtensa-esp-elf-gdb" "riscv32-esp-elf-gdb" - "xtensa-esp32-elf" - "xtensa-esp32s2-elf" - "xtensa-esp32s3-elf" + "xtensa-esp-elf" "esp-clang" "riscv32-esp-elf" "esp32ulp-elf" @@ -40,6 +38,7 @@ let rev = rev; sha256 = sha256; fetchSubmodules = true; + leaveDotGit = true; }; allTools = callPackage (import ./tools.nix) { @@ -73,6 +72,7 @@ let esp-idf-monitor esp-idf-size esp-idf-panic-decoder + pyclang freertos_gdb @@ -91,10 +91,6 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; - # Do not preserve file modes when copying templates as the nix store is read-only. - # create-project will fail without this. - patches = [ ./template-modes.patch ]; - propagatedBuildInputs = [ # This is in propagatedBuildInputs so that downstream derivations will run # the Python setup hook and get PYTHONPATH set up correctly. @@ -136,5 +132,7 @@ stdenv.mkDerivation rec { # directory to PYTHONPATH. ln -s ${customPython} $out/python-env ln -s ${customPython}/lib $out/lib - ''; + + echo "5.2.2-joakim" > $out/version.txt + ''; } diff --git a/pkgs/esp-idf/python-packages.nix b/pkgs/esp-idf/python-packages.nix index a924c8b..decb847 100644 --- a/pkgs/esp-idf/python-packages.nix +++ b/pkgs/esp-idf/python-packages.nix @@ -1,6 +1,6 @@ # Versions based on -# https://dl.espressif.com/dl/esp-idf/espidf.constraints.v5.1.txt -# on 2023-07-05. +# https://dl.espressif.com/dl/esp-idf/espidf.constraints.v5.2.txt +# on 2024-02-20. { stdenv , lib @@ -169,6 +169,22 @@ rec { }; }; + pyclang = buildPythonPackage rec { + pname = "pyclang"; + version = "0.4.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-vuDZ5yEhyDpCmkXoC+Gr2X5vMK5B46HnktcvBONjxXM="; + }; + + doCheck = false; + + meta = { + homepage = "https://pypi.org/project/pyclang/"; + }; + }; + freertos_gdb = buildPythonPackage rec { pname = "freertos-gdb"; version = "1.0.2"; @@ -210,5 +226,6 @@ rec { homepage = "https://github.com/espressif/esp-idf-panic-decoder"; }; }; + } diff --git a/pkgs/esp-idf/template-modes.patch b/pkgs/esp-idf/template-modes.patch deleted file mode 100644 index 99c6cb8..0000000 --- a/pkgs/esp-idf/template-modes.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/tools/idf_py_actions/create_ext.py b/tools/idf_py_actions/create_ext.py -index 6a3e632485..3e9e33bb2b 100644 ---- a/tools/idf_py_actions/create_ext.py -+++ b/tools/idf_py_actions/create_ext.py -@@ -40,7 +40,7 @@ def is_empty_and_create(path: str, action: str) -> None: - - - def create_project(target_path: str, name: str) -> None: -- copy_tree(os.path.join(os.environ['IDF_PATH'], 'examples', 'get-started', 'sample_project'), target_path) -+ copy_tree(os.path.join(os.environ['IDF_PATH'], 'examples', 'get-started', 'sample_project'), target_path, preserve_mode=0) - main_folder = os.path.join(target_path, 'main') - os.rename(os.path.join(main_folder, 'main.c'), os.path.join(main_folder, '.'.join((name, 'c')))) - replace_in_file(os.path.join(main_folder, 'CMakeLists.txt'), 'main', name) -@@ -49,7 +49,7 @@ def create_project(target_path: str, name: str) -> None: - - - def create_component(target_path: str, name: str) -> None: -- copy_tree(os.path.join(os.environ['IDF_PATH'], 'tools', 'templates', 'sample_component'), target_path) -+ copy_tree(os.path.join(os.environ['IDF_PATH'], 'tools', 'templates', 'sample_component'), target_path, preserve_mode=0) - os.rename(os.path.join(target_path, 'main.c'), os.path.join(target_path, '.'.join((name, 'c')))) - os.rename(os.path.join(target_path, 'include', 'main.h'), - os.path.join(target_path, 'include', '.'.join((name, 'h')))) diff --git a/pkgs/esp-idf/tools.nix b/pkgs/esp-idf/tools.nix index 879f20b..349bff6 100644 --- a/pkgs/esp-idf/tools.nix +++ b/pkgs/esp-idf/tools.nix @@ -18,9 +18,7 @@ let toolFhsEnvTargetPackages = { xtensa-esp-elf-gdb = pkgs: (with pkgs; [ ]); riscv32-esp-elf-gdb = pkgs: (with pkgs; [ ]); - xtensa-esp32-elf = pkgs: (with pkgs; [ ]); - xtensa-esp32s2-elf = pkgs: (with pkgs; [ ]); - xtensa-esp32s3-elf = pkgs: (with pkgs; [ ]); + xtensa-esp-elf = pkgs: (with pkgs; [ ]); esp-clang = pkgs: (with pkgs; [ zlib libxml2 ]); riscv32-esp-elf = pkgs: (with pkgs; [ ]); esp32ulp-elf = pkgs: (with pkgs; [ ]); @@ -92,8 +90,10 @@ let installPhase = let wrapCmd = if (system == "x86_64-linux") || (system == "aarch64-linux") then '' - mv $FILE_PATH $FILE_PATH-unwrapped - makeWrapper ${fhsEnv}/bin/${pname}-env $FILE_PATH --add-flags "$FILE_PATH-unwrapped" ${lib.strings.concatStringsSep " " exportVarsWrapperArgsList} + [ ! -d $out/unwrapped_bin ] && mkdir $out/unwrapped_bin + WRAPPED_FILE_PATH="$out/unwrapped_bin/$(basename $FILE_PATH)" + mv $FILE_PATH $WRAPPED_FILE_PATH + makeWrapper ${fhsEnv}/bin/${pname}-env $FILE_PATH --add-flags $WRAPPED_FILE_PATH ${lib.strings.concatStringsSep " " exportVarsWrapperArgsList} '' else ''wrapProgram $FILE_PATH ${lib.strings.concatStringsSep " " exportVarsWrapperArgsList}'';