Index: devel/Makefile =================================================================== --- devel/Makefile +++ devel/Makefile @@ -1699,6 +1699,7 @@ SUBDIR += m17n-docs SUBDIR += m17n-lib SUBDIR += m4 + SUBDIR += mage SUBDIR += magit SUBDIR += magit-popup SUBDIR += make++ Index: devel/mage/Makefile =================================================================== --- /dev/null +++ devel/mage/Makefile @@ -0,0 +1,38 @@ +# $FreeBSD$ + +PORTNAME= mage +DISTVERSIONPREFIX= v +DISTVERSION= 2.1.0 +CATEGORIES= devel + +MAINTAINER= seanc@FreeBSD.org +COMMENT= Command-line make-like build tool using Go as input files + +LICENSE= APACHE20 +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= go:lang/go + +USE_GITHUB= yes +GH_ACCOUNT= magefile +GH_SUBDIR= src/github.com/${GH_ACCOUNT}/${PORTNAME} +GH_TAGNAME= 2.1 +GH_TAG_COMMIT= 771ebed + +PLIST_FILES= bin/mage + +pre-patch: + @${SED} -e "s|%%GH_TAGNAME%%|${GH_TAGNAME}|g; s|%%GH_TAG_COMMIT%%|${GH_TAG_COMMIT}|g" \ + ${FILESDIR}/patch-magefile.go > ${WRKSRC}/magefile.go.patch + +do-patch: + @cd ${WRKSRC} && ${PATCH} --forward --quiet -p2 < magefile.go.patch + +do-build: + @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} CGO_ENABLED=0 GOPATH=${WRKSRC} \ + ${LOCALBASE}/bin/go run bootstrap.go + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME} + +.include Index: devel/mage/distinfo =================================================================== --- /dev/null +++ devel/mage/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1524434645 +SHA256 (magefile-mage-v2.1.0-2.1_GH0.tar.gz) = ac4ad1cfaf0a4ee67b1cbb0ea52792c5bc2ce240ee763fdc8d537bb14b40011a +SIZE (magefile-mage-v2.1.0-2.1_GH0.tar.gz) = 8777256 Index: devel/mage/files/patch-magefile.go =================================================================== --- /dev/null +++ devel/mage/files/patch-magefile.go @@ -0,0 +1,17 @@ +--- magefile.go.orig 2018-04-11 17:03:07 UTC ++++ magefile.go +@@ -83,12 +83,14 @@ func flags() (string, error) { + + // tag returns the git tag for the current branch or "" if none. + func tag() string { ++ return "%%GH_TAGNAME%%" + s, _ := sh.Output("git", "describe", "--tags") + return s + } + + // hash returns the git hash for the current repo or "" if none. + func hash() string { ++ return "%%GH_TAG_COMMIT%%" + hash, _ := sh.Output("git", "rev-parse", "--short", "HEAD") + return hash + } Index: devel/mage/pkg-descr =================================================================== --- /dev/null +++ devel/mage/pkg-descr @@ -0,0 +1,17 @@ +Mage is a make/rake-like build tool using Go. You write plain-old go functions, +and Mage automatically uses them as Makefile-like runnable targets. + +Makefiles are hard to read and hard to write. Mostly because makefiles are +essentially fancy bash scripts with significant white space and additional +make-related syntax. + +Mage lets you have multiple magefiles, name your magefiles whatever you want, +and they're easy to customize for multiple operating systems. Mage has no +dependencies (aside from go) and runs just fine on all major operating systems, +whereas make generally uses bash which is not well supported on Windows. Go is +superior to bash for any non-trivial task involving branching, looping, anything +that's not just straight line execution of commands. And if your project is +written in Go, why introduce another language as idiosyncratic as bash? Why not +use the language your contributors are already comfortable with? + +WWW: https://magefile.org/