forked from Lainports/freebsd-ports
This allows for port testing with lang/go-devel via GO_PORT, setting up the Go build environment in a single place, and is step one in simplifying Go ports that often define too complicated do-build targets themselves. USES=go gains new arguments 'run' to add lang/go to RUN_DEPENDS and 'no_targets' for ports with composite builds that call 'go' themselves and do not need the do-build/do-install targets of USES=go. PR: 238849 Submitted by: dg@syrec.org (also D20745) Reviewed by: mat, tobik Exp-run by: antoine Differential Revision: https://reviews.freebsd.org/D20746
78 lines
2.3 KiB
Makefile
78 lines
2.3 KiB
Makefile
# $FreeBSD$
|
|
|
|
PORTNAME= gitlab-runner
|
|
PORTVERSION= 11.11.1
|
|
CATEGORIES= devel
|
|
MASTER_SITES= \
|
|
https://gitlab-runner-downloads.s3.amazonaws.com/master/docker/:dockerx64 \
|
|
https://gitlab-runner-downloads.s3.amazonaws.com/master/docker/:dockerarm
|
|
DISTFILES= \
|
|
prebuilt-x86_64.tar.xz:dockerx64 \
|
|
prebuilt-arm.tar.xz:dockerarm
|
|
DIST_SUBDIR= gitlab-runner
|
|
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
|
|
|
|
MAINTAINER= swills@FreeBSD.org
|
|
COMMENT= Official GitLab Runner written in Go
|
|
|
|
LICENSE= MIT
|
|
LICENSE_FILE= ${WRKSRC}/LICENSE
|
|
|
|
BUILD_DEPENDS= go-bindata:devel/go-bindata
|
|
RUN_DEPENDS= ca_root_nss>=0:security/ca_root_nss \
|
|
bash:shells/bash \
|
|
git:devel/git
|
|
|
|
USES= go
|
|
|
|
USE_GITLAB= yes
|
|
|
|
# Find tags here:
|
|
# https://gitlab.com/gitlab-org/gitlab-runner/tags
|
|
GL_ACCOUNT= gitlab-org
|
|
GL_COMMIT= 5a147c9271bc1f6114ed4e32d3ba3eb9ea372cda
|
|
GITBRANCH= 11-11-stable
|
|
# https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-freebsd-amd64
|
|
BUILT= 2019-05-24T12:47:07+0000
|
|
|
|
GO_LDFLAGS= -X gitlab.com/gitlab-org/gitlab-runner/common.VERSION=${PORTVERSION} \
|
|
-X gitlab.com/gitlab-org/gitlab-runner/common.REVISION=${GL_COMMIT:C/^(........).*/\1/} \
|
|
-X gitlab.com/gitlab-org/gitlab-runner/common.BUILT=${BUILT} \
|
|
-X gitlab.com/gitlab-org/gitlab-runner/common.BRANCH=${GITBRANCH} \
|
|
-s -w
|
|
|
|
PLIST_FILES= bin/gitlab-runner
|
|
|
|
USE_RC_SUBR= gitlab_runner
|
|
|
|
USERS= gitlab-runner
|
|
GROUPS= gitlab-runner
|
|
|
|
post-extract:
|
|
@${MKDIR} ${WRKSRC}/out/docker/
|
|
@${CP} ${DISTDIR}/${DIST_SUBDIR}/prebuilt-x86_64.tar.xz ${WRKSRC}/out/docker/
|
|
@${CP} ${DISTDIR}/${DIST_SUBDIR}/prebuilt-arm.tar.xz ${WRKSRC}/out/docker/
|
|
@${MV} ${WRKSRC}/vendor ${WRKSRC}/src
|
|
|
|
do-build:
|
|
@cd ${WRKSRC} && go-bindata \
|
|
-pkg docker \
|
|
-nocompress \
|
|
-nomemcopy \
|
|
-nometadata \
|
|
-prefix out/docker/ \
|
|
-o executors/docker/bindata.go \
|
|
out/docker/prebuilt-x86_64.tar.xz \
|
|
out/docker/prebuilt-arm.tar.xz
|
|
@cd ${WRKSRC} && go fmt executors/docker/bindata.go
|
|
@${MKDIR} ${WRKSRC}/src/gitlab.com/gitlab-org
|
|
@${LN} -s ${WRKSRC} ${WRKSRC}/src/gitlab.com/gitlab-org/gitlab-runner
|
|
@cd ${WRKSRC} && \
|
|
${SETENV} ${MAKE_ENV} CGO_ENABLED=0 GOPATH=${WRKSRC} go build \
|
|
-ldflags="${GO_LDFLAGS}" \
|
|
-o gitlab-runner
|
|
|
|
do-install:
|
|
${INSTALL_PROGRAM} ${WRKSRC}/gitlab-runner ${STAGEDIR}${PREFIX}/bin/gitlab-runner
|
|
|
|
.include <bsd.port.mk>
|