From fd9038f0e52d802e47c1e273be76c06e4f4f5891 Mon Sep 17 00:00:00 2001 From: shiromichi Date: Wed, 19 Sep 2018 18:16:40 +0900 Subject: [PATCH 1/2] windows: Fix ninja: error: unknown target 'gn' --- .../windows/windows-fix-building-gn.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/patches/ungoogled-chromium/windows/windows-fix-building-gn.patch b/patches/ungoogled-chromium/windows/windows-fix-building-gn.patch index ac87de70..372236d7 100644 --- a/patches/ungoogled-chromium/windows/windows-fix-building-gn.patch +++ b/patches/ungoogled-chromium/windows/windows-fix-building-gn.patch @@ -1,6 +1,29 @@ # Fix building GN on Windows # Author: shiromichi on GitHub +# Please apply this patch after patches/ungoogled-chromium/gn-bootstrap-remove-gn-gen.patch +--- a/tools/gn/bootstrap/bootstrap.py ++++ b/tools/gn/bootstrap/bootstrap.py +@@ -61,7 +61,7 @@ def main(argv): + else: + build_rel = os.path.join('out', 'Release') + out_dir = os.path.join(SRC_ROOT, build_rel) +- gn_path = options.output or os.path.join(out_dir, 'gn') ++ gn_path = options.output or os.path.join(out_dir, 'gn.exe') + gn_build_dir = os.path.join(out_dir, 'gn_build') + + cmd = [ +@@ -79,8 +79,8 @@ def main(argv): + shutil.copy2( + os.path.join(BOOTSTRAP_DIR, 'last_commit_position.h'), gn_build_dir) + subprocess.check_call( +- ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err']) +- shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path) ++ ['ninja', '-C', gn_build_dir, 'gn.exe', '-w', 'dupbuild=err']) ++ shutil.copy2(os.path.join(gn_build_dir, 'gn.exe'), gn_path) + + + if __name__ == '__main__': --- a/tools/gn/build/build_win.ninja.template +++ b/tools/gn/build/build_win.ninja.template @@ -1,12 +1,12 @@ From 8852f211b227d98bf57c197f40ee215add4d44c5 Mon Sep 17 00:00:00 2001 From: Eloston Date: Wed, 19 Sep 2018 23:34:19 +0000 Subject: [PATCH 2/2] Refresh windows-fix-building-gn.patch --- .../windows/windows-fix-building-gn.patch | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/patches/ungoogled-chromium/windows/windows-fix-building-gn.patch b/patches/ungoogled-chromium/windows/windows-fix-building-gn.patch index 372236d7..8cfe97c9 100644 --- a/patches/ungoogled-chromium/windows/windows-fix-building-gn.patch +++ b/patches/ungoogled-chromium/windows/windows-fix-building-gn.patch @@ -1,10 +1,9 @@ # Fix building GN on Windows # Author: shiromichi on GitHub -# Please apply this patch after patches/ungoogled-chromium/gn-bootstrap-remove-gn-gen.patch --- a/tools/gn/bootstrap/bootstrap.py +++ b/tools/gn/bootstrap/bootstrap.py -@@ -61,7 +61,7 @@ def main(argv): +@@ -62,7 +62,7 @@ def main(argv): else: build_rel = os.path.join('out', 'Release') out_dir = os.path.join(SRC_ROOT, build_rel) @@ -13,13 +12,17 @@ gn_build_dir = os.path.join(out_dir, 'gn_build') cmd = [ -@@ -79,8 +79,8 @@ def main(argv): - shutil.copy2( +@@ -81,11 +81,11 @@ def main(argv): os.path.join(BOOTSTRAP_DIR, 'last_commit_position.h'), gn_build_dir) - subprocess.check_call( -- ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err']) + if options.jobs: + subprocess.check_call( +- ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err', '-j'+str(options.jobs)]) ++ ['ninja', '-C', gn_build_dir, 'gn.exe', '-w', 'dupbuild=err', '-j'+str(options.jobs)]) + else: + subprocess.check_call( +- ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err']) - shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path) -+ ['ninja', '-C', gn_build_dir, 'gn.exe', '-w', 'dupbuild=err']) ++ ['ninja', '-C', gn_build_dir, 'gn.exe', '-w', 'dupbuild=err']) + shutil.copy2(os.path.join(gn_build_dir, 'gn.exe'), gn_path)