From 2bc8fb7b43a5106ab8cdf8adae4834837ae7fc16 Mon Sep 17 00:00:00 2001 From: Alexander Borisov Date: Wed, 23 Jan 2019 17:47:53 +0300 Subject: Node.js: fixed module version on installation from sources. --- auto/modules/nodejs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'auto/modules/nodejs') diff --git a/auto/modules/nodejs b/auto/modules/nodejs index e0208f5d..57bf9d3a 100644 --- a/auto/modules/nodejs +++ b/auto/modules/nodejs @@ -145,6 +145,8 @@ cat << END >> $NXT_MAKEFILE .PHONY: ${NXT_NODE}-build .PHONY: ${NXT_NODE}-publish +NXT_UNIT_VERSION=\$(shell grep 'define NXT_VERSION' \ + src/nxt_main.h | sed -e 's/^.*"\(.*\)".*/\1/') ${NXT_NODE}: ${NXT_NODE}-copy $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC ${NXT_NODE_EXPORTS} && \\ @@ -161,6 +163,9 @@ ${NXT_NODE_VERSION_FILE}: src/nxt_main.h | sed -e 's/[^0-9]//g' >> $NXT_NODE_VERSION_FILE ${NXT_NODE_TARBALL}: ${NXT_NODE}-copy + sed -e 's/"version"\s*:.*/"version": "\$(NXT_UNIT_VERSION).0",/' \ + ${NXT_NODE_TMP}/package.json > ${NXT_NODE_TMP}/package.json.tmp + mv ${NXT_NODE_TMP}/package.json.tmp ${NXT_NODE_TMP}/package.json tar -zcvf ${NXT_NODE_TARBALL} -C ${NXT_NODE_TMP} . -- cgit