HaikuPorts
  • Login
  • Preferences
  • Help/Guide
  • Wiki
  • Timeline
  • Roadmap
  • View Tickets
  • Search
  • Port Log
  • Blog

Context Navigation

  • Back to Ticket #659

Ticket #659: gyp-haiku-r1501.patch

File gyp-haiku-r1501.patch, 4.2 KB (added by hamish, 3 years ago)
  • gyptest.py

     
    217217      'linux2':   ['make', 'ninja'], 
    218218      'linux3':   ['make', 'ninja'], 
    219219      'darwin':   ['make', 'ninja', 'xcode'], 
     220      'haiku1':   ['make'], 
    220221    }[sys.platform] 
    221222 
    222223  for format in format_list: 
  • gyp

     
    1 #!/usr/bin/env python 
     1#!/boot/common/bin/python 
    22 
    33# Copyright (c) 2009 Google Inc. All rights reserved. 
    44# Use of this source code is governed by a BSD-style license that can be 
  • pylib/gyp/common.py

     
    378378    return 'solaris' 
    379379  if sys.platform.startswith('freebsd'): 
    380380    return 'freebsd' 
     381  if sys.platform.startswith('haiku'): 
     382    return 'haiku' 
    381383 
    382384  return 'linux' 
    383385 
    384386 
    385387def CopyTool(flavor, out_path): 
    386   """Finds (mac|sun|win)_tool.gyp in the gyp directory and copies it 
     388  """Finds (mac|sun|win|haiku)_tool.gyp in the gyp directory and copies it 
    387389  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) 
    389391  if not prefix: 
    390392    return 
    391393 
  • 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 
     7generator.""" 
     8 
     9import fcntl 
     10import os 
     11import struct 
     12import subprocess 
     13import sys 
     14 
     15 
     16def main(args): 
     17  executor = HaikuTool() 
     18  executor.Dispatch(args) 
     19 
     20 
     21class 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 
     48if __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
       + *
    
     
    491491cmd_sun_tool = ./gyp-sun-tool $(4) $< "$@" 
    492492""" 
    493493 
     494SHARED_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. 
     498quiet_cmd_haiku_tool = HAIKUTOOL $(4) $< 
     499cmd_haiku_tool = ./gyp-haiku-tool $(4) $< "$@" 
     500""" 
    494501 
    495502def WriteRootHeaderSuffixRules(writer): 
    496503  extensions = sorted(COMPILABLE_EXTENSIONS.keys(), key=str.lower) 
    … …  
    20272034    header_params.update({ 
    20282035        'flock': 'lockf', 
    20292036    }) 
     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         
    20302044 
    20312045  header_params.update(RunSystemTests(flavor)) 
    20322046  header_params.update({ 

Download in other formats:

  • Original Format

Trac Powered

Powered by Trac 0.13dev-r10686
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/