From 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf Mon Sep 17 00:00:00 2001 From: takeshi_hoshina Date: Mon, 2 Nov 2020 11:07:33 +0900 Subject: basesystem-jj recipes --- .../iothub-explorer/node-iothub-explorer_1.1.19.bb | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 external/meta-iot-cloud/recipes-azure/iothub-explorer/node-iothub-explorer_1.1.19.bb (limited to 'external/meta-iot-cloud/recipes-azure/iothub-explorer/node-iothub-explorer_1.1.19.bb') diff --git a/external/meta-iot-cloud/recipes-azure/iothub-explorer/node-iothub-explorer_1.1.19.bb b/external/meta-iot-cloud/recipes-azure/iothub-explorer/node-iothub-explorer_1.1.19.bb new file mode 100644 index 00000000..25950a96 --- /dev/null +++ b/external/meta-iot-cloud/recipes-azure/iothub-explorer/node-iothub-explorer_1.1.19.bb @@ -0,0 +1,73 @@ +DESCRIPTION = "IoT Hub Explorer is a tool that allows you to explore and test Azure IoT Hub features" +AUTHOR = "Microsoft Corporation" +HOMEPAGE = "https://github.com/Azure/iothub-explorer" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=0296d24e582db92fa4e33fd40e18099a" + +DEPENDS = "nodejs-native" +RDEPENDS_${PN} = "bash nodejs" + +PR = "r0" + +PACKAGES = "\ + ${PN} \ +" + +SRC_URI = "git://github.com/Azure/iothub-explorer.git" +SRCREV = "8b232a22e3b67efa17897d9ee66856e77f78a8c3" + +S = "${WORKDIR}/git" + +def get_nodejs_arch(d): + target_arch = d.getVar('TRANSLATED_TARGET_ARCH', True) + + if target_arch == "x86-64": + target_arch = "x64" + elif target_arch == "aarch64": + target_arch = "arm64" + elif target_arch == "powerpc": + target_arch = "ppc" + elif target_arch == "powerpc64": + target_arch = "ppc64" + elif (target_arch == "i486" or target_arch == "i586" or target_arch == "i686"): + target_arch = "ia32" + + return target_arch + +NODE_MODULES_DIR = "${prefix}/lib/node_modules/" +NPM_CACHE_DIR ?= "${WORKDIR}/npm_cache" +NPM_REGISTRY ?= "http://registry.npmjs.org/" +NPM_ARCH = "${@get_nodejs_arch(d)}" +NPM_INSTALL_FLAGS ?= "--production --without-ssl --insecure --no-optional --verbose" + +SRC_NAME = "iothub-explorer" + +do_compile() { + export NPM_CONFIG_CACHE="${NPM_CACHE_DIR}" + + npm cache clear --force + npm --registry=${NPM_REGISTRY} --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} ${NPM_INSTALL_FLAGS} install + npm prune --production + + # FIXME: This is only required until the xml2js dependency is update in the azure-storage package + find ${S} -type f -name "switch-bench.js" -exec rm -f {} \; +} + +do_install() { + install -d ${D}${NODE_MODULES_DIR}/${SRC_NAME} + cp -r ${S}/* ${D}${NODE_MODULES_DIR}/${SRC_NAME} + + # Set permissions + chmod 0755 ${D}${NODE_MODULES_DIR}${SRC_NAME}/${SRC_NAME}.js + + # Symlinks + install -d ${D}${bindir} + ln -s ${NODE_MODULES_DIR}${SRC_NAME}/${SRC_NAME}.js ${D}${bindir}/${SRC_NAME} +} + +FILES_${PN} += "\ + ${NODE_MODULES_DIR}${SRC_NAME} \ + ${bindir} \ +" + +INHIBIT_PACKAGE_DEBUG_SPLIT_${PN} = "1" -- cgit 1.2.3-korg