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.24.1.ebuild (1742B)


  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. # Not a dev repo
  39. sed -i -e '/git diff/d' Makefile || die
  40. }
  41. src_configure() {
  42. # disable module-aware mode
  43. export GO111MODULE=off
  44. # no network access
  45. export GOPROXY=off
  46. # don't try to update the toolchain
  47. export GOTOOLCHAIN="local"
  48. # With GO111MODULE=off WORKDIR needs to be included
  49. export GOPATH="${WORKDIR}:${EPREFIX}/usr/lib/go-gentoo"
  50. export EGO_BUILD_FLAGS="${EGO_BUILD_FLAGS} -trimpath"
  51. }
  52. src_test() {
  53. # test target wraps around test-common target with -j6
  54. emake test-common
  55. }
  56. src_install() {
  57. set -- env GOBIN="${ED}/usr/bin" go install -v -work -x ${EGO_BUILD_FLAGS} ./cmd/esbuild
  58. echo "$@"
  59. "$@" || die
  60. help2man -s1 -o esbuild.1 -N "${ED}/usr/bin/esbuild" || die
  61. doman esbuild.1
  62. }