Gentoo Archives: gentoo-dev

From: Damo Brisbane <dhatchett2@×××××.com>
To: Kent Fredric <kentnl@g.o>, gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] git checkout in ebuild?
Date: Mon, 16 Oct 2017 22:38:04
Message-Id: CAE5cDqMHdxuJvEGDwVdo9tVRkaVAwA3yxuR0miCzUgfqH+VV9g@mail.gmail.com
In Reply to: Re: [gentoo-dev] git checkout in ebuild? by Kent Fredric
1 The git.r3 eclass method seems good practice for a specific commit. I'll
2 have a look at the snap site today (AEST) - see if I can find a tarball -
3 this seems preferable to commit.Thanks for the very helpful replies;
4
5 On Tue, Oct 17, 2017 at 8:04 AM, Kent Fredric <kentnl@g.o> wrote:
6
7 > On Mon, 16 Oct 2017 13:31:53 +1000
8 > Damo Brisbane <dhatchett2@×××××.com> wrote:
9 >
10 > > Hello,
11 > >
12 > > I am wanting to make an ebuild for Intel's (Apache 2 licensed) snap
13 > > monitoring framework (https://github.com/intelsdi-x/snap). It seems the
14 > > current version (2.0.0) does not compile the golang binaries with some
15 > type
16 > > of recent grpc API incompatibility. I can successfully compile by going:
17 > >
18 > > go get ...
19 > > cd <SRC_DIR>
20 > > git checkout 1.3.0
21 > > make all
22 > >
23 > > This gets me the binaries (snaptel, snapteld); does anyone know if I can
24 > > put this process (git checkout..) into an .ebuild file (or some other
25 > > suggestion)?
26 > >
27 > > Cheers,
28 >
29 > emerge -va app-portage/eclass-manpages
30 > man 5 git-r3.eclass
31 >
32 > -> ECLASS_VARIABLES
33 >
34 > Look at almost any ebuild in tree using git-r3.eclass with a -9999
35 > version for examples of how you can use this if the eclass
36 > documentation isn't clear enough.
37 >
38 > But, these are forbidden in gentoo as a normal package.
39 >
40 > Typically, the solution there is finding a tarball, or producing
41 > a snapshot of the tree and publishing it somewhere.
42 >
43 > There's writing on that here:
44 >
45 > https://devmanual.gentoo.org/ebuild-writing/functions/src_
46 > unpack/svn-sources/index.html
47 >
48 > and
49 >
50 > https://devmanual.gentoo.org/ebuild-writing/functions/src_
51 > unpack/cvs-sources/index.html
52 >
53 > But there's no specific reference for Git sources, although the general
54 > rules and concepts still apply.
55 >
56 > Other commenters have mentioned using github tagged release's for
57 > tarballs, but even those aren't necessarily great, because:
58 >
59 > - Historically, the tarball's SHA1 can change due to github's tooling
60 > changing
61 > - Tags are not in any way immutable, and its been seen that people
62 > forcibly replace tags in order to keep their git history tidy.
63 > ( Which doesn't change the functional source code, bug can be
64 > sufficient to change timestamps in the tarball, and thus, the SHA1 )
65 >
66 >