كيف يمكنني بناء وتثبيت P4Python لنظام التشغيل Mac OS X ؟

StackOverflow https://stackoverflow.com/questions/168273

سؤال

لقد كنت غير قادر على بناء P4Python بالنسبة Intel Mac OS X 10.5.5.

هذه هي الخطوات:

  1. أنا تحميل p4python.tgz (من http://filehost.perforce.com/perforce/r07.3/tools/) و توسعت إلى "P4Python-2007.3".
  2. أنا تحميل p4api.القطران (من http://filehost.perforce.com/perforce/r07.3/bin.macosx104x86/) وتوسعت في "p4api-2007.3.143793".
  3. أنا وضعت "p4api-2007.3.143793" إلى "P4Python-2007.3" وتحريرها الإعداد.cfg إلى مجموعة "p4_api=./p4api-2007.3.143793".
  4. لقد تم إضافة خط 'extra_link_args = ["إطار" ، "الكربون"]' إلى setup.py وبعد:

    elif unameOut[0] == "Darwin":
        unix = "MACOSX"
        release = "104"
        platform = self.architecture(unameOut[4])
    
  5. ركضت python setup.py build وحصلت على:

$ python setup.py بناء

API Release 2007.3
running build
running build_py
running build_ext
building 'P4API' extension
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DID_OS="MACOSX104X86" -DID_REL="2007.3" -DID_PATCH="151416" -DID_API="2007.3" -DID_Y="2008" -DID_M="04" -DID_D="09" -I./p4api-2007.3.143793 -I./p4api-2007.3.143793/include/p4 -I/build/toolchain/mac32/python-2.4.3/include/python2.4 -c P4API.cpp -o build/temp.darwin-9.5.0-i386-2.4/P4API.o -DOS_MACOSX -DOS_MACOSX104 -DOS_MACOSXX86 -DOS_MACOSX104X86
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++
P4API.cpp: In function âint P4Adapter_init(P4Adapter*, PyObject*, PyObject*)â:
P4API.cpp:105: error: âPy_ssize_tâ was not declared in this scope
P4API.cpp:105: error: expected `;' before âposâ
P4API.cpp:107: error: âposâ was not declared in this scope
P4API.cpp: In function âPyObject* P4Adapter_run(P4Adapter*, PyObject*)â:
P4API.cpp:177: error: âPy_ssize_tâ was not declared in this scope
P4API.cpp:177: error: expected `;' before âiâ
P4API.cpp:177: error: âiâ was not declared in this scope
error: command 'gcc' failed with exit status 1

which gcc العودة /usr/bin/دول مجلس التعاون الخليجي ، gcc -v العوائد:

Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5465~16/src/configure
--disable-checking -enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.0/
--with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib
--build=i686-apple-darwin9 --with-arch=apple --with-tune=generic
--host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5465)

python -V يعود الثعبان 2.4.3.

هل كانت مفيدة؟

المحلول

الإصدار الأحدث 2008.1 بناء مع بيثون 2.4.

كنت قد نشرت التغييرات الطفيفة المطلوبة للقيام بذلك على P4Python الصفحة, لكنهم كانوا توالت في النسخة الرسمية.

روبرت

نصائح أخرى

من http://bugs.mymediasystem.org/?do=details&task_id=676 يشير إلى أن Py_ssize_t أضيف في بايثون 2.5, لذلك لن تعمل (بدون تعديلات) مع بيثون 2.4.

إما تثبيت/تجميع نسخة خاصة بك من بايثون 2.5/2.6 ، أو العمل على كيفية تغيير P4Python ، أو البحث عن بديل الثعبان-بالضرورة المكتبة.

قديمة جدا, ولكن ربما يمكنك استخدام http://public.perforce.com:8080/@md=d&cd=//guest/miki_tebeka/p4py/&c=5Fm@//guest/miki_tebeka/p4py/main/?ac=83 الآن

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top