Index: head/devel/gn/Makefile =================================================================== --- head/devel/gn/Makefile (revision 503779) +++ head/devel/gn/Makefile (revision 503780) @@ -1,35 +1,40 @@ # $FreeBSD$ PORTNAME= gn DISTVERSIONPREFIX= v DISTVERSION= 1592 +PORTREVISION= 1 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 +CONFLICTS_INSTALL= chromium-gn +USES= alias compiler:c++14-lang ninja python:build shebangfix USE_GITHUB= yes GH_ACCOUNT= cglogic # mirror +SHEBANG_FILES= ${CONFIGURE_SCRIPT} +HAS_CONFIGURE= yes +CONFIGURE_OUTSOURCE= yes +CONFIGURE_SCRIPT= build/gen.py +CONFIGURE_WRKSRC= ${WRKSRC}/out # --out-path breaks "make test" +CONFIGURE_ENV= GN_VERSION=${PORTVERSION} +CONFIGURE_ARGS= --platform freebsd ${WITH_DEBUG:D--debug} +ALL_TARGET= # empty +PLIST_FILES= bin/${PORTNAME} -CONFLICTS_INSTALL= chromimum-gn* +post-patch: + @${REINPLACE_CMD} 's/"python"/"${PYTHON_CMD:T}"/' \ + ${WRKSRC}/tools/gn/exec_process_unittest.cc -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 + ${INSTALL_PROGRAM} ${INSTALL_WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin -do-test: build - cd ${WRKSRC} && ./out/gn_unittests +do-test: + ${TEST_WRKSRC}/gn_unittests .include Index: head/devel/gn/files/patch-build_gen.py =================================================================== --- head/devel/gn/files/patch-build_gen.py (revision 503779) +++ head/devel/gn/files/patch-build_gen.py (revision 503780) @@ -1,29 +1,41 @@ +- Unbreak --platform freebsd (required on DragonFly) +- .git/ is missing in archive, so use version from environment + --- build/gen.py.orig 2019-05-30 09:42:43 UTC +++ build/gen.py +@@ -46,7 +46,7 @@ class Platform(object): + + @staticmethod + def known_platforms(): +- return ['linux', 'darwin', 'msvc', 'aix', 'fuchsia', 'openbsd'] ++ return ['linux', 'darwin', 'msvc', 'aix', 'fuchsia', 'freebsd', 'openbsd'] + + def platform(self): + return self._platform @@ -117,24 +117,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.decode()) - 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 = '' Index: head/devel/gn/files/patch-tools_gn_exec__process__unittest.cc =================================================================== --- head/devel/gn/files/patch-tools_gn_exec__process__unittest.cc (nonexistent) +++ head/devel/gn/files/patch-tools_gn_exec__process__unittest.cc (revision 503780) @@ -0,0 +1,49 @@ +- Convert inline Python to 3.x syntax + +--- tools/gn/exec_process_unittest.cc.orig 2019-05-30 00:15:11 UTC ++++ tools/gn/exec_process_unittest.cc +@@ -70,7 +70,7 @@ TEST(ExecProcessTest, TestLargeOutput) { + std::string std_out, std_err; + int exit_code; + +- ASSERT_TRUE(ExecPython("import sys; print 'o' * 1000000", &std_out, &std_err, ++ ASSERT_TRUE(ExecPython("import sys; print('o' * 1000000)", &std_out, &std_err, + &exit_code)); + EXPECT_EQ(0, exit_code); + EXPECT_EQ(1000001u, std_out.size()); +@@ -81,7 +81,7 @@ TEST(ExecProcessTest, TestStdoutAndStderrOutput) { + int exit_code; + + ASSERT_TRUE(ExecPython( +- "import sys; print 'o' * 10000; print >>sys.stderr, 'e' * 10000", ++ "from __future__ import print_function; import sys; print('o' * 10000); print('e' * 10000, file=sys.stderr)", + &std_out, &std_err, &exit_code)); + EXPECT_EQ(0, exit_code); + EXPECT_EQ(10001u, std_out.size()); +@@ -90,7 +90,7 @@ TEST(ExecProcessTest, TestStdoutAndStderrOutput) { + std_out.clear(); + std_err.clear(); + ASSERT_TRUE(ExecPython( +- "import sys; print >>sys.stderr, 'e' * 10000; print 'o' * 10000", ++ "from __future__ import print_function; import sys; print('e' * 10000, file=sys.stderr); print('o' * 10000)", + &std_out, &std_err, &exit_code)); + EXPECT_EQ(0, exit_code); + EXPECT_EQ(10001u, std_out.size()); +@@ -101,7 +101,7 @@ TEST(ExecProcessTest, TestOneOutputClosed) { + std::string std_out, std_err; + int exit_code; + +- ASSERT_TRUE(ExecPython("import sys; sys.stderr.close(); print 'o' * 10000", ++ ASSERT_TRUE(ExecPython("import sys; sys.stderr.close(); print('o' * 10000)", + &std_out, &std_err, &exit_code)); + EXPECT_EQ(0, exit_code); + EXPECT_EQ(10001u, std_out.size()); +@@ -110,7 +110,7 @@ TEST(ExecProcessTest, TestOneOutputClosed) { + std_out.clear(); + std_err.clear(); + ASSERT_TRUE(ExecPython( +- "import sys; sys.stdout.close(); print >>sys.stderr, 'e' * 10000", ++ "from __future__ import print_function; import sys; sys.stdout.close(); print('e' * 10000, file=sys.stderr)", + &std_out, &std_err, &exit_code)); + EXPECT_EQ(0, exit_code); + EXPECT_EQ(0u, std_out.size()); Property changes on: head/devel/gn/files/patch-tools_gn_exec__process__unittest.cc ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/gn/files/patch-util_exe__path.cc =================================================================== --- head/devel/gn/files/patch-util_exe__path.cc (nonexistent) +++ head/devel/gn/files/patch-util_exe__path.cc (revision 503780) @@ -0,0 +1,23 @@ +- Unbreak build with GCC: + +../util/exe_path.cc: In function 'base::FilePath GetExePath()': +../util/exe_path.cc:56:12: error: 'PATH_MAX' was not declared in this scope + 56 | char buf[PATH_MAX]; + | ^~~~~~~~ +../util/exe_path.cc:58:22: error: 'buf' was not declared in this scope + 58 | if (sysctl(mib, 4, buf, &buf_size, nullptr, 0) == -1) { + | ^~~ +../util/exe_path.cc:61:25: error: 'buf' was not declared in this scope + 61 | return base::FilePath(buf); + | ^~~ + +--- util/exe_path.cc.orig 2019-05-30 00:15:11 UTC ++++ util/exe_path.cc +@@ -16,6 +16,7 @@ + #elif defined(OS_FREEBSD) + #include + #include ++#include // PATH_MAX + #endif + + #if defined(OS_MACOSX) Property changes on: head/devel/gn/files/patch-util_exe__path.cc ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property