From d671859642bde20e5681a3f4b4931aa0a0dd1222 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Tue, 6 Jul 2021 15:08:38 +0300 Subject: [PATCH] comms/py-esphome-flasher: add port --- comms/py-esphome-flasher/Makefile | 49 ++++++++++++++++++++++++++++++ comms/py-esphome-flasher/distinfo | 3 ++ comms/py-esphome-flasher/pkg-descr | 15 +++++++++ 3 files changed, 67 insertions(+) create mode 100644 comms/py-esphome-flasher/Makefile create mode 100644 comms/py-esphome-flasher/distinfo create mode 100644 comms/py-esphome-flasher/pkg-descr diff --git a/comms/py-esphome-flasher/Makefile b/comms/py-esphome-flasher/Makefile new file mode 100644 index 000000000000..3f0aae78b34d --- /dev/null +++ b/comms/py-esphome-flasher/Makefile @@ -0,0 +1,49 @@ +PORTNAME= esphome-flasher +DISTVERSIONPREFIX= v +DISTVERSION= 1.3.0 +CATEGORIES= comms python +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= rozhuk.im@gmail.com +COMMENT= Simple GUI tool to flash ESPs over USB + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +USE_GITHUB= yes +GH_ACCOUNT= esphome +USES= python +USE_PYTHON= autoplist distutils +USE_WX= 3.0+ +WX_COMPS= python:run +DESKTOP_ENTRIES="ESPHome-Flasher" "${COMMENT}" \ + "${PREFIX}/share/pixmaps/${PORTNAME}.ico" \ + "esphomeflasher" "" true +PLIST_FILES= ${PREFIX}/share/pixmaps/${PORTNAME}.ico + +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}esptool>=2.5.1:comms/py-esptool@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}requests>=2.24.0:www/py-requests@${PY_FLAVOR} + +post-patch: +.for __RUN_DEPEND in ${RUN_DEPENDS} + @${ECHO} -n "${__RUN_DEPEND:C/(.*)(>|<|==|>=|<=).*/\1/}: " + @${GREP} -E "^${__RUN_DEPEND:C/(.*)(>|<|==|>=|<=).*/\1/}(>|<|==|>=|<=)" \ + ${WRKSRC}/requirements.txt | \ + ${SED} -E "s/${__RUN_DEPEND:C/(.*)(>|<|==|>=|<=).*/\1/}(>|<|==|>=|<=)([.0-9]*)/\2/g" | \ + ${TR} -cd '[:print:]' + @${ECHO} " -> ${__RUN_DEPEND:C/.*(>|<|==|>=|<=)(.*)[:].*/\2/}" + + @${REINPLACE_CMD} -E \ + -e "s/(^|\")${__RUN_DEPEND:C/(.*)(>|<|==|>=|<=).*/\1/}(>|<|==|>=|<=)[.0-9]*/\1${__RUN_DEPEND:C/(.*)(>|<|==|>=|<=).*/\1/}>=${__RUN_DEPEND:C/.*(>|<|==|>=|<=)(.*)[:].*/\2/}/g" \ + ${WRKSRC}/setup.py \ + ${WRKSRC}/requirements.txt +.endfor +# Show all serial ports. + @${REINPLACE_CMD} -e 's| or "VID:PID" not in info||' \ + ${WRKSRC}/esphomeflasher/helpers.py + +post-install: + ${INSTALL_DATA} ${WRKSRC}/icon.ico \ + ${STAGEDIR}${PREFIX}/share/pixmaps/${PORTNAME}.ico + +.include diff --git a/comms/py-esphome-flasher/distinfo b/comms/py-esphome-flasher/distinfo new file mode 100644 index 000000000000..7033986dcdba --- /dev/null +++ b/comms/py-esphome-flasher/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1625568737 +SHA256 (esphome-esphome-flasher-v1.3.0_GH0.tar.gz) = cd27745508a4c7a585b202d0a44319b79178f07f9eba6e2120c56a5b85fdcb04 +SIZE (esphome-esphome-flasher-v1.3.0_GH0.tar.gz) = 75064 diff --git a/comms/py-esphome-flasher/pkg-descr b/comms/py-esphome-flasher/pkg-descr new file mode 100644 index 000000000000..1c91e3692705 --- /dev/null +++ b/comms/py-esphome-flasher/pkg-descr @@ -0,0 +1,15 @@ +ESPHome-Flasher is a utility app for the ESPHome framework and is +designed to make flashing ESPs with ESPHome as simple as possible by: +- Having pre-built binaries for most operating systems. +- Hiding all non-essential options for flashing. All necessary options + for flashing (bootloader, flash mode) are automatically extracted from + the binary. + +This project was originally intended to be a simple command-line tool, +but then I decided that a GUI would be nice. As I don't like writing +graphical front end code, the GUI largely is based on the NodeMCU +PyFlasher project. + +The flashing process is done using the esptool library by espressif. + +WWW: https://github.com/esphome/esphome-flasher