FS#46219 - [go] Overhaul PKGBUILD
Attached to Project:
Community Packages
Opened by Pierre Neidhardt (Ambrevar) - Monday, 07 September 2015, 13:42 GMT
Last edited by Alexander F. Rødseth (xyproto) - Saturday, 12 September 2015, 21:36 GMT
Opened by Pierre Neidhardt (Ambrevar) - Monday, 07 September 2015, 13:42 GMT
Last edited by Alexander F. Rødseth (xyproto) - Saturday, 12 September 2015, 21:36 GMT
|
Details
Description:
Go 1.5 PKGBUILD is quite outdated. * makedepends: Mercurial is not needed. * 'Enable ARM crosscompilation for linux': the exports and the following `bash make.bash` are not needed. It closes * Replace `if [ "$CARCH" == 'x86_64' ]; then...` by a `case "$CARCH" in` as in the code above. This is shorter and more idiomatic. * Empty `etc/profile.d` is not needed. * Copying src/cmd is redundant. The other commented copies can be discarded. * The `sql.go` fix is no longer necessary. * `get.gin` does not exist anymore. * No need to remove C object files as there is no C code anymore. Remove obsolete comments on C headers. * Executable files: some makefiles need to be executable as pointed out near the end. This create a tension with the few lines above that make sure no executable are to be found in GOROOT. For the sake of simplicity and consistency, I suggest we leave the exec bit as provided by the go distribution. * We should leave the makefiles. (They allow for generating new GOARCH std libraries.) We can safely remove the Windows *.bat files however. * The '!strip' option is used since Go libraries cannot be stripped by the `strip` program. Since the few Go binaries take a lot of space, we can strip them manually. * No need for the final `touch`: this used to be a dirty work around for the stale files, the properly way to do it is `go install std` in post_upgrade (already done). * Crossplatform support: the new `go` command-line tool is able to cross-compile by itself, without any extra compiler nor pkg files. Indeed, if a std pkg is missing, it will build one temporarily. This takes more time however. Besides, `go get` will fail for some odd reason (this should be reported upstream). Anyhow, the 386 and arm `go*` tools are useless, and their std libraries are really space consuming. I believe they are not needed for most users, and to be consistent with gcc multilibs it would more convenient to have a go-386 and a go-arm package containing the pkg/linux_$GOARCH folders. The Arch Wiki page should be updated accordingly. Find my patched PKGBUILD attached. Final size is 235 MB, so ~300 MB less than current package. |
This task depends upon
Closed by Alexander F. Rødseth (xyproto)
Saturday, 12 September 2015, 21:36 GMT
Reason for closing: Implemented
Saturday, 12 September 2015, 21:36 GMT
Reason for closing: Implemented
"$pkgdir/usr/lib/go/pkg/tool/linux_amd64/"*; do
Use a `case "$CARCH"` like before to replace amd64 dynamically.
I am not sure I understand your choice for the stripping: Non x64 arch won't have stripped binaries, will they?
I thought of something like this:
case "$CARCH" in
x86_64) GOARCH=amd64 ;;
i686) GOARCH=386 ;;
esac
for i in "$pkgdir/usr/bin/"* \
"$pkgdir/usr/lib/go/pkg/bootstrap/bin/"* \
"$pkgdir/usr/lib/go/pkg/tool/linux_${GOARCH}/"*; do
strip -s "$i"
done
There were problems with stripping go binaries in the past, so just skipping stripping is a safe alternative that is also close to what upstream provides. Saving a couple of MB is not that important.
I'll consider using your proposed alternative for stripping for the next release. Thanks again for the work you put into improving the PKGBUILD!