logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

esbuild-0.20.1.ebuild (1682B)


  1. # Copyright 2023 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. EGO_PN="github.com/evanw/esbuild"
  5. DESCRIPTION="extremely fast bundler for the web"
  6. HOMEPAGE="https://esbuild.github.io/"
  7. SRC_URI="https://github.com/evanw/esbuild/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
  8. S="${WORKDIR}/src/${EGO_PN}"
  9. LICENSE="MIT"
  10. SLOT="0"
  11. KEYWORDS="~amd64"
  12. IUSE="test"
  13. DEPEND="
  14. >=dev-lang/go-1.13
  15. dev-go/sys
  16. test? (
  17. net-libs/nodejs
  18. dev-nodejs/source-map-js
  19. )
  20. "
  21. BDEPEND="sys-apps/help2man"
  22. RESTRICT="!test? ( test ) strip"
  23. QA_FLAGS_IGNORED='.*'
  24. src_unpack() {
  25. default
  26. mkdir -p "$(dirname "${S}")" || die
  27. mv "${WORKDIR}/${P}" "${S}" || die
  28. }
  29. src_prepare() {
  30. default
  31. # complex: Depends on fuse.js + react
  32. sed -i \
  33. -e "s;require('source-map');require('source-map-js');" \
  34. -e "/check('complex'/,/}),/d" \
  35. scripts/verify-source-map.js || die
  36. # No need to fetch dependencies via npm
  37. sed -i -e 's;cd scripts && npm ci;true;' Makefile || die
  38. }
  39. src_configure() {
  40. # disable module-aware mode
  41. export GO111MODULE=off
  42. # no network access
  43. export GOPROXY=off
  44. # don't try to update the toolchain
  45. export GOTOOLCHAIN="local"
  46. # With GO111MODULE=off WORKDIR needs to be included
  47. export GOPATH="${WORKDIR}:${EPREFIX}/usr/lib/go-gentoo"
  48. export EGO_BUILD_FLAGS="${EGO_BUILD_FLAGS} -trimpath"
  49. }
  50. src_test() {
  51. # test target wraps around test-common target with -j6
  52. emake test-common
  53. }
  54. src_install() {
  55. set -- env GOBIN="${ED}/usr/bin" go install -v -work -x ${EGO_BUILD_FLAGS} ./cmd/esbuild
  56. echo "$@"
  57. "$@" || die
  58. help2man -s1 -o esbuild.1 -N "${ED}/usr/bin/esbuild" || die
  59. doman esbuild.1
  60. }