void-packages/srcpkgs/mongo-tools/template

45 lines
1.5 KiB
Bash

# Template file for 'mongo-tools'
pkgname=mongo-tools
version=3.5.13
revision=10
wrksrc="${pkgname}-r${version}"
build_style=go
go_import_path="github.com/mongodb/mongo-tools"
go_build_tags="ssl sasl"
hostmakedepends="pkg-config"
makedepends="libpcap-devel libressl-devel libsasl-devel"
short_desc="mongodb tools for import, export and diagnostic"
maintainer="Duncaen <duncaen@voidlinux.eu>"
license="Apache-2.0"
homepage="https://github.com/mongodb/mongo-tools"
distfiles="https://github.com/mongodb/${pkgname}/archive/r${version}.tar.gz"
checksum=c842c8e19fc04492817149403b04ad484241351b7b46d46d9f6355019c72c2de
case "$XBPS_TARGET_MACHINE" in
# _build-mongo-tools-xbps/src/github.com/spacemonkeygo/spacelog/capture_other.go:26:9: undefined: syscall.Dup2
# https://github.com/spacemonkeygo/spacelog/issues/6
aarch64*) broken="https://build.voidlinux.eu/builders/aarch64_builder/builds/5088/steps/shell_3/logs/stdio" ;;
esac
do_build() {
local bins="bsondump mongodump mongoexport mongofiles mongoimport mongooplog
mongoreplay mongorestore mongostat mongotop"
local path="${GOPATH}/src/${go_import_path}"
mkdir -p "$(dirname ${path})"
ln -fs "$wrksrc" "${path}"
for d in vendor/src/{github.com,golang.org,gopkg.in}/*; do
mkdir -p $(dirname "${GOPATH}/${d#*/}")
ln -sf "$wrksrc/$d" "${GOPATH}/${d#*/}"
done
for bin in ${bins}; do
go build -x \
-o "${GOPATH}/bin/$bin" \
-tags "${go_build_tags}" \
-ldflags "${go_ldflags}" \
"${path}/$bin/main/$bin.go"
done
}