Date: Mon, 23 Apr 2018 00:22:17 +0000 (UTC) From: Sean Chittenden <seanc@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r468067 - in head/devel: . mage mage/files Message-ID: <201804230022.w3N0MHGm002545@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: seanc Date: Mon Apr 23 00:22:17 2018 New Revision: 468067 URL: https://svnweb.freebsd.org/changeset/ports/468067 Log: Add new port: devel/mage 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. Approved by: swills (mentor) Differential Revision: https://reviews.freebsd.org/D15159 Added: head/devel/mage/ head/devel/mage/Makefile (contents, props changed) head/devel/mage/distinfo (contents, props changed) head/devel/mage/files/ head/devel/mage/files/patch-magefile.go (contents, props changed) head/devel/mage/pkg-descr (contents, props changed) Modified: head/devel/Makefile Modified: head/devel/Makefile ============================================================================== --- head/devel/Makefile Mon Apr 23 00:12:34 2018 (r468066) +++ head/devel/Makefile Mon Apr 23 00:22:17 2018 (r468067) @@ -1699,6 +1699,7 @@ SUBDIR += m17n-docs SUBDIR += m17n-lib SUBDIR += m4 + SUBDIR += mage SUBDIR += magit SUBDIR += magit-popup SUBDIR += make++ Added: head/devel/mage/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/mage/Makefile Mon Apr 23 00:22:17 2018 (r468067) @@ -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 <bsd.port.mk> Added: head/devel/mage/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/mage/distinfo Mon Apr 23 00:22:17 2018 (r468067) @@ -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 Added: head/devel/mage/files/patch-magefile.go ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/mage/files/patch-magefile.go Mon Apr 23 00:22:17 2018 (r468067) @@ -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 + } Added: head/devel/mage/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/mage/pkg-descr Mon Apr 23 00:22:17 2018 (r468067) @@ -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/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804230022.w3N0MHGm002545>