-
Notifications
You must be signed in to change notification settings - Fork 27
Big rewrite/cleanup #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
In particular, the unpacked source is now in $S as expected (not
$S/src/$GOIMPORT) so LICENSE files, patches, etc work as usual without
additional paths.
In addition:
- GOPATH is now exposed as a regular bitbake variable.
- GO binary is overridable (eg: to prefix it with godep)
- GO_{GCFLAGS,LDFLAGS} are no longer set from TARGET_CFLAGS/LDFLAGS.
go no longer uses gcc, so these flags are unlikely to be correct.
- New variables: GO_ASMFLAGS, GO_FLAGS
Go binaries don't use GNU_HASH.
Specific criteria is probably incomplete. Patches welcome.
caddy doesn't actually build because all these recipes use AUTOREV and upstream sources have drifted to include new dependencies. I'm not interested in maintaining these, but they should continue to serve as examples of how to use go.bbclass. (And this also serves as a good example of why we shouldn't use AUTOREV)
We only need go 1.4 to bootstrap newer versions of go compiler.
Upstream seems to be confused whether CC should have multiple args (separated by spaces) or be one arg (that may contain spaces). We would prefer the former / usual as this matches uses of $CC in other environments - so this patch does that.
In particular:
- Use bitbake environment variables rather than set in shell fragments
- Remove setup_cgo_gcc_wrapper (obsoleted by cc-args.patch)
- Cleanup path handling to take advantage of ${S}
DEPEND on go-native rather than go-cross (go >= 1.5 can cross-compile
to all supported architectures from the single native binary).
Mark ${PN}-dev as package arch "all" because it contains only golang
src code. ${PN}-staticdev contains the cross-compiled static
libraries and remains arch-specific.
Various minor path fixes and cleanups.
Standard go >=1.5 compiler can cross compile to all architectures with the one binary.
|
(Apologies for the size of the PR - I can attempt to break this up further if you wish) |
|
ping? |
|
|
||
| FILES_${PN} += "${GOBIN_FINAL}/*" | ||
| LIC_FILES_CHKSUM = "file://COPYING;md5=389a9e29629d1f05e115f8f05c283df5" | ||
| S = "${WORKDIR}/git" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this could be simplified even futher similar to how the pypi.bbclass is implemented.
For example in a gopkg.bbclass it could:
- the
SRC_URIcould be derived from the import path Scould be set by default- fill the
HOMEPAGEvariable
There would only be a minimal set of information required for a standard conform packages, like it is for python for example: https://github.com/openembedded/meta-openembedded/blob/master/meta-python/recipes-devtools/python/python-chardet.inc
Example:
GO_IMPORT = "github.com/BurntSushi/toml"
LICENSE = "DWTFYW"
LIC_FILES_CHKSUM = "file://COPYING;md5=389a9e29629d1f05e115f8f05c283df5"
SRCREV = "${AUTOREV}"
inherit gopkg
|
Hi, sorry about the delay. It looks good, but I'm still going over a couple of things. Hopefully I can get this merged today or tomorrow. Thanks for the cleanup! |
Merge the good bits from alternate golang recipe
https://gitlab.com/anguslees/meta-containos/tree/devel/recipes-devtools/go
Highlights: