You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.1 KiB

  1. # This is free software, licensed under the GNU General Public License v2.
  2. # See /LICENSE for more information.
  3. #
  4. include $(TOPDIR)/rules.mk
  5. PKG_NPM_NAME:=yarn
  6. PKG_NAME:=node-$(PKG_NPM_NAME)
  7. PKG_VERSION:=1.22.10
  8. PKG_RELEASE:=1
  9. PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
  10. PKG_SOURCE_URL:=https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
  11. PKG_HASH:=05a22fff30d7d8e8005bed277bf20d55111ba2bed65a6b91a0fcd1307b71fd8d
  12. PKG_MAINTAINER:=Hirokazu MORIKAWA <morikw2@gmail.com>, Patrik Laszlo <alabard@gmail.com>, Dobroslaw Kijowski <dobo90@gmail.com>
  13. PKG_LICENSE:=BSD-2-Clause
  14. PKG_LICENSE_FILES:=LICENSE
  15. PKG_HOST_ONLY:=1
  16. HOST_BUILD_DEPENDS:=node/host
  17. HOST_BUILD_PARALLEL:=1
  18. include $(INCLUDE_DIR)/host-build.mk
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/node-yarn
  21. SUBMENU:=Node.js
  22. SECTION:=lang
  23. CATEGORY:=Languages
  24. TITLE:=Fast, reliable, and secure dependency management
  25. URL:=https://yarnpkg.com/
  26. DEPENDS:=+node
  27. BUILDONLY:=1
  28. endef
  29. define Package/node-yarn/description
  30. Fast, reliable, and secure dependency management
  31. endef
  32. TAR_OPTIONS+= --strip-components 1
  33. TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
  34. HOSTTMPNPM:=$(shell mktemp -u XXXXXXXXXX)
  35. define Host/Compile
  36. $(HOST_MAKE_VARS) \
  37. npm_config_nodedir=$(STAGING_DIR)/usr/ \
  38. npm_config_prefix=$(HOST_INSTALL_DIR)/usr/ \
  39. npm_config_cache=$(TMP_DIR)/npm-cache-$(HOSTTMPNPM) \
  40. npm_config_tmp=$(TMP_DIR)/npm-tmp-$(HOSTTMPNPM) \
  41. npm install -g $(HOST_BUILD_DIR)
  42. rm -rf $(TMP_DIR)/npm-tmp-$(HOSTTMPNPM)
  43. rm -rf $(TMP_DIR)/npm-cache-$(HOSTTMPNPM)
  44. endef
  45. define Host/Install
  46. $(INSTALL_DIR) $(1)/lib/node_modules/$(PKG_NPM_NAME)
  47. $(CP) $(HOST_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{package.json,LICENSE} \
  48. $(1)/lib/node_modules/$(PKG_NPM_NAME)/
  49. $(CP) $(HOST_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/README.md \
  50. $(1)/lib/node_modules/$(PKG_NPM_NAME)/
  51. $(CP) $(HOST_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{bin,lib} \
  52. $(1)/lib/node_modules/$(PKG_NPM_NAME)/
  53. $(INSTALL_DIR) $(1)/bin
  54. $(LN) ../lib/node_modules/$(PKG_NPM_NAME)/bin/yarn.js $(1)/bin/yarn
  55. $(LN) ../lib/node_modules/$(PKG_NPM_NAME)/bin/yarn.js $(1)/bin/yarnpkg
  56. endef
  57. $(eval $(call HostBuild))
  58. $(eval $(call BuildPackage,node-yarn))