From 51f6eeb5c6a31b4636c307e6ec51d50c1c570266 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Wed, 12 Aug 2020 16:40:07 +0800 Subject: [PATCH] duktape: use node.js tool to generate files --- package/ctcgfw/duktape/Makefile | 17 ++-- ...e-use-Node.js-tool-to-generate-files.patch | 89 +++++++++++++++++++ 2 files changed, 97 insertions(+), 9 deletions(-) create mode 100644 package/ctcgfw/duktape/patches/0001-Makefile-use-Node.js-tool-to-generate-files.patch diff --git a/package/ctcgfw/duktape/Makefile b/package/ctcgfw/duktape/Makefile index 135471c67a..8e2896db64 100644 --- a/package/ctcgfw/duktape/Makefile +++ b/package/ctcgfw/duktape/Makefile @@ -7,22 +7,22 @@ include $(TOPDIR)/rules.mk PKG_NAME:=duktape -PKG_VERSION:=2.99.99-65f1e02 +PKG_VERSION:=2.99.99-19cc8f5 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/svaarala/duktape.git -PKG_SOURCE_VERSION:=65f1e02e580796929e92e91ba4776d4b0131beb5 +PKG_SOURCE_VERSION:=19cc8f5bb855791ff55cbf60d2cea72df485e86f PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz -PKG_LICENSE:=GPLv3 +PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE PKG_MAINTAINER:=CN_SZTL PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) -PKG_BUILD_DEPENDS:=python2 +PKG_BUILD_DEPENDS:=node/host PKG_FIXUP:=autoreconf PKG_USE_MIPS16:=0 @@ -42,7 +42,6 @@ define Package/libduktape SECTION:=lib CATEGORY:=Libraries TITLE+= (Libraries) - VARIANT:=lib endef define Package/duktape/description @@ -58,9 +57,9 @@ endef define Build/Compile ( \ cd $(PKG_BUILD_DIR); \ - mkdir dist; \ - $(STAGING_DIR_HOSTPKG)/bin/pip2 install PyYAML; \ - $(STAGING_DIR_HOSTPKG)/bin/python2 util/dist.py; \ + make -C src-tools; \ + mkdir -p dist; \ + node src-tools/index.js dist --output-directory dist/source; \ cd dist/source/src; \ $(TARGET_CC) -c -O3 -o duktape.o duktape.c; \ $(TARGET_CC) -c -O3 -o duk_module_node.o -I. ../extras/module-node/duk_module_node.c; \ @@ -88,4 +87,4 @@ define Package/libduktape/install endef $(eval $(call BuildPackage,duktape)) -$(eval $(call BuildPackage,libduktape)) +$(eval $(call BuildPackage,libduktape)) \ No newline at end of file diff --git a/package/ctcgfw/duktape/patches/0001-Makefile-use-Node.js-tool-to-generate-files.patch b/package/ctcgfw/duktape/patches/0001-Makefile-use-Node.js-tool-to-generate-files.patch new file mode 100644 index 0000000000..a268dbd285 --- /dev/null +++ b/package/ctcgfw/duktape/patches/0001-Makefile-use-Node.js-tool-to-generate-files.patch @@ -0,0 +1,89 @@ +From 436c0a70d7fd4628f30b860f9f2f18f65982d72d Mon Sep 17 00:00:00 2001 +From: CN_SZTL +Date: Wed, 12 Aug 2020 08:31:27 +0000 +Subject: [PATCH] Makefile: use Node.js tool to generate files + +--- + Makefile | 34 +++++++++++++++++----------------- + 1 file changed, 17 insertions(+), 17 deletions(-) + +diff --git a/Makefile b/Makefile +index 92ec2110..9eba5234 100644 +--- a/Makefile ++++ b/Makefile +@@ -283,55 +283,55 @@ prep: + @mkdir -p prep + prep/nondebug: prep + @rm -rf ./prep/nondebug +- $(PYTHON) tools/configure.py --output-directory ./prep/nondebug --source-directory src-input --config-metadata config $(CONFIGOPTS_NONDEBUG) --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/nondebug --source-directory src-input --config-metadata config $(CONFIGOPTS_NONDEBUG) --line-directives + prep/nondebug-scanbuild: prep + @rm -rf ./prep/nondebug-scanbuild +- $(PYTHON) tools/configure.py --output-directory ./prep/nondebug-scanbuild --source-directory src-input --config-metadata config $(CONFIGOPTS_NONDEBUG_SCANBUILD) --separate-sources --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/nondebug-scanbuild --source-directory src-input --config-metadata config $(CONFIGOPTS_NONDEBUG_SCANBUILD) --separate-sources --line-directives + prep/nondebug-perf: prep + @rm -rf ./prep/nondebug-perf +- $(PYTHON) tools/configure.py --output-directory ./prep/nondebug-perf --source-directory src-input --config-metadata config $(CONFIGOPTS_NONDEBUG_PERF) --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/nondebug-perf --source-directory src-input --config-metadata config $(CONFIGOPTS_NONDEBUG_PERF) --line-directives + prep/nondebug-size: prep + @rm -rf ./prep/nondebug-size +- $(PYTHON) tools/configure.py --output-directory ./prep/nondebug-size --source-directory src-input --config-metadata config $(CONFIGOPTS_NONDEBUG_SIZE) --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/nondebug-size --source-directory src-input --config-metadata config $(CONFIGOPTS_NONDEBUG_SIZE) --line-directives + prep/nondebug-rom: prep + @rm -rf ./prep/nondebug-rom +- $(PYTHON) tools/configure.py --output-directory ./prep/nondebug-rom --source-directory src-input --config-metadata config $(CONFIGOPTS_NONDEBUG_ROM) --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/nondebug-rom --source-directory src-input --config-metadata config $(CONFIGOPTS_NONDEBUG_ROM) --line-directives + prep/debug: prep + @rm -rf ./prep/debug +- $(PYTHON) tools/configure.py --output-directory ./prep/debug --source-directory src-input --config-metadata config $(CONFIGOPTS_DEBUG) --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/debug --source-directory src-input --config-metadata config $(CONFIGOPTS_DEBUG) --line-directives + prep/fuzz: prep + @rm -rf ./prep/fuzz +- $(PYTHON) tools/configure.py --output-directory ./prep/fuzz --source-directory src-input --config-metadata config $(CONFIGOPTS_FUZZ) --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/fuzz --source-directory src-input --config-metadata config $(CONFIGOPTS_FUZZ) --line-directives + prep/debug-scanbuild: prep + @rm -rf ./prep/debug-scanbuild +- $(PYTHON) tools/configure.py --output-directory ./prep/debug-scanbuild --source-directory src-input --config-metadata config $(CONFIGOPTS_DEBUG_SCANBUILD) --separate-sources --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/debug-scanbuild --source-directory src-input --config-metadata config $(CONFIGOPTS_DEBUG_SCANBUILD) --separate-sources --line-directives + prep/debug-rom: prep + @rm -rf ./prep/debug-rom +- $(PYTHON) tools/configure.py --output-directory ./prep/debug-rom --source-directory src-input --config-metadata config $(CONFIGOPTS_DEBUG_ROM) --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/debug-rom --source-directory src-input --config-metadata config $(CONFIGOPTS_DEBUG_ROM) --line-directives + prep/emduk: prep + @rm -rf ./prep/emduk +- $(PYTHON) tools/configure.py --output-directory ./prep/emduk --source-directory src-input --config-metadata config $(CONFIGOPTS_EMDUK) --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/emduk --source-directory src-input --config-metadata config $(CONFIGOPTS_EMDUK) --line-directives + prep/dukweb: prep + @rm -rf ./prep/dukweb +- $(PYTHON) tools/configure.py --output-directory ./prep/dukweb --source-directory src-input --config-metadata config $(CONFIGOPTS_DUKWEB) --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/dukweb --source-directory src-input --config-metadata config $(CONFIGOPTS_DUKWEB) --line-directives + prep/duklow-nondebug: prep + @rm -rf ./prep/duklow-nondebug +- $(PYTHON) tools/configure.py --output-directory ./prep/duklow-nondebug --source-directory src-input --config-metadata config $(CONFIGOPTS_NONDEBUG_DUKLOW) --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/duklow-nondebug --source-directory src-input --config-metadata config $(CONFIGOPTS_NONDEBUG_DUKLOW) --line-directives + prep/duklow-debug: prep + @rm -rf ./prep/duklow-debug +- $(PYTHON) tools/configure.py --output-directory ./prep/duklow-debug --source-directory src-input --config-metadata config $(CONFIGOPTS_DEBUG_DUKLOW) --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/duklow-debug --source-directory src-input --config-metadata config $(CONFIGOPTS_DEBUG_DUKLOW) --line-directives + prep/duklow-nondebug-rom: prep + @rm -rf ./prep/duklow-nondebug-rom +- $(PYTHON) tools/configure.py --output-directory ./prep/duklow-nondebug-rom --source-directory src-input --config-metadata config $(CONFIGOPTS_NONDEBUG_DUKLOW_ROM) --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/duklow-nondebug-rom --source-directory src-input --config-metadata config $(CONFIGOPTS_NONDEBUG_DUKLOW_ROM) --line-directives + prep/duklow-debug-rom: prep + @rm -rf ./prep/duklow-debug-rom +- $(PYTHON) tools/configure.py --output-directory ./prep/duklow-debug-rom --source-directory src-input --config-metadata config $(CONFIGOPTS_DEBUG_DUKLOW_ROM) --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/duklow-debug-rom --source-directory src-input --config-metadata config $(CONFIGOPTS_DEBUG_DUKLOW_ROM) --line-directives + prep/duklow-nondebug-norefc: prep + @rm -rf ./prep/duklow-nondebug-norefc +- $(PYTHON) tools/configure.py --output-directory ./prep/duklow-nondebug-norefc --source-directory src-input --config-metadata config $(CONFIGOPTS_NONDEBUG_DUKLOW_NOREFC) --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/duklow-nondebug-norefc --source-directory src-input --config-metadata config $(CONFIGOPTS_NONDEBUG_DUKLOW_NOREFC) --line-directives + prep/duklow-debug-norefc: prep + @rm -rf ./prep/duklow-debug-norefc +- $(PYTHON) tools/configure.py --output-directory ./prep/duklow-debug-norefc --source-directory src-input --config-metadata config $(CONFIGOPTS_DEBUG_DUKLOW_NOREFC) --line-directives ++ $(NODE) src-tools/index.js configure --output-directory ./prep/duklow-debug-norefc --source-directory src-input --config-metadata config $(CONFIGOPTS_DEBUG_DUKLOW_NOREFC) --line-directives + + # Library targets. + build/libduktape.so.1.0.0: prep/nondebug | build +-- +2.17.1 +