logo

overlay

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

sys-0.22.0.ebuild (1214B)


  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. PATCHES=(
  16. "${FILESDIR}/sys-0.22.0-fileDedupeRange-EOPNOTSUPP.patch"
  17. )
  18. src_prepare() {
  19. default
  20. mkdir -p "$(dirname "${WORKDIR}/src/${EGO_PN}")" || die
  21. mv "${S}/${P}" "${WORKDIR}/src/${EGO_PN}" || die
  22. }
  23. src_test() {
  24. # disable module-aware mode
  25. export GO111MODULE=off
  26. # With GO111MODULE=off WORKDIR needs to be included
  27. export GOPATH="${WORKDIR}:${EPREFIX}/usr/lib/go-gentoo"
  28. # `go test` doesn't recurses in directories by itself
  29. go test "${EGO_PN}/cpu" "${EGO_PN}/execabs" "${EGO_PN}/unix" || die
  30. }
  31. src_install() {
  32. mkdir -p "${ED}/usr/lib/go-gentoo/" || die
  33. cp -r "${WORKDIR}/src" "${ED}/usr/lib/go-gentoo/src" || die
  34. test -f "${ED}/usr/lib/go-gentoo/src/${EGO_PN}/go.mod" || die
  35. }