如何为Mac OS X构建和安装P4Python?
时间:2020-03-06 15:05:25 来源:igfitidea点击:
我无法为Intel Mac OS X 10.5.5构建P4Python。
这些是我的步骤:
- 我从http://filehost.perforce.com/perforce/r07.3/tools/下载了p4python.tgz,并将其扩展为" P4Python-2007.3"。
- 我从http://filehost.perforce.com/perforce/r07.3/bin.macosx104x86/下载了p4api.tar,并将其扩展为" p4api-2007.3.143793"。
- 我将" p4api-2007.3.143793"放入" P4Python-2007.3",并编辑setup.cfg以设置" p4_api =。/ p4api-2007.3.143793"。
- 我在setup.py之后添加了行'extra_link_args = [" -framework"," Carbon"]':
elif unameOut[0] == "Darwin": unix = "MACOSX" release = "104" platform = self.architecture(unameOut[4])
- 我运行
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 aint P4Adapter_init(P4Adapter*, PyObject*, PyObject*)a: P4API.cpp:105: error: aPy_ssize_ta was not declared in this scope P4API.cpp:105: error: expected `;' before aposa P4API.cpp:107: error: aposa was not declared in this scope P4API.cpp: In function aPyObject* P4Adapter_run(P4Adapter*, PyObject*)a: P4API.cpp:177: error: aPy_ssize_ta was not declared in this scope P4API.cpp:177: error: expected `;' before aia P4API.cpp:177: error: aia was not declared in this scope error: command 'gcc' failed with exit status 1
gcc返回/ usr / bin / gcc,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返回Python 2.4.3.
解决方案
来自http://bugs.mymediasystem.org/?do=details&task_id=676的建议表明Py_ssize_t是在python 2.5中添加的,因此它(在不进行某些修改的情况下)不适用于python 2.4.
安装/编译自己的python 2.5 / 2.6副本,或者研究如何更改P4Python,或者寻找替代的python-perforce库。
非常陈旧,但也许我们可以使用http://public.perforce.com:8080/@md=d&cd=//guest/miki_tebeka/p4py/&c=5Fm@//guest/miki_tebeka/p4py/main/?ac=目前为83
较新的版本2008.1将使用Python 2.4进行构建。
我已经在P4Python页面上发布了执行此操作所需的微小更改,但是这些更改已滚动到正式版本中。
罗伯特