2

Intel Mac OS X 10.5.5用の P4Pythonをビルドできませんでした。

これらは私のステップです:

  1. p4python.tgz ( http://filehost.perforce.com/perforce/r07.3/tools/から) をダウンロードし、「P4Python-2007.3」に展開しました。
  2. p4api.tar を ( http://filehost.perforce.com/perforce/r07.3/bin.macosx104x86/から) ダウンロードし、「p4api-2007.3.143793」に展開しました。
  3. 「p4api-2007.3.143793」を「P4Python-2007.3」に配置し、setup.cfg を編集して「p4_api=./p4api-2007.3.143793」を設定しました。
  4. 次の後に「extra_link_args = ["-framework", "Carbon"]」という行を 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 を返し、以下を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 -VPython 2.4.3 を返します。

4

3 に答える 3

1

新しいバージョン 2008.1 は Python 2.4 でビルドされます。

そのために必要な小さな変更を P4Python ページに投稿しましたが、それらは公式バージョンに組み込まれました。

ロバート

于 2009-01-26T00:18:32.783 に答える
1

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 ライブラリを探してください。

于 2008-10-04T09:53:03.403 に答える
0

非常に時代遅れですが、おそらくhttp://public.perforce.com:8080/@md=d&cd=//guest/miki_tebeka/p4py/&c=5Fm@//guest/miki_tebeka/p4py/main/?ac=を使用できます。今のところ83

于 2008-10-06T16:40:48.320 に答える