logo

overlay

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

sys-0.13.0.ebuild (1142B)


  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="golang.org/x/sys"
  5. DESCRIPTION="supplemental Go packages for low-level interactions with the operating system"
  6. HOMEPAGE="https://golang.org/x/sys"
  7. SRC_URI="https://github.com/golang/sys/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
  8. S="${WORKDIR}"
  9. LICENSE="BSD"
  10. SLOT="0"
  11. KEYWORDS="~amd64"
  12. IUSE="test"
  13. RESTRICT="!test? ( test )"
  14. DEPEND="test? ( dev-lang/go )"
  15. src_prepare() {
  16. default
  17. mkdir -p "$(dirname "${WORKDIR}/src/${EGO_PN}")" || die
  18. mv "${S}/${P}" "${WORKDIR}/src/${EGO_PN}" || die
  19. }
  20. src_test() {
  21. # disable module-aware mode
  22. export GO111MODULE=off
  23. # With GO111MODULE=off WORKDIR needs to be included
  24. export GOPATH="${WORKDIR}:${EPREFIX}/usr/lib/go-gentoo"
  25. # `go test` doesn't recurses in directories by itself
  26. go test "${EGO_PN}/cpu" "${EGO_PN}/execabs" "${EGO_PN}/unix" || die
  27. }
  28. src_install() {
  29. mkdir -p "${ED}/usr/lib/go-gentoo/" || die
  30. cp -r "${WORKDIR}/src" "${ED}/usr/lib/go-gentoo/src" || die
  31. test -f "${ED}/usr/lib/go-gentoo/src/${EGO_PN}/go.mod" || die
  32. }