void-packages/srcpkgs/go1.12-bootstrap/template

65 lines
1.6 KiB
Bash

# Template file for 'go1.12-bootstrap'
pkgname=go1.12-bootstrap
version=1.12.14
revision=1
archs="x86_64* i686* armv[67]l* aarch64* ppc64le*"
wrksrc="go"
short_desc="Go 1.12 (bootstrap compiler)"
maintainer="q66 <daniel@octaforge.org>"
license="BSD-3-Clause"
homepage="https://golang.org"
nostrip=yes
noverifyrdeps=yes
nocross=yes
lib32disabled=yes
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
depends+=" gcompat"
hostmakedepends+=" patchelf"
fi
case "$XBPS_TARGET_MACHINE" in
x86_64*)
_dist_arch="amd64"
checksum="925a1a9d8b31c2425d7313fe73d3342288968a66e26cd8bf1b6b5656f4603fcb"
;;
i686*)
_dist_arch="386"
checksum="76dda90b4fc0410212094b433cfdc40c9802fba972427e95cbdec3c5b94fd7a6"
;;
arm*)
_dist_arch="armv6l"
checksum="c7aa5562168b6eb3a4bb54af061d68bcb6b9ecae9d785f9a38255c107c986b73"
;;
aarch64*)
_dist_arch="arm64"
checksum="1ab765f4cf74f05cfba40ddcea9160ca6cf9a57915036a559ca1691942862e7c"
;;
ppc64le*)
_dist_arch="ppc64le"
checksum="4e237b1357922e186337989914201e98bd9aed855f4034a5918476650484f83d"
;;
esac
distfiles="https://dl.google.com/go/go${version}.linux-${_dist_arch}.tar.gz"
post_build() {
[ "$XBPS_TARGET_LIBC" != "musl" ] && return 0
# we don't have lib64 compatibility path on musl 64-bit systems
# use patchelf to replace /lib64/<dynlinker> with /lib/<dynlinker>
local _interp=$(patchelf --print-interpreter ${wrksrc}/bin/go)
patchelf --set-interpreter ${_interp/lib64\//lib\/} ${wrksrc}/bin/go
patchelf --set-interpreter ${_interp/lib64\//lib\/} ${wrksrc}/bin/godoc
}
do_install() {
vmkdir usr/lib/go1.12
vcopy bin usr/lib/go1.12
vcopy src usr/lib/go1.12
vcopy pkg usr/lib/go1.12
vlicense LICENSE
}