Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Advice for go ebuild

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
4 posts • Page 1 of 1
Author
Message
Thybolt
n00b
n00b
Posts: 3
Joined: Thu Feb 19, 2026 10:07 pm

Advice for go ebuild

  • Quote

Post by Thybolt » Thu Feb 19, 2026 10:48 pm

I'm trying to update dev-util/hut from 0.6.0 to 0.7.0 on Guru.

As it is written in Go, the build process needs a vendor directory to build inside the sandbox.

One thing that has changed from 0.6.0 is that the vendor directory is now released by the upstream maintainer.

Source tarbal and vendor tarball are not extracted to the same directory so not merged together.

I'm trying to remedy this by specifying the src_prepare function and moving the tarball manually but the ebuild seem to fail at the src_unpack function.

Overriding the src_unpack function does nothing.

This issue seem very similar to this one https://forums.gentoo.org/viewtopic-t-1 ... endor.html but nothing helped me there.

Current error:
go mod verify
go: codeberg.org/emersion/go-scfg@v0.1.0: Get "https://proxy.golang.org/codeberg.org/e ... v0.1.0.mod": dial tcp: lookup proxy.golang.org on 100.64.0.55:53: dial udp 100.64.0.55:53: connect: network is unreachable"
Current ebuild:

Code: Select all

# Copyright 2023-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module

DESCRIPTION="CLI tool for sourcehut"

HOMEPAGE="https://sr.ht/~xenrox/hut/"

SRC_URI="https://git.sr.ht/~xenrox/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" https://git.sr.ht/~xenrox/${PN}/refs/download/v${PV}/${PN}-v${PV}-vendor.tar.xz -> ${P}-vendor.tar.xz"

S="${WORKDIR}/hut-v${PV}"

LICENSE="AGPL-3"
SLOT="0"

KEYWORDS="~amd64"

BDEPEND="app-text/scdoc"

src_prepare() {
        mv ../hut/vendor .
}

src_compile() {
        ego build
        emake doc/hut.1 completions
}

src_install() {
        dobin hut
        emake install PREFIX="${EPREFIX}/usr" DESTDIR="${D}"
}
Thank you
Top
salahx
Guru
Guru
Posts: 571
Joined: Sat Mar 12, 2005 6:39 am

  • Quote

Post by salahx » Fri Feb 20, 2026 12:29 am

This works:

Code: Select all

# Copyright 2023-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module

DESCRIPTION="CLI tool for sourcehut"

HOMEPAGE="https://sr.ht/~xenrox/hut/"

SRC_URI="https://git.sr.ht/~xenrox/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" https://git.sr.ht/~xenrox/${PN}/refs/download/v${PV}/${PN}-v${PV}-vendor.tar.xz -> ${P}-vendor.tar.xz"

S="${WORKDIR}/hut-v${PV}"

LICENSE="AGPL-3"
SLOT="0"

KEYWORDS="~amd64"

BDEPEND="app-text/scdoc"

src_unpack() {
        default
        mv go_mod "${WORKDIR}" || die
}

src_compile() {
        ego build
        emake doc/hut.1 completions
}

src_install() {
        dobin hut
        emake install PREFIX="${EPREFIX}/usr" DESTDIR="${D}"
}
Top
Thybolt
n00b
n00b
Posts: 3
Joined: Thu Feb 19, 2026 10:07 pm

  • Quote

Post by Thybolt » Sat Feb 21, 2026 12:22 pm

Thanks

I modified

Code: Select all

mv go_mod "${WORKDIR}" || die 
Into

Code: Select all

mv hut/vendor "${S}" || die
Have a nice day
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3529
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sat Feb 21, 2026 3:53 pm

I was thinking of changing a variable but the eclass didn't provide any that make sense. However I'm not that familiar with Go.

Maybe you could get better help on IRC. Especially if the author of the eclass hangs there, but also there are many people who can give you input on your ebuild.

Best Regards,
Georgi
Top
Post Reply

4 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy