diff --git a/srcpkgs/mirrorbits/template b/srcpkgs/mirrorbits/template index 886d6d76121..8d1d6163d83 100644 --- a/srcpkgs/mirrorbits/template +++ b/srcpkgs/mirrorbits/template @@ -1,23 +1,36 @@ # Template file for 'mirrorbits' pkgname=mirrorbits -version=0.4 -revision=2 +version=0.5.1 +revision=1 build_style=go go_import_path="github.com/etix/mirrorbits" -# from Makefile -# we use tarball, so no go_ldflags="-X ${go_import_path}/core.VERSION=${VERSION}" -hostmakedepends="govendor git pkg-config" +_go_protobuf_version=52132540909e117f2b98b0694383dc0ab1e1deca +hostmakedepends="govendor git pkg-config protobuf-devel" makedepends="geoip-devel" depends="geoip-data redis" short_desc="Geographical download redirector" maintainer="lemmi " license="MIT" homepage="https://github.com/etix/mirrorbits" -distfiles="https://github.com/etix/mirrorbits/archive/v0.4.tar.gz" -checksum=4da8f19aae0e63befe53370c9922cb91a656459e7607f8f1b42be07c789e37a0 +distfiles=" + https://github.com/etix/mirrorbits/archive/v${version}.tar.gz + https://github.com/golang/protobuf/archive/${_go_protobuf_version}.tar.gz" +checksum=" + c713c312877aa039415b1f336bf8ca456aa3089a5759c9e6aa9aac8853e165fb + 5ef8723453af0aeea20f7b6f322345c009560ec23b85d430838bfb5d2f1cde4a" +patch_args="-Np1" pre_build() { + # Build the protoc-gen-go Protobuf plugin. + mkdir -p "${GOPATH}/src/github.com/golang" + ln -s "${XBPS_BUILDDIR}/protobuf-${_go_protobuf_version}" "${GOPATH}/src/github.com/golang/protobuf" + GOOS= GOARCH= go install github.com/golang/protobuf/protoc-gen-go + # Generate mirrorbits RPC code. + PATH="${GOPATH}/bin:${PATH}" protoc -I rpc rpc/rpc.proto --go_out=plugins=grpc:rpc + # Clean up protoc-gen-go so do_install doesn't package it. + rm "${GOPATH}/bin/protoc-gen-go" + cd "${GOPATH}/src/${go_import_path}" govendor sync }