* [gentoo-dev] How to correctly use golang-vcs with the Google API libraries?
@ 2015-08-25 0:35 Andrew Udvare
2015-08-26 19:41 ` William Hubbs
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Udvare @ 2015-08-25 0:35 UTC (permalink / raw
To: gentoo-dev
To correctly support the entire Google API library set, do we need a
separate ebuild for every single one? This definitely can be automated.
https://godoc.org/google.golang.org/api
With golang-vcs, using google.golang.org/api for GO_PN is not working
and I think it is because each package must be dealt with separately.
Back story:
I have an ebuild I made a while ago back when the norm was to hack up a
copy of GOROOT minus the package and build the package with that root,
then install. It is located here:
https://github.com/Tatsh/tatsh-overlay/blob/master/dev-go/google-api-go-client/google-api-go-client-0_p20150428.ebuild
I do need to update all my Go ebuilds for golang-* eclasses, not just
this one, because the old way was to install to /usr/lib/go rather than
/usr/lib/go-gentoo.
But besides that, this ebuild was only intended to fulfil the
dependencies of Odeke Drive (a Google Drive client, especially since
Grive is now dead due to API changes). You can see this in the loop that
only deals with the packages drive/v2 and googleapi. (Just to note, I
would love to see Odeke Drive in the tree as there is no longer a
working Google Drive client in the tree.)
Thanks
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-dev] How to correctly use golang-vcs with the Google API libraries?
2015-08-25 0:35 [gentoo-dev] How to correctly use golang-vcs with the Google API libraries? Andrew Udvare
@ 2015-08-26 19:41 ` William Hubbs
2015-08-26 20:56 ` Andrew Udvare
0 siblings, 1 reply; 3+ messages in thread
From: William Hubbs @ 2015-08-26 19:41 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 668 bytes --]
On Mon, Aug 24, 2015 at 05:35:39PM -0700, Andrew Udvare wrote:
> To correctly support the entire Google API library set, do we need a
> separate ebuild for every single one? This definitely can be automated.
>
> https://godoc.org/google.golang.org/api
>
> With golang-vcs, using google.golang.org/api for GO_PN is not working
> and I think it is because each package must be dealt with separately.
I will take a look at this in more detail, but, yes, from what I see in
their README.md, we will need ebuilds for each package.
Let me know what you think about how we could automate it. I think
we'll have to manually create the ebuilds.
William
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-dev] How to correctly use golang-vcs with the Google API libraries?
2015-08-26 19:41 ` William Hubbs
@ 2015-08-26 20:56 ` Andrew Udvare
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Udvare @ 2015-08-26 20:56 UTC (permalink / raw
To: gentoo-dev
On 26/08/15 12:41, William Hubbs wrote:
> On Mon, Aug 24, 2015 at 05:35:39PM -0700, Andrew Udvare wrote:
>
> Let me know what you think about how we could automate it. I think
> we'll have to manually create the ebuilds.
It appears they either use GitHub as the official place to get the API
or it is a mirror. Either way, it is on GitHub so the API can be
utilised. This can be scripted more astutely but jq can be used against
the GitHub API (and no login is required; however unauthenticated users
have limits).
Example getting all the directories at the top level (uses app-misc/jq):
curl -H 'Accept: application/vnd.github.v3+json'
https://api.github.com/repos/google/google-api-go-client/contents/ | jq
-r '.[] | select(type="dir") | .name'
Once you have this, for each one you have to get the v1, v2, etc. I do
not know how that should work in Portage because I think it is very
likely one package would require v1 while another will require v2. This
would seem to indicate slotting.
An ugly example to generate GO_PN lines:
contents_uri='https://api.github.com/repos/google/google-api-go-client/contents/'
accept='Accept: application/vnd.github.v3+json'
pn_prefix=github.com/google/google-api-go-client/
jq_filter='.[] | select(.type=="dir") | .name')
for i in $(curl -H $accept "$contents_uri" | jq -r "$jq_filter"); do
versions=$(curl -H $accept "${contents_uri}${i}" | jq -r "$jq_filter")
for j in versions; do
echo "SLOT=\"${j/v/ }\"" # Remove v prefix
echo "GO_PN="${pn_prefix}${i}/${j}"
done
break # Added to not exceed the very small API limit
done
As for the actual version number for the ebuild, from the API I think
you can get the last modified date for the directory. This would be to
create a version number like some of the others: 0_pre<date>, e.g.
0_pre20150729.
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-08-26 20:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-25 0:35 [gentoo-dev] How to correctly use golang-vcs with the Google API libraries? Andrew Udvare
2015-08-26 19:41 ` William Hubbs
2015-08-26 20:56 ` Andrew Udvare
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox