# Copyright 2018 Arnaud Lefebvre # Distributed under the terms of the GNU General Public License v2 require github [ user="npm" tag="v${PV}" ] SUMMARY="The semver parser for node (the one npm uses)" LICENCES="ISC" SLOT="0" PLATFORMS="~amd64 ~x86" MYOPTIONS="" DEPENDENCIES=" run: dev-lang/node[>=10] " src_unpack() { default esandbox disable_net # We need dependencies for tests to run edo cd "${WORK}" edo npm install esandbox enable_net } src_test() { edo npx template-oss-apply --force edo npm test # Clean up tests reports edo rm -r .nyc_output } src_install() { local node_modules=/usr/$(exhost --target)/lib/node_modules local target=/usr/$(exhost --target)/bin edo mkdir -p "${IMAGE}"/${node_modules} edo mkdir -p "${IMAGE}"/${target} edo rm -r "${WORKBASE}/${PNV}"/{.*,node_modules,test} edo mv "${WORKBASE}/${PNV}" "${IMAGE}"/${node_modules}/semver dosym ${node_modules}/semver/bin/semver.js ${target}/semver }