Ticket #659: gyp-haiku-r1501.patch
| File gyp-haiku-r1501.patch, 4.2 KB (added by hamish, 3 years ago) |
|---|
-
gyptest.py
217 217 'linux2': ['make', 'ninja'], 218 218 'linux3': ['make', 'ninja'], 219 219 'darwin': ['make', 'ninja', 'xcode'], 220 'haiku1': ['make'], 220 221 }[sys.platform] 221 222 222 223 for format in format_list: -
gyp
1 #!/ usr/bin/envpython1 #!/boot/common/bin/python 2 2 3 3 # Copyright (c) 2009 Google Inc. All rights reserved. 4 4 # Use of this source code is governed by a BSD-style license that can be -
pylib/gyp/common.py
378 378 return 'solaris' 379 379 if sys.platform.startswith('freebsd'): 380 380 return 'freebsd' 381 if sys.platform.startswith('haiku'): 382 return 'haiku' 381 383 382 384 return 'linux' 383 385 384 386 385 387 def CopyTool(flavor, out_path): 386 """Finds (mac|sun|win )_tool.gyp in the gyp directory and copies it388 """Finds (mac|sun|win|haiku)_tool.gyp in the gyp directory and copies it 387 389 to |out_path|.""" 388 prefix = { 'solaris': 'sun', 'mac': 'mac', 'win': 'win' }.get(flavor, None)390 prefix = { 'solaris': 'sun', 'mac': 'mac', 'win': 'win', 'haiku': 'haiku' }.get(flavor, None) 389 391 if not prefix: 390 392 return 391 393 -
pylib/gyp/haiku_tool.py
1 #!/boot/common/bin/python 2 # Copyright (c) 2011 Google Inc. All rights reserved. 3 # Use of this source code is governed by a BSD-style license that can be 4 # found in the LICENSE file. 5 6 """These functions are executed via gyp-haiku-tool when using the Makefile 7 generator.""" 8 9 import fcntl 10 import os 11 import struct 12 import subprocess 13 import sys 14 15 16 def main(args): 17 executor = HaikuTool() 18 executor.Dispatch(args) 19 20 21 class HaikuTool(object): 22 """This class performs all the Haiku tooling steps. The methods can either be 23 executed directly, or dispatched from an argument list.""" 24 25 def Dispatch(self, args): 26 """Dispatches a string command to a method.""" 27 if len(args) < 1: 28 raise Exception("Not enough arguments") 29 30 method = "Exec%s" % self._CommandifyName(args[0]) 31 getattr(self, method)(*args[1:]) 32 33 def _CommandifyName(self, name_string): 34 """Transforms a tool name like copy-info-plist to CopyInfoPlist""" 35 return name_string.title().replace('-', '') 36 37 def ExecFlock(self, lockfile, *cmd_list): 38 """Emulates the most basic behavior of Linux's flock(1).""" 39 # Rely on exception handling to report errors. 40 fd = os.open(lockfile, os.O_RDONLY|os.O_NOCTTY|os.O_CREAT, 0o666) 41 fcntl.flock(fd, fcntl.LOCK_EX) 42 ret = subprocess.call(cmd_list) 43 # Haiki bug -- lock is not released on file close? 44 fcntl.flock(fd, fcntl.LOCK_UN) 45 return ret 46 47 48 if __name__ == '__main__': 49 sys.exit(main(sys.argv[1:])) -
pylib/gyp/generator/make.py
Property changes on: pylib/gyp/haiku_tool.py ___________________________________________________________________ Added: svn:executable + *
491 491 cmd_sun_tool = ./gyp-sun-tool $(4) $< "$@" 492 492 """ 493 493 494 SHARED_HEADER_HAIKU_COMMANDS = """ 495 # gyp-haiku-tool is written next to the root Makefile by gyp. 496 # Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd 497 # already. 498 quiet_cmd_haiku_tool = HAIKUTOOL $(4) $< 499 cmd_haiku_tool = ./gyp-haiku-tool $(4) $< "$@" 500 """ 494 501 495 502 def WriteRootHeaderSuffixRules(writer): 496 503 extensions = sorted(COMPILABLE_EXTENSIONS.keys(), key=str.lower) … … 2027 2034 header_params.update({ 2028 2035 'flock': 'lockf', 2029 2036 }) 2037 elif flavor == 'haiku': 2038 header_params.update({ 2039 'flock': './gyp-haiku-tool flock', 2040 'flock_index': 2, 2041 'extra_commands': SHARED_HEADER_HAIKU_COMMANDS, 2042 }) 2043 2030 2044 2031 2045 header_params.update(RunSystemTests(flavor)) 2032 2046 header_params.update({
