Skip to content
Snippets Groups Projects
Commit bb804637 authored by q3k's avatar q3k
Browse files

nix: bump esp-idf to 4.4.5, stop depending on nixpkgs-esp-dev

parent b13cf5e0
No related branches found
No related tags found
No related merge requests found
Pipeline #5610 passed
# Based on https://github.com/mirrexagon/nixpkgs-esp-dev/
{ rev ? "v4.4.5"
, sha256 ? "sha256-Jz9cbTYoourYYNo873kLt4CQXbE704zc9Aeq9kbNdPU="
, stdenv
, python3Packages
, fetchFromGitHub
}:
let
src = fetchFromGitHub {
owner = "espressif";
repo = "esp-idf";
rev = rev;
sha256 = sha256;
fetchSubmodules = true;
};
in
stdenv.mkDerivation rec {
pname = "esp-idf";
version = rev;
inherit src;
# This is so that downstream derivations will have IDF_PATH set.
setupHook = ./setup-hook.sh;
propagatedBuildInputs = with python3Packages; [
setuptools click future pyelftools urllib3
jinja2 itsdangerous
(pyparsing.overrideAttrs (oa: rec {
version = "2.3.1";
src = fetchFromGitHub {
owner = "pyparsing";
repo = "pyparsing";
rev = "pyparsing_${version}";
hash = "sha256-m4mvPUXjDxz77rofg2Bop4/RnVTBDBNL6lRDd5zkpxM=";
};
}))
(kconfiglib.overrideAttrs (oa: rec {
version = "13.7.1";
src = fetchPypi {
inherit (oa) pname;
inherit version;
hash = "sha256-ou6PsGECRCxFllsFlpRPAsKhUX8JL6IIyjB/P9EqCiI=";
};
}))
(construct.overrideAttrs (oa: rec {
version = "2.10.54";
src = fetchFromGitHub {
owner = "construct";
repo = "construct";
rev = "v${version}";
hash = "sha256-iDAxm2Uf1dDA+y+9X/w+PKI36RPK/gDjXnG4Zay+Gtc=";
};
}))
((python-socketio.overrideAttrs (oa: rec {
version = "4.6.1";
src = fetchFromGitHub {
owner = "miguelgrinberg";
repo = "python-socketio";
rev = "v${version}";
hash = "sha256-hVNH0086mo17nPcCmVMkkCyuCkwo4nQv2ATtE56SsZE=";
};
disabledTests = [
"test_logger"
];
})).override {
python-engineio = python-engineio.overrideAttrs (oa: rec {
version = "3.14.2";
src = fetchFromGitHub {
owner = "miguelgrinberg";
repo = "python-engineio";
rev = "v${version}";
hash = "sha256-xJDlbxzy6HSQL1+1NQgFa3IjDg0t9n3NAHvZmX/cb+Q";
};
});
})
(pygdbmi.overrideAttrs (oa: rec {
version = "0.9.0.2";
src = fetchFromGitHub {
owner = "cs01";
repo = "pygdbmi";
rev = version;
hash = "sha256-bZQYcT5lA8xkG2YIK7P7fxkbVJhO6T5YpWo1EdLpOgY=";
};
}))
];
patches = [
# Can't be bothered to package gdbgui and idf-component-manager and we
# don't need them.
./fixup-requirements.patch
];
installPhase = ''
mkdir -p $out
cp -r * $out/
'';
}
diff --git a/requirements.txt b/requirements.txt
index 9769f8d933..c1126df3fb 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -17,12 +17,8 @@ cryptography>=2.1.4
pyparsing>=2.0.3,<2.4.0
pyelftools>=0.22
-idf-component-manager~=1.2
urllib3<2
-gdbgui==0.13.2.0; python_version < "3.11"
-# 0.13.2.1 supports Python 3.6+ only
-# Windows is not supported since 0.14.0.0. See https://github.com/cs01/gdbgui/issues/348
pygdbmi<=0.9.0.2; python_version < "3.11"
# The pygdbmi required max version 0.9.0.2 since 0.9.0.3 is not compatible with latest gdbgui (>=0.13.2.0)
# A compatible Socket.IO should be used. See https://github.com/miguelgrinberg/python-socketio/issues/578
# Export the necessary environment variables to use ESP-IDF.
addIdfEnvVars() {
# Crude way to detect if $1 is the ESP-IDF derivation.
if [ -e "$1/tools/idf.py" ]; then
export IDF_PATH="$1"
export IDF_COMPONENT_MANAGER=0
addToSearchPath PATH "$IDF_PATH/tools"
fi
}
addEnvHooks "$hostOffset" addIdfEnvVars
# Based on https://github.com/mirrexagon/nixpkgs-esp-dev/
{ version ? "2021r2-patch5"
, hash ? "sha256-iqF6at8B76WxYoyKxXgGOkTSaulYHTlIa5IiOkHvJi8="
, stdenv
, lib
, fetchurl
, makeWrapper
, buildFHSUserEnv
}:
let
fhsEnv = buildFHSUserEnv {
name = "esp32s3-toolchain-env";
targetPkgs = pkgs: with pkgs; [ zlib ];
runScript = "";
};
in
assert stdenv.system == "x86_64-linux";
stdenv.mkDerivation rec {
pname = "esp32s3-toolchain";
inherit version;
src = fetchurl {
url = "https://github.com/espressif/crosstool-NG/releases/download/esp-${version}/xtensa-esp32s3-elf-gcc8_4_0-esp-${version}-linux-amd64.tar.gz";
inherit hash;
};
buildInputs = [ makeWrapper ];
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''
cp -r . $out
for FILE in $(ls $out/bin); do
FILE_PATH="$out/bin/$FILE"
if [[ -x $FILE_PATH ]]; then
mv $FILE_PATH $FILE_PATH-unwrapped
makeWrapper ${fhsEnv}/bin/esp32s3-toolchain-env $FILE_PATH --add-flags "$FILE_PATH-unwrapped"
fi
done
'';
meta = with lib; {
description = "ESP32-S3 compiler toolchain";
homepage = "https://docs.espressif.com/projects/esp-idf/en/stable/get-started/linux-setup.html";
license = licenses.gpl3;
};
}
......@@ -10,17 +10,5 @@
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/c11d08f02390aab49e7c22e6d0ea9b176394d961.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs-esp-dev": {
"branch": "master",
"description": "Nix flake and overlay for ESP8266 and ESP32 development.",
"homepage": "",
"owner": "mirrexagon",
"repo": "nixpkgs-esp-dev",
"rev": "48413ee362b4d0709e1a0dff6aba7fd99060335e",
"sha256": "1n0m1nr39ngff6px9gdm9hkgzqq7imdcakpgz9md7fmm5c7b309f",
"type": "tarball",
"url": "https://github.com/mirrexagon/nixpkgs-esp-dev/archive/48413ee362b4d0709e1a0dff6aba7fd99060335e.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
File moved
# Based on https://github.com/mirrexagon/nixpkgs-esp-dev/
{ stdenv, lib, fetchurl, makeWrapper, buildFHSUserEnv }:
let
fhsEnv = buildFHSUserEnv {
name = "esp32-openocd-env";
targetPkgs = pkgs: with pkgs; [ zlib libusb1 ];
runScript = "";
};
in
stdenv.mkDerivation rec {
pname = "openocd";
version = "0.12.0-esp32-20230419";
src = fetchurl {
url = "https://github.com/espressif/openocd-esp32/releases/download/v${version}/openocd-esp32-linux-amd64-${version}.tar.gz";
hash = "sha256-UUTnUWzXWiFSs17K4KQA99PUQkwkiPusxJQzVk9Uxw0=";
};
buildInputs = [ makeWrapper ];
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''
cp -r . $out
for FILE in $(ls $out/bin); do
FILE_PATH="$out/bin/$FILE"
if [[ -x $FILE_PATH ]]; then
mv $FILE_PATH $FILE_PATH-unwrapped
makeWrapper ${fhsEnv}/bin/esp32-openocd-env $FILE_PATH --add-flags "$FILE_PATH-unwrapped"
fi
done
'';
meta = with lib; {
description = "ESP32 toolchain";
homepage = https://docs.espressif.com/projects/esp-idf/en/stable/get-started/linux-setup.html;
license = licenses.gpl3;
};
}
let
sources = import ./sources.nix;
sources = import ./niv/sources.nix;
nixpkgs = import sources.nixpkgs {
overlays = [
(import "${sources.nixpkgs-esp-dev}/overlay.nix")
(self: super: {
gcc-xtensa-esp32s3-elf-bin = super.callPackage ./esp32s3-toolchain-bin.nix {};
openocd-esp32-bin = super.callPackage ./openocd-esp32-bin.nix {};
esp-idf = super.callPackage ./esp-idf {};
})
];
};
in with nixpkgs; pkgs.mkShell {
name = "badg23-shell";
name = "flow3r-shell";
buildInputs = with pkgs; [
gcc-xtensa-esp32s3-elf-bin
openocd-esp32-bin
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment