logo

overlay

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

esbuild-0.25.9.ebuild (1953B)


  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[npm]
  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. # [issue-4080] Cannot read properties of null (reading 'source')
  33. sed -i \
  34. -e "s;require('source-map');require('source-map-js');" \
  35. -e "/check('complex'/,/}),/d" \
  36. -e "/check('issue-4080'/,/}),/d" \
  37. scripts/verify-source-map.js || die
  38. # npm ci: No need to fetch dependencies via npm
  39. # git diff: Not a dev repo
  40. # node-unref-tests: Requires (127.0.0.1) networking
  41. sed -i \
  42. -e 's;cd scripts && npm ci;true;' \
  43. -e '/git diff/d' \
  44. -e '/^test-common:/s;node-unref-tests;;' \
  45. Makefile || die
  46. }
  47. src_configure() {
  48. # disable module-aware mode
  49. export GO111MODULE=off
  50. # no network access
  51. export GOPROXY=off
  52. # don't try to update the toolchain
  53. export GOTOOLCHAIN="local"
  54. # With GO111MODULE=off WORKDIR needs to be included
  55. export GOPATH="${WORKDIR}:${EPREFIX}/usr/lib/go-gentoo"
  56. export EGO_BUILD_FLAGS="${EGO_BUILD_FLAGS} -trimpath"
  57. }
  58. src_test() {
  59. # test target wraps around test-common target with -j6
  60. emake test-common
  61. }
  62. src_install() {
  63. set -- env GOBIN="${ED}/usr/bin" go install -v -work -x ${EGO_BUILD_FLAGS} ./cmd/esbuild
  64. echo "$@"
  65. "$@" || die
  66. help2man -s1 -o esbuild.1 -N "${ED}/usr/bin/esbuild" || die
  67. doman esbuild.1
  68. }