diff options
author | rillig <rillig@pkgsrc.org> | 2016-01-23 12:42:57 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2016-01-23 12:42:57 +0000 |
commit | be02c9e48f3220273eb493fb8842e8b6399ccf91 (patch) | |
tree | e5b9d120cad35bb7638e6e1f52f4f73e5c68ed25 /lang/go | |
parent | de659e51e790e76565abf379fea17a22708eacfd (diff) | |
download | pkgsrc-be02c9e48f3220273eb493fb8842e8b6399ccf91.tar.gz |
Made Go packages testable and cleaned up shell commands
Prevented the error message "*** Error 1 (ignored) ***" during installation
by using || instead of &&.
Shell commands are hidden during normal operation.
Go packages can be tested using "bmake test".
ok @bsiegert
Diffstat (limited to 'lang/go')
-rw-r--r-- | lang/go/go-package.mk | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lang/go/go-package.mk b/lang/go/go-package.mk index a6be537d3a5..e6766cf7ae7 100644 --- a/lang/go/go-package.mk +++ b/lang/go/go-package.mk @@ -1,4 +1,4 @@ -# $NetBSD: go-package.mk,v 1.7 2015/12/29 21:47:48 bsiegert Exp $ +# $NetBSD: go-package.mk,v 1.8 2016/01/23 12:42:57 rillig Exp $ # # This file implements common logic for compiling Go programs in pkgsrc. # The compiled Go code is tied to a specific compiler version, and the @@ -56,13 +56,18 @@ PRINT_PLIST_AWK+= { gsub(/${GO_PLATFORM}/, \ print; next; } post-extract: - ${MKDIR} ${WRKSRC} - ${RM} -fr ${WRKDIR}/`basename ${GO_DIST_BASE}`/.hg - ${MV} ${WRKDIR}/`basename ${GO_DIST_BASE}`/* ${WRKSRC} + ${RUN} ${MKDIR} ${WRKSRC} + ${RUN} ${RM} -fr ${WRKDIR}/`basename ${GO_DIST_BASE}`/.hg + ${RUN} ${MV} ${WRKDIR}/`basename ${GO_DIST_BASE}`/* ${WRKSRC} do-build: - env GOPATH=${WRKDIR}:${BUILDLINK_DIR}/gopkg go install -v ${GO_BUILD_PATTERN} + ${RUN} env GOPATH=${WRKDIR}:${BUILDLINK_DIR}/gopkg go install -v ${GO_BUILD_PATTERN} + +.if !target(do-test) +do-test: + ${RUN} env GOPATH=${WRKDIR}:${BUILDLINK_DIR}/gopkg go test -v ${GO_BUILD_PATTERN} +.endif do-install: - -cd ${WRKDIR} && [ -d bin ] && ${PAX} -rw bin ${DESTDIR}${PREFIX} - -cd ${WRKDIR} && [ -d pkg ] && ${PAX} -rw src pkg ${DESTDIR}${PREFIX}/gopkg + ${RUN} cd ${WRKDIR}; [ ! -d bin ] || ${PAX} -rw bin ${DESTDIR}${PREFIX} + ${RUN} cd ${WRKDIR}; [ ! -d pkg ] || ${PAX} -rw src pkg ${DESTDIR}${PREFIX}/gopkg |