gpt4 book ai didi

go - Go 中项目的 Ebuild 示例

转载 作者:IT王子 更新时间:2023-10-29 00:48:18 24 4
gpt4 key购买 nike

我打算为一个用 Go 编写的项目创建一个 Gentoo ebuild,我想知道以前是否有人这样做过。

由于与其他编程语言的项目相比,从源代码构建和安装 Go 项目似乎有很大不同,因此与现有的 ebuild 进行比较以找出最佳实践对我来说很有用。

但是,在当前的 portage 树中我找不到任何依赖于“dev-lang/go”的包。是否有这样的 ebuild,也许在覆盖层中?

最佳答案

go-overlay怎么样?寻找例如 ebuilds?他们编写了一个特殊的 ebuild 类,用于在几行内构建 Go 应用程序和库。让我用他们的dev-util/flint-0.0.4以 ebuild 为例(所有评论都是我的):

EAPI=6

GOLANG_PKG_IMPORTPATH="github.com/pengwynn"
GOLANG_PKG_VERSION="c3a5d8d9a2e04296fba560d9a22f763cff68eb75"

# Many Go projects don't pin versions of their dependencies,
# so it may has to be done here. You might not need this step if
# the upstream already uses 'godep' or simular tool.
GOLANG_PKG_DEPENDENCIES=(
"github.com/codegangsta/cli:142e6cd241"
"github.com/fatih/color:1b35f289c4"
"github.com/octokit/go-octokit:4408b5393e"
"github.com/fhs/go-netrc:4422b68c9c"
"github.com/jingweno/go-sawyer:1999ae5763"
"github.com/shiena/ansicolor:264b056680"
"github.com/jtacoma/uritemplates:0a85813eca"
)

# Since many projects don't require custom build steps,
# this single line may be enough.
inherit golang-single

# Nothing special about these variables.
DESCRIPTION="Check your project for common sources of contributor friction"
HOMEPAGE="https://${GOLANG_PKG_IMPORTPATH}/${PN}"
LICENSE="MIT"
KEYWORDS="amd64 x86 arm"

# Prevent simulateneous installing with 'dev-go/flint'.
# Honestly, I was unable to this package on the Internet.
SLOT="0"
DEPEND="!dev-go/${PN}"

关于go - Go 中项目的 Ebuild 示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16634291/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com