libgit2 / php-git

PHP bindings for libgit2
http://libgit2.github.com
MIT License
563 stars 118 forks source link

PHP-GIT does not compile #46

Closed brianlayman closed 10 years ago

brianlayman commented 11 years ago

I've spent several hours trying to get some version of this to compile. I've even tried older version of the repo, and only hit other walls. If anyone can get this to compile I would be extremely appreciative of the instruction set - even if it involves source changes.

So here is the repo README.md instructions:

git clone https://github.com/libgit2/php-git.git --recursive
 cd libgit2
 mkdir build && cd build
 cmake ..
 cmake -DBUILD_SHARED_LIBS=OFF -build .
 make
 cd ../../
 phpize
 ./configure
 make
 make install
 sudo make install
 # add `extension=git2.so` to your php.ini

Line 2 bombs, so I assume it should be cd php-git/libgit2

That works fine till you get down to the make command which bombs out with syntax error:

Linking C static library libgit2.a
[ 25%] Built target git2
[ 26%] Generating ../tests-clar/clar_main.c, ../tests-clar/clar.h
  File "clar", line 65
    self.clar_path = os.path.abspath(clar_path) if clar_path else None
                                                 ^
SyntaxError: invalid syntax
make[2]: *** [../tests-clar/clar_main.c] Error 1
make[1]: *** [CMakeFiles/libgit2_clar.dir/all] Error 2
make: *** [all] Error 2

If I try other revisions I get different errors, but I don't want to cloud the issue.

As with anything, this issue is somewhat urgent. Any help would certainly be appreciated!

chobie commented 11 years ago

@brianlayman sorry to late response. can you tell me your environment? i could compile it with my machine. clar test framework requires python as i known.

$ python --version
Python 2.7.3

$ uname -a
Linux devbox 3.2.0-35-generic #55-Ubuntu SMP Wed Dec 5 17:42:16 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc-4.6.real
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) 
brianlayman commented 11 years ago

@chobie Thanks for your reply. This server has Python 2.4.3 - though I can dual install 2.7.3 if needed. I wonder if that's it. Though would that cause a syntax error to be spit out of make?

uname -a

Linux hosting.example.com 2.6.32-042stab075.2 #1 SMP Tue Mar 5 15:21:53 MSK 2013 i686 i686 i386 GNU/Linux

gcc -v

Using built-in specs. Target: i386-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux Thread model: posix gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)

onlinecco commented 10 years ago

having the same issue. Python is the newest version.

Upgrading gcc 4.1.2 to 4.4.7...still doesn't work

chobie commented 10 years ago

Python is the newest version.

what is your python version? at least clar requires 2.5 above.

onlinecco commented 10 years ago

like i said my python's version is 2.7

chobie commented 10 years ago

@onlinecco could you report specifically? python also has 3.x version. so I can't figured out which version have you used.

It seems different problem at this time because you have used python 2.7. for now, can you copy & paste your build error here?