From owner-svn-ports-head@freebsd.org Mon Apr 23 00:22:19 2018 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D142CFABDF3; Mon, 23 Apr 2018 00:22:18 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 836567CF95; Mon, 23 Apr 2018 00:22:18 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E31C1CDF9; Mon, 23 Apr 2018 00:22:18 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3N0MIMD002550; Mon, 23 Apr 2018 00:22:18 GMT (envelope-from seanc@FreeBSD.org) Received: (from seanc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3N0MHGm002545; Mon, 23 Apr 2018 00:22:17 GMT (envelope-from seanc@FreeBSD.org) Message-Id: <201804230022.w3N0MHGm002545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: seanc set sender to seanc@FreeBSD.org using -f From: Sean Chittenden Date: Mon, 23 Apr 2018 00:22:17 +0000 (UTC) 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 X-SVN-Group: ports-head X-SVN-Commit-Author: seanc X-SVN-Commit-Paths: in head/devel: . mage mage/files X-SVN-Commit-Revision: 468067 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 00:22:19 -0000 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 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/