Skip to content

Instantly share code, notes, and snippets.

@fbmnds
Created August 18, 2019 20:21
Show Gist options
  • Select an option

  • Save fbmnds/5c504c57d173e4ee37b4f4f54447eefa to your computer and use it in GitHub Desktop.

Select an option

Save fbmnds/5c504c57d173e4ee37b4f4f54447eefa to your computer and use it in GitHub Desktop.
ESP8266_RTOS_SDK
{ stdenv, fetchurl, makeWrapper, buildFHSUserEnv }:
let
fhsEnv = buildFHSUserEnv {
name = "esp8266-toolchain-env";
targetPkgs = pkgs: with pkgs; [ zlib ];
runScript = "";
};
in
stdenv.mkDerivation rec {
name = "esp8266-toolchain";
version = "linux64-1.22.0-92-g8facf4c-5.2.0";
src = fetchurl {
url = "https://dl.espressif.com/dl/xtensa-lx106-elf-linux64-1.22.0-92-g8facf4c-5.2.0.tar.gz";
sha256 = "fd90ec6b067de5bef9004773475be9985b0bd7e325dd1f8eaf42fc579c4de633";
};
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/esp8266-toolchain-env $FILE_PATH --add-flags "$FILE_PATH-unwrapped"
fi
done
'';
meta = with stdenv.lib; {
description = "ESP8266 toolchain";
homepage = https://readthedocs.com/projects/espressif-esp8266-rtos-sdk;
license = licenses.apache2;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment