mirror of
https://github.com/openwrt/packages.git
synced 2025-02-12 00:00:55 +00:00
Automatically compute and substitute current values for all $(AUTORELEASE) instances as this feature is deprecated and shouldn't be used. The following temporary change was made to the core: diff --git a/rules.mk b/rules.mk index 57d7995d4fa8..f16367de87a8 100644 --- a/rules.mk +++ b/rules.mk @@ -429,7 +429,7 @@ endef abi_version_str = $(subst -,,$(subst _,,$(subst .,,$(1)))) COMMITCOUNT = $(if $(DUMP),0,$(call commitcount)) -AUTORELEASE = $(if $(DUMP),0,$(call commitcount,1)) +AUTORELEASE = $(if $(DUMP),0,$(shell sed -i "s/\$$(AUTORELEASE)/$(call commitcount,1)/" $(CURDIR)/Makefile)) all: FORCE: ; And this command used to fix affected packages: for i in $(cd feeds/packages; git grep -l PKG_RELEASE:=.*AUTORELEASE | \ sed 's^.*/\([^/]*\)/Makefile^\1^';); do make package/$i/download done Signed-off-by: Paul Fertser <fercerpav@gmail.com>
113 lines
3.7 KiB
Makefile
113 lines
3.7 KiB
Makefile
# This is free software, licensed under the GNU General Public License v2.
|
|
# See /LICENSE for more information.
|
|
#
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
PKG_NPM_NAME:=javascript-obfuscator
|
|
PKG_NAME:=node-$(PKG_NPM_NAME)
|
|
PKG_VERSION:=2.19.0
|
|
PKG_RELEASE:=3
|
|
|
|
PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
|
|
PKG_SOURCE_URL:=https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
|
|
PKG_HASH:=9bc89b04c78277130bc6f699563871d211f6fc85803c874f6114a632d9456f7b
|
|
|
|
PKG_BUILD_DEPENDS:=node/host
|
|
HOST_BUILD_PARALLEL:=1
|
|
|
|
HOST_BUILD_DEPENDS:=node/host
|
|
PKG_BUILD_PARALLEL:=1
|
|
PKG_BUILD_FLAGS:=no-mips16
|
|
|
|
PKG_MAINTAINER:=Zbynek Kocur <zbynek.kocur@fel.cvut.cz>
|
|
PKG_LICENSE:=BSD-2-Clause
|
|
PKG_LICENSE_FILES:=LICENSE.BSD
|
|
|
|
include $(INCLUDE_DIR)/host-build.mk
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
define Package/node-javascript-obfuscator
|
|
SUBMENU:=Node.js
|
|
SECTION:=lang
|
|
CATEGORY:=Languages
|
|
TITLE:=JavaScript obfuscator
|
|
URL:=https://www.npmjs.org/package/javascript-obfuscator
|
|
DEPENDS:=+node
|
|
endef
|
|
|
|
define Package/node-javascript-obfuscator/description
|
|
JavaScript obfuscator is a powerful free obfuscator for JavaScript with a wide number of features which provides protection for your source code.
|
|
endef
|
|
|
|
TAR_OPTIONS+= --strip-components 1
|
|
TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
|
|
|
|
NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
|
|
TMPNPM:=$(shell mktemp -u XXXXXXXXXX)
|
|
HOSTTMPNPM:=$(shell mktemp -u XXXXXXXXXX)
|
|
|
|
TARGET_CFLAGS+=$(FPIC)
|
|
TARGET_CPPFLAGS+=$(FPIC)
|
|
|
|
NPM_FLAGS=$(MAKE_VARS) \
|
|
$(MAKE_FLAGS) \
|
|
npm_config_arch=$(NODEJS_CPU) \
|
|
npm_config_target_arch=$(NODEJS_CPU) \
|
|
npm_config_build_from_source=true \
|
|
npm_config_nodedir=$(STAGING_DIR)/usr/ \
|
|
npm_config_prefix=$(PKG_INSTALL_DIR)/usr/ \
|
|
npm_config_cache=$(TMP_DIR)/npm-cache-$(TMPNPM) \
|
|
npm_config_tmp=$(TMP_DIR)/npm-tmp-$(TMPNPM)
|
|
|
|
define Build/Compile
|
|
cd $(PKG_BUILD_DIR); \
|
|
$(NPM_FLAGS) npm install --production --global-style --no-save --omit=dev --no-package-lock --ignore-scripts --legacy-peer-deps
|
|
rm -rf $(TMP_DIR)/npm-tmp-$(TMPNPM)
|
|
rm -rf $(TMP_DIR)/npm-cache-$(TMPNPM)
|
|
endef
|
|
|
|
define Package/node-javascript-obfuscator/install
|
|
$(INSTALL_DIR) $(1)/usr/lib/node/$(PKG_NPM_NAME)
|
|
$(CP) $(PKG_BUILD_DIR)/{package.json,LICENSE.BSD} \
|
|
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
|
|
$(CP) $(PKG_BUILD_DIR)/README.md \
|
|
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
|
|
$(CP) $(PKG_BUILD_DIR)/{node_modules,bin,dist} \
|
|
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
$(LN) ../lib/node/javascript-obfuscator/bin/javascript-obfuscator $(1)/usr/bin/javascript-obfuscator
|
|
endef
|
|
|
|
HOST_NPM_FLAGS=$(HOST_MAKE_VARS) \
|
|
$(HOST_MAKE_FLAGS) \
|
|
npm_config_arch=$(NODEJS_CPU) \
|
|
npm_config_target_arch=$(NODEJS_CPU) \
|
|
npm_config_build_from_source=true \
|
|
npm_config_nodedir=$(STAGING_DIR)/usr/ \
|
|
npm_config_prefix=$(HOST_INSTALL_DIR)/usr/ \
|
|
npm_config_cache=$(TMP_DIR)/npm-cache-$(HOSTTMPNPM) \
|
|
npm_config_tmp=$(TMP_DIR)/npm-tmp-$(HOSTTMPNPM)
|
|
|
|
define Host/Compile
|
|
cd $(HOST_BUILD_DIR); \
|
|
$(HOST_NPM_FLAGS) npm install --production --global-style --no-save --omit=dev --no-package-lock --ignore-scripts --legacy-peer-deps
|
|
rm -rf $(TMP_DIR)/npm-tmp-$(HOSTTMPNPM)
|
|
rm -rf $(TMP_DIR)/npm-cache-$(HOSTTMPNPM)
|
|
endef
|
|
|
|
define Host/Install
|
|
$(INSTALL_DIR) $(1)/lib/node_modules/$(PKG_NPM_NAME)
|
|
$(CP) $(HOST_BUILD_DIR)/{package.json,LICENSE.BSD} \
|
|
$(1)/lib/node_modules/$(PKG_NPM_NAME)/
|
|
$(CP) $(HOST_BUILD_DIR)/README.md \
|
|
$(1)/lib/node_modules/$(PKG_NPM_NAME)/
|
|
$(CP) $(HOST_BUILD_DIR)/{node_modules,bin,dist} \
|
|
$(1)/lib/node_modules/$(PKG_NPM_NAME)/
|
|
$(INSTALL_DIR) $(1)/bin
|
|
$(LN) ../lib/node_modules/javascript-obfuscator/bin/javascript-obfuscator $(1)/bin/javascript-obfuscator
|
|
endef
|
|
|
|
$(eval $(call HostBuild))
|
|
$(eval $(call BuildPackage,node-javascript-obfuscator))
|