New port: devel/gn

GN is a meta-build system that generates build files for Ninja.

WWW: https://gn.googlesource.com/gn/

PR:		234309
Submitted by:	Oleh Hushchenkov <o.hushchenkov@gmail.com>
This commit is contained in:
Kurt Jaeger 2019-02-16 18:52:37 +00:00
parent 72f9a3a02c
commit c0fd2ff191
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=493058
5 changed files with 71 additions and 0 deletions

View File

@ -814,6 +814,7 @@
SUBDIR += glslang
SUBDIR += glui
SUBDIR += gmake
SUBDIR += gn
SUBDIR += gnatcoll
SUBDIR += gnatpython
SUBDIR += gnome-builder

35
devel/gn/Makefile Normal file
View File

@ -0,0 +1,35 @@
# $FreeBSD$
PORTNAME= gn
DISTVERSIONPREFIX= v
DISTVERSION= 1529
CATEGORIES= devel
MAINTAINER= o.hushchenkov@gmail.com
COMMENT= Gn meta build framework - standalone version
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= compiler:c++14-lang ninja python:2.7,build
USE_GITHUB= yes
GH_ACCOUNT= cglogic # mirror
CONFLICTS_INSTALL= chromimum-gn*
PLIST_FILES= bin/gn
do-configure:
cd ${WRKSRC} && GN_VERSION=${PORTVERSION} ${PYTHON_CMD} build/gen.py
do-build:
cd ${WRKSRC} && ninja -C out
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/out/gn ${STAGEDIR}${PREFIX}/bin
do-test: build
cd ${WRKSRC} && ./out/gn_unittests
.include <bsd.port.mk>

3
devel/gn/distinfo Normal file
View File

@ -0,0 +1,3 @@
TIMESTAMP = 1550242353
SHA256 (cglogic-gn-v1529_GH0.tar.gz) = 8f292d3c3a6ea6d6f9b6d41f6e75c360414a7283796905d1b66f41617e2345d2
SIZE (cglogic-gn-v1529_GH0.tar.gz) = 916888

View File

@ -0,0 +1,29 @@
--- build/gen.py.orig 2019-02-12 17:36:05 UTC
+++ build/gen.py
@@ -115,24 +115,15 @@ def main(argv):
def GenerateLastCommitPosition(host, header):
- ROOT_TAG = 'initial-commit'
- describe_output = subprocess.check_output(
- ['git', 'describe', 'HEAD', '--match', ROOT_TAG], shell=host.is_windows(),
- cwd=REPO_ROOT)
- mo = re.match(ROOT_TAG + '-(\d+)-g([0-9a-f]+)', describe_output)
- if not mo:
- raise ValueError(
- 'Unexpected output from git describe when generating version header')
-
contents = '''// Generated by build/gen.py.
#ifndef OUT_LAST_COMMIT_POSITION_H_
#define OUT_LAST_COMMIT_POSITION_H_
-#define LAST_COMMIT_POSITION "%s (%s)"
+#define LAST_COMMIT_POSITION "%s"
#endif // OUT_LAST_COMMIT_POSITION_H_
-''' % (mo.group(1), mo.group(2))
+''' % (os.environ['GN_VERSION'])
# Only write/touch this file if the commit position has changed.
old_contents = ''

3
devel/gn/pkg-descr Normal file
View File

@ -0,0 +1,3 @@
GN is a meta-build system that generates build files for Ninja.
WWW: https://gn.googlesource.com/gn/