aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTBK <tbk@jjtc.eu>2020-03-25 20:23:21 +0100
committerRasmus Thomsen <oss@cogitri.dev>2020-03-25 21:00:51 +0000
commitb8b1d2fb0bf3b535acd0c94f6e511ad8dbd93512 (patch)
tree0180ca42a60c8109c4b248642244567bbd55bdb8
parent31f32a7bdb4e013e0b5eec78d617af50e4e78a5d (diff)
downloadaports-b8b1d2fb0bf3b535acd0c94f6e511ad8dbd93512.tar.gz
aports-b8b1d2fb0bf3b535acd0c94f6e511ad8dbd93512.tar.bz2
aports-b8b1d2fb0bf3b535acd0c94f6e511ad8dbd93512.tar.xz
testing/gn: new aport
-rw-r--r--testing/gn/APKBUILD31
-rw-r--r--testing/gn/python3.patch220
2 files changed, 251 insertions, 0 deletions
diff --git a/testing/gn/APKBUILD b/testing/gn/APKBUILD
new file mode 100644
index 0000000000..cd297bfc5d
--- /dev/null
+++ b/testing/gn/APKBUILD
@@ -0,0 +1,31 @@
+# Contributor: TBK <alpine@jjtc.eu>
+# Maintainer: TBK <alpine@jjtc.eu>
+pkgname=gn
+pkgver=0_git20200320
+pkgrel=0
+pkgdesc="GN is a meta-build system that generates build files for Ninja."
+arch="all"
+url="https://gn.googlesource.com/gn"
+license="BSD-3-Clause"
+depends="samurai"
+makedepends="python3"
+# archive needs to include .git for the build script to be able to determine the version
+source="https://dev.alpinelinux.org/archive/gn/gn-$pkgver.tar.gz
+ python3.patch
+ "
+
+build() {
+ ./build/gen.py
+ ninja -C out
+}
+
+check() {
+ ./out/gn_unittests
+}
+
+package() {
+ install -Dm755 out/gn "$pkgdir"/usr/bin/gn
+}
+
+sha512sums="1e289743ad431370d097e8609d74671b6d8c861d1d1b0a9b906c832bf0539460031ddc3a427f25d1dff271447b21caaf3fbc082d8ce9ef4ae20ad0a30888bffd gn-0_git20200320.tar.gz
+03435f48247c6c1eed313e9d54c5b541ccf5566354345e6a39b01a235c60430d64d8ec8878c1584ad8e62ab9b28c0c90f1c1521c5d810a4f8c7512f9bdddbd21 python3.patch"
diff --git a/testing/gn/python3.patch b/testing/gn/python3.patch
new file mode 100644
index 0000000000..78e11f67b8
--- /dev/null
+++ b/testing/gn/python3.patch
@@ -0,0 +1,220 @@
+--- a/build/full_test.py
++++ b/build/full_test.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright 2018 The Chromium Authors. All rights reserved.
+ # Use of this source code is governed by a BSD-style license that can be
+ # found in the LICENSE file.
+--- a/build/gen.py
++++ b/build/gen.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright 2014 The Chromium Authors. All rights reserved.
+ # Use of this source code is governed by a BSD-style license that can be
+ # found in the LICENSE file.
+--- a/infra/recipes.py
++++ b/infra/recipes.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # Copyright 2017 The LUCI Authors. All rights reserved.
+ # Use of this source code is governed under the Apache License, Version 2.0
+--- a/src/gn/exec_process_unittest.cc
++++ b/src/gn/exec_process_unittest.cc
+@@ -33,7 +33,7 @@
+ args.push_back(L"-c");
+ args.push_back(base::UTF8ToUTF16(command));
+ #else
+- args.push_back("python");
++ args.push_back("python3");
+ args.push_back("-c");
+ args.push_back(command);
+ #endif
+--- a/src/gn/setup.cc
++++ b/src/gn/setup.cc
+@@ -717,7 +717,7 @@
+ }
+ build_settings_.set_python_path(python_path.NormalizePathSeparatorsTo('/'));
+ #else
+- build_settings_.set_python_path(base::FilePath("python"));
++ build_settings_.set_python_path(base::FilePath("python3"));
+ #endif
+ }
+ return true;
+--- a/src/gn/json_project_writer_unittest.cc
++++ b/src/gn/json_project_writer_unittest.cc
+@@ -37,7 +37,7 @@
+ SubstitutionList::MakeForTest("//out/Debug/output1.out");
+
+ setup.build_settings()->set_python_path(
+- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python")));
++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3")));
+ std::vector<const Target*> targets;
+ targets.push_back(&target);
+ #if defined(OS_WIN)
+@@ -172,7 +172,7 @@
+ SubstitutionList::MakeForTest("//out/Debug/{{source_name_part}}.out");
+
+ setup.build_settings()->set_python_path(
+- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python")));
++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3")));
+ std::vector<const Target*> targets;
+ targets.push_back(&target);
+ #if defined(OS_WIN)
+--- a/src/gn/ninja_action_target_writer_unittest.cc
++++ b/src/gn/ninja_action_target_writer_unittest.cc
+@@ -54,14 +54,14 @@
+ ASSERT_TRUE(target.OnResolved(&err));
+
+ setup.build_settings()->set_python_path(
+- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python")));
++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3")));
+
+ std::ostringstream out;
+ NinjaActionTargetWriter writer(&target, out);
+ writer.Run();
+
+ const char* expected = R"(rule __foo_bar___rule
+- command = /usr/bin/python ../../foo/script.py
++ command = /usr/bin/python3 ../../foo/script.py
+ description = ACTION //foo:bar()
+ restat = 1
+
+@@ -96,7 +96,7 @@
+ ASSERT_TRUE(target.OnResolved(&err));
+
+ setup.build_settings()->set_python_path(
+- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python")));
++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3")));
+
+ std::ostringstream out;
+ NinjaActionTargetWriter writer(&target, out);
+@@ -105,7 +105,7 @@
+ // The console pool's name must be mapped exactly to the string "console"
+ // which is a special pre-defined pool name in ninja.
+ const char* expected = R"(rule __foo_bar___rule
+- command = /usr/bin/python ../../foo/script.py
++ command = /usr/bin/python3 ../../foo/script.py
+ description = ACTION //foo:bar()
+ restat = 1
+
+@@ -138,7 +138,7 @@
+ ASSERT_TRUE(target.OnResolved(&err));
+
+ setup.build_settings()->set_python_path(
+- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python")));
++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3")));
+
+ std::ostringstream out;
+ NinjaActionTargetWriter writer(&target, out);
+@@ -146,7 +146,7 @@
+
+ const char expected_linux[] =
+ "rule __foo_bar___rule\n"
+- " command = /usr/bin/python ../../foo/script.py\n"
++ " command = /usr/bin/python3 ../../foo/script.py\n"
+ " description = ACTION //foo:bar()\n"
+ " restat = 1\n"
+ "\n"
+@@ -198,7 +198,7 @@
+ ASSERT_TRUE(target.OnResolved(&err));
+
+ setup.build_settings()->set_python_path(
+- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python")));
++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3")));
+
+ std::ostringstream out;
+ NinjaActionTargetWriter writer(&target, out);
+@@ -206,7 +206,7 @@
+
+ const char expected_linux[] =
+ "rule __foo_bar___rule\n"
+- " command = /usr/bin/python ../../foo/script.py -i ${in} "
++ " command = /usr/bin/python3 ../../foo/script.py -i ${in} "
+ // Escaping is different between Windows and Posix.
+ #if defined(OS_WIN)
+ "\"--out=foo$ bar${source_name_part}.o\"\n"
+@@ -263,7 +263,7 @@
+ target.config_values().inputs().push_back(SourceFile("//foo/included.txt"));
+
+ setup.build_settings()->set_python_path(
+- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python")));
++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3")));
+
+ std::ostringstream out;
+ NinjaActionTargetWriter writer(&target, out);
+@@ -271,7 +271,7 @@
+
+ const char expected_linux[] =
+ "rule __foo_bar___rule\n"
+- " command = /usr/bin/python ../../foo/script.py -i ${in} "
++ " command = /usr/bin/python3 ../../foo/script.py -i ${in} "
+ #if defined(OS_WIN)
+ "\"--out=foo$ bar${source_name_part}.o\"\n"
+ #else
+@@ -318,7 +318,7 @@
+ SubstitutionList::MakeForTest("//out/Debug/{{source_name_part}}.out");
+
+ setup.build_settings()->set_python_path(
+- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python")));
++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3")));
+
+ std::ostringstream out;
+ NinjaActionTargetWriter writer(&target, out);
+@@ -331,7 +331,7 @@
+ // These come from rsp_file_contents above.
+ " rspfile_content = -j ${source_name_part}\n"
+ // These come from the args.
+- " command = /usr/bin/python ../../foo/script.py ${in} "
++ " command = /usr/bin/python3 ../../foo/script.py ${in} "
+ "${source_file_part} ${rspfile}\n"
+ " description = ACTION //foo:bar()\n"
+ " restat = 1\n"
+@@ -376,7 +376,7 @@
+ SubstitutionList::MakeForTest("//out/Debug/{{source_name_part}}.out");
+
+ setup.build_settings()->set_python_path(
+- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python")));
++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3")));
+
+ std::ostringstream out;
+ NinjaActionTargetWriter writer(&target, out);
+@@ -385,7 +385,7 @@
+ const char expected_linux[] =
+ "rule __foo_bar___rule\n"
+ // These come from the args.
+- " command = /usr/bin/python ../../foo/script.py ${in} "
++ " command = /usr/bin/python3 ../../foo/script.py ${in} "
+ "${source_file_part}\n"
+ " description = ACTION //foo:bar()\n"
+ " restat = 1\n"
+@@ -405,7 +405,7 @@
+ TestWithScope setup;
+
+ setup.build_settings()->set_python_path(
+- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python")));
++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3")));
+
+ Target dep(setup.settings(), Label(SourceDir("//foo/"), "dep"));
+ dep.set_output_type(Target::ACTION);
+@@ -432,7 +432,7 @@
+ const char expected_linux[] =
+ "rule __foo_foo___rule\n"
+ // These come from the args.
+- " command = /usr/bin/python ../../foo/script.py\n"
++ " command = /usr/bin/python3 ../../foo/script.py\n"
+ " description = ACTION //foo:foo()\n"
+ " restat = 1\n"
+ "\n"
+@@ -461,7 +461,7 @@
+ const char expected_linux[] =
+ "rule __bar_bar___rule\n"
+ // These come from the args.
+- " command = /usr/bin/python ../../bar/script.py\n"
++ " command = /usr/bin/python3 ../../bar/script.py\n"
+ " description = ACTION //bar:bar()\n"
+ " restat = 1\n"
+ "\n"