From c0fd2ff191565bd0b1f9a3204dc992c93e11f63c Mon Sep 17 00:00:00 2001 From: Kurt Jaeger Date: Sat, 16 Feb 2019 18:52:37 +0000 Subject: [PATCH] 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 --- devel/Makefile | 1 + devel/gn/Makefile | 35 +++++++++++++++++++++++++++++++ devel/gn/distinfo | 3 +++ devel/gn/files/patch-build_gen.py | 29 +++++++++++++++++++++++++ devel/gn/pkg-descr | 3 +++ 5 files changed, 71 insertions(+) create mode 100644 devel/gn/Makefile create mode 100644 devel/gn/distinfo create mode 100644 devel/gn/files/patch-build_gen.py create mode 100644 devel/gn/pkg-descr diff --git a/devel/Makefile b/devel/Makefile index fdb6f3a4c252..fe1c430f6c11 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -814,6 +814,7 @@ SUBDIR += glslang SUBDIR += glui SUBDIR += gmake + SUBDIR += gn SUBDIR += gnatcoll SUBDIR += gnatpython SUBDIR += gnome-builder diff --git a/devel/gn/Makefile b/devel/gn/Makefile new file mode 100644 index 000000000000..664afb317d02 --- /dev/null +++ b/devel/gn/Makefile @@ -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 diff --git a/devel/gn/distinfo b/devel/gn/distinfo new file mode 100644 index 000000000000..39664914eb4d --- /dev/null +++ b/devel/gn/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1550242353 +SHA256 (cglogic-gn-v1529_GH0.tar.gz) = 8f292d3c3a6ea6d6f9b6d41f6e75c360414a7283796905d1b66f41617e2345d2 +SIZE (cglogic-gn-v1529_GH0.tar.gz) = 916888 diff --git a/devel/gn/files/patch-build_gen.py b/devel/gn/files/patch-build_gen.py new file mode 100644 index 000000000000..ba245bbec3f9 --- /dev/null +++ b/devel/gn/files/patch-build_gen.py @@ -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 = '' diff --git a/devel/gn/pkg-descr b/devel/gn/pkg-descr new file mode 100644 index 000000000000..382e3eac0d5a --- /dev/null +++ b/devel/gn/pkg-descr @@ -0,0 +1,3 @@ +GN is a meta-build system that generates build files for Ninja. + +WWW: https://gn.googlesource.com/gn/