From 4989258ae1c2142bd293c5ff9114ffd3c9526ffa Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 24 Sep 2021 12:54:03 +0200 Subject: [PATCH] pkg: add support for Elk tiny JS engine --- pkg/Kconfig | 1 + pkg/elk/Kconfig | 11 +++++++++++ pkg/elk/Makefile | 13 +++++++++++++ pkg/elk/Makefile.dep | 5 +++++ pkg/elk/Makefile.include | 1 + pkg/elk/doc.txt | 11 +++++++++++ pkg/elk/elk.mk | 3 +++ 7 files changed, 45 insertions(+) create mode 100644 pkg/elk/Kconfig create mode 100644 pkg/elk/Makefile create mode 100644 pkg/elk/Makefile.dep create mode 100644 pkg/elk/Makefile.include create mode 100644 pkg/elk/doc.txt create mode 100644 pkg/elk/elk.mk diff --git a/pkg/Kconfig b/pkg/Kconfig index 31fd88cd76..50a70066d5 100644 --- a/pkg/Kconfig +++ b/pkg/Kconfig @@ -14,6 +14,7 @@ rsource "cn-cbor/Kconfig" rsource "driver_atwinc15x0/Kconfig" rsource "driver_bme680/Kconfig" rsource "driver_sx126x/Kconfig" +rsource "elk/Kconfig" rsource "emlearn/Kconfig" rsource "fff/Kconfig" rsource "gemmlowp/Kconfig" diff --git a/pkg/elk/Kconfig b/pkg/elk/Kconfig new file mode 100644 index 0000000000..e3b66e374c --- /dev/null +++ b/pkg/elk/Kconfig @@ -0,0 +1,11 @@ +# Copyright (c) 2021 Inria +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. + +config PACKAGE_ELK + bool "Elk: a tiny Javascript engine" + select MODULE_PRINTF_FLOAT + depends on !HAS_ARCH_AVR8 + depends on TEST_KCONFIG diff --git a/pkg/elk/Makefile b/pkg/elk/Makefile new file mode 100644 index 0000000000..d60bffc9f0 --- /dev/null +++ b/pkg/elk/Makefile @@ -0,0 +1,13 @@ +PKG_NAME=elk +PKG_URL=https://github.com/cesanta/elk +PKG_VERSION=1eab37bd9041d93a0bdfcd4335b2dcdba1076c67 # 2.1.0 +PKG_LICENSE=GPLv2 + +include $(RIOTBASE)/pkg/pkg.mk + +CFLAGS += -Wno-format-nonliteral +CFLAGS += -Wno-pedantic +CFLAGS += -Wno-unused-parameter + +all: + $(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR) -f $(CURDIR)/$(PKG_NAME).mk diff --git a/pkg/elk/Makefile.dep b/pkg/elk/Makefile.dep new file mode 100644 index 0000000000..fde06cda1f --- /dev/null +++ b/pkg/elk/Makefile.dep @@ -0,0 +1,5 @@ +# For numeric values, Elk uses float string formatting... +USEMODULE += printf_float + +# Blacklist AVR8 since printing float is not well supported on these platforms +FEATURES_BLACKLIST += arch_avr8 diff --git a/pkg/elk/Makefile.include b/pkg/elk/Makefile.include new file mode 100644 index 0000000000..72b4044786 --- /dev/null +++ b/pkg/elk/Makefile.include @@ -0,0 +1 @@ +INCLUDES += -I$(PKGDIRBASE)/elk diff --git a/pkg/elk/doc.txt b/pkg/elk/doc.txt new file mode 100644 index 0000000000..f168daec85 --- /dev/null +++ b/pkg/elk/doc.txt @@ -0,0 +1,11 @@ +/** + * @defgroup pkg_elk Elk: a tiny Javascript engine + * @ingroup pkg + * @brief Elk is a tiny embeddable JavaScript engine that implements a small but usable subset of ES6 + * + * # License + * + * Licensed under GPLv2 + Commercial + * + * @see https://github.com/cesanta/elk + */ diff --git a/pkg/elk/elk.mk b/pkg/elk/elk.mk new file mode 100644 index 0000000000..163eac7fde --- /dev/null +++ b/pkg/elk/elk.mk @@ -0,0 +1,3 @@ +MODULE = elk + +include $(RIOTBASE)/Makefile.base