diff --git a/ninja-1.5.3-verbose-build.patch b/ninja-1.5.3-verbose-build.patch new file mode 100644 index 0000000..03221be --- /dev/null +++ b/ninja-1.5.3-verbose-build.patch @@ -0,0 +1,71 @@ +commit 9f4200d6d81924a1b0368af034a1ff48728543f6 +Author: Ben Boeckel +Date: Wed Dec 10 23:09:38 2014 -0500 + + configure: add a verbose mode + + Required for Fedora infrastructure so that the commands used to build + ninja are logged. + +diff --git a/configure.py b/configure.py +index aac4ad4..00da22a 100755 +--- a/configure.py ++++ b/configure.py +@@ -106,8 +106,9 @@ class Bootstrap: + It also proxies all calls to an underlying ninja_syntax.Writer, to + behave like non-bootstrap mode. + """ +- def __init__(self, writer): ++ def __init__(self, writer, verbose=False): + self.writer = writer ++ self.verbose = verbose + # Map of variable name => expanded variable value. + self.vars = {} + # Map of rule name => dict of rule attributes. +@@ -163,6 +164,8 @@ class Bootstrap: + def _run_command(self, cmdline): + """Run a subcommand, quietly. Prints the full command on error.""" + try: ++ if self.verbose: ++ print(cmdline) + subprocess.check_call(cmdline, shell=True) + except subprocess.CalledProcessError, e: + print('when running: ', cmdline) +@@ -173,6 +176,8 @@ parser = OptionParser() + profilers = ['gmon', 'pprof'] + parser.add_option('--bootstrap', action='store_true', + help='bootstrap a ninja binary from nothing') ++parser.add_option('--verbose', action='store_true', ++ help='enable verbose build') + parser.add_option('--platform', + help='target platform (' + + '/'.join(Platform.known_platforms()) + ')', +@@ -217,7 +222,7 @@ if options.bootstrap: + # Wrap ninja_writer with the Bootstrapper, which also executes the + # commands. + print('bootstrapping ninja...') +- n = Bootstrap(n) ++ n = Bootstrap(n, verbose=options.verbose) + + n.comment('This file is used to build ninja itself.') + n.comment('It is generated by ' + os.path.basename(__file__) + '.') +@@ -602,6 +607,10 @@ n.build('all', 'phony', all_targets) + n.close() + print('wrote %s.' % BUILD_FILENAME) + ++verbose = '' ++if options.verbose: ++ verbose = ' -v' ++ + if options.bootstrap: + print('bootstrap complete. rebuilding...') + if platform.is_windows(): +@@ -609,6 +618,6 @@ if options.bootstrap: + if os.path.exists(bootstrap_exe): + os.unlink(bootstrap_exe) + os.rename('ninja.exe', bootstrap_exe) +- subprocess.check_call('ninja.bootstrap.exe', shell=True) ++ subprocess.check_call('ninja.bootstrap.exe%s' % verbose, shell=True) + else: +- subprocess.check_call('./ninja', shell=True) ++ subprocess.check_call('./ninja%s' % verbose, shell=True) diff --git a/ninja-build.spec b/ninja-build.spec index 7ba02b4..158a96a 100644 --- a/ninja-build.spec +++ b/ninja-build.spec @@ -6,6 +6,8 @@ License: ASL 2.0 URL: http://martine.github.com/ninja/ Source0: https://github.com/martine/ninja/archive/v%{version}.tar.gz#/ninja-%{version}.tar.gz Source1: ninja.vim +# https://github.com/martine/ninja/pull/882 +Patch0: ninja-1.5.3-verbose-build.patch BuildRequires: asciidoc BuildRequires: gtest-devel BuildRequires: python2-devel @@ -21,6 +23,7 @@ fast as possible. %prep %setup -qn ninja-%{version} +%patch0 -p1 -b .verbose-build %build CFLAGS="%{optflags}" LDFLAGS="%{?__global_ldflags}" \