logo

overlay

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

esbuild-0.18.17.ebuild (1482B)


  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/x-sys
  16. test? ( net-libs/nodejs )
  17. "
  18. BDEPEND="sys-apps/help2man"
  19. RESTRICT="!test? ( test ) strip"
  20. QA_FLAGS_IGNORED='.*'
  21. src_unpack() {
  22. default
  23. mkdir -p "$(dirname "${S}")" || die
  24. mv "${WORKDIR}/${P}" "${S}" || die
  25. }
  26. src_configure() {
  27. # disable module-aware mode
  28. export GO111MODULE=off
  29. # no network access
  30. export GOPROXY=off
  31. # don't try to update the toolchain
  32. export GOTOOLCHAIN="local"
  33. # With GO111MODULE=off WORKDIR needs to be included
  34. export GOPATH="${WORKDIR}:${EPREFIX}/usr/lib/go-gentoo"
  35. export EGO_BUILD_FLAGS="${EGO_BUILD_FLAGS} -trimpath"
  36. # Depends on external node libraries
  37. sed -i \
  38. -e '/^test-common:/s;verify-source-map;;' \
  39. -e '/^test-common:/s;register-test;;' \
  40. -e '/^test-common:/s;node-unref-tests;;' \
  41. Makefile || die
  42. }
  43. src_test() {
  44. emake test
  45. }
  46. src_install() {
  47. set -- env GOBIN="${ED}/usr/bin" go install -v -work -x ${EGO_BUILD_FLAGS} ./cmd/esbuild
  48. echo "$@"
  49. "$@" || die
  50. help2man -s1 -o esbuild.1 -N "${ED}/usr/bin/esbuild" || die
  51. doman esbuild.1
  52. }