Menu

#4 Support for darwin/Mac OS X platform

open
None
5
2007-06-17
2007-05-17
No

I have begun porting PyPerforce to Darwin/Mac OS X, and I've added a darwin section to setup.py, but I'm not sure where the third-party/p4api files come from. I'll keep looking but I thought I'd mention that I'm doing this since it will likely be easier with some help.

Thanks,
-Michael.

Discussion

  • Lewis Baker

    Lewis Baker - 2007-05-19

    Logged In: YES
    user_id=1477305
    Originator: NO

    The Perforce API can be downloaded from the Perforce website.

    You should be able to find a link from this page: http://www.perforce.com/perforce/loadsupp.html#api.

     
  • Lewis Baker

    Lewis Baker - 2007-06-17

    Logged In: YES
    user_id=1477305
    Originator: NO

    Have you made any progress on this, Michael?

    Unfortunately I don't have access to a Mac to develop/test myself.

     
  • Lewis Baker

    Lewis Baker - 2007-06-17
    • assigned_to: nobody --> lewisbaker
     
  • Michael Baltaks

    Michael Baltaks - 2007-06-18

    Logged In: YES
    user_id=580641
    Originator: YES

    I did find the API file not long after the last post, but there was still an issue which I didn't have the time to fix. This has been pushed down in priority for me, so it might be weeks before I look at this again. I also have to determine which of the available API kits is the best, given that there are different versions for perforce versions, and a separate file for darwin vs Mac OS X, which is slightly confusing. I expect I'll have to ask on perforce lists for help on that one, but is there a specific api version that works best with PyPerforce?

     
  • Lewis Baker

    Lewis Baker - 2007-07-15

    Logged In: YES
    user_id=1477305
    Originator: NO

    Release 0.3 works with P4API versions up to 2005.2.
    The current head of the trunk works with P4API versions up to 2006.2.

     
  • Nobody/Anonymous

    You can find the Perforce API files here:

    ftp://ftp.perforce.com/perforce/r06.2/bin.macosx104x86/p4api.tar

     
  • Nobody/Anonymous

    Here's a patch to setup.py which worked for me:

    --- setup.py Mon Nov 10 23:26:44 2008 UTC
    +++ setup.py Mon Nov 10 23:38:12 2008 UTC
    @@ -13,6 +13,7 @@
    ('USE_CRLF', None)]
    p4apiLibs = ['libclient', 'librpc', 'libsupp',
    'oldnames', 'kernel32', 'wsock32', 'advapi32']
    + p4apiExtraLinkArgs = []

    elif sys.platform == 'linux2':
    # The Linux platform
    @@ -49,6 +50,18 @@

    p4apiDefines = [('OS_LINUX', None)]
    p4apiLibs = ['client', 'rpc', 'supp']
    + p4apiExtraLinkArgs = []
    +
    +elif sys.platform == 'darwin':
    + # The Darwin platform (basis for Mac OS X)
    +
    + p4apiPlatform = 'macosx104x86'
    +
    + p4apiDefines = [('OS_DARWIN', None)]
    + p4apiLibs = ['client', 'rpc', 'supp']
    + p4apiExtraLinkArgs = ['-framework', 'CoreFoundation',
    + '-framework', 'CoreServices',
    + '-framework', 'Carbon']

    elif sys.platform == 'cygwin':
    # The cygwin platform
    @@ -66,6 +79,7 @@
    p4apiDefines = [('OS_CYGWIN', None),
    ('USE_CRLF', None)]
    p4apiLibs = ['client', 'rpc', 'supp']
    + p4apiExtraLinkArgs = []

    else:
    print "error: platform '%s' not yet supported." % sys.platform
    @@ -111,7 +125,7 @@
    define_macros=p4apiDefines,
    library_dirs=[p4apiPath],
    libraries=p4apiLibs,
    - )
    + extra_link_args=p4apiExtraLinkArgs)

    setup(name='PyPerforce',
    version='0.4',

     

Log in to post a comment.