Re: XUL/PHP based Subversion browser & PHP bindings.

From: Date: Sun, 05 Jun 2005 15:33:26 +0000
Subject: Re: XUL/PHP based Subversion browser & PHP bindings.
References: 1 2  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-2419@lists.php.net to get a copy of this message
Wez, having looked through this, and seen the subversion mailing list, it's probably best to remove svn-config from the config.m4... - looks like it's not recommended to use it. It's also worth considering the /sw directory for fink, although I dont know if darwinports uses this or even has subversion. I might even get to test this stuff, I now have a mac-mini in need of ssh ;) Regards Alan On Wed, 2005-06-01 at 15:17 +0200, Ryan Schmidt wrote: > On 01.06.2005, at 05:57, Alan Knowles wrote: > > > These two where released this week > > > > http://pecl.php.net/package/svn > > > > http://www.akbkhome.com/blog.php/View/90/FlexySvn.html > > > > Feel free to test/ make suggestions for improvements (or fix > > anything..) > > Hi Alan. Great to see you continuing to work on this! I'm just starting > a web-based Subversion tool myself (seems like everyone's doing it > these days, so why not me) so I'm sure I'd be able to make good use of > this. I had trouble installing your PHP Subversion bindings though. It > took several hours. I was going to post a reply on your web site... > > http://www.akbkhome.com/blog.php/View/90/FlexySvn.html > > ...explaining how I ended up installing it, since your instructions > left out many steps I had to do. But I think some small code changes > are required, so I thought I would send them to you for inclusion in > the next version. Here's what I was going to post, which will give you > an idea of the problems I had (maybe some of this can be added to your > install documentation): > > ===== > > Since installing this was non-straightforward, I thought I would share > how I did it, on Mac OS X 10.3.9. > > Alan's svn PECL module requires PEAR 1.4.0a1 or better; the latest is > 1.4.0a12. So if your PEAR is set up to only install stable releases > like mine is, you first need to change it to also allow alpha releases, > and then upgrade PEAR: > > pear config-set preferred_state alpha > pear upgrade pear > > I didn't worry about the optional dependencies that got listed. Later > on in the process I was advised that I should have run this, so I did: > > pear channel-update pecl.php.net > > The svn module also requires the Subversion developer libraries which I > didn't have. I had installed Subversion using Fink, so I added the > developer package like this: > > fink install svn-ssl-dev > > The svn module looks for svn-config in /usr/bin, /usr/local/bin, or the > place you specify with the --with-svn switch, but I couldn't figure out > to whom I need to pass the --with-svn switch, so I ended up putting a > symbolic link to svn-config into /usr/local/bin: > > cd /usr/local/bin/ > ln -s /sw/bin/svn-config svn-config > > After upgrading to PEAR 1.4.0a12, "pear install svn" no longer could > find where to download the package from, stating "No releases available > for package 'pear.php.net/svn' / Cannot initialize 'svn', invalid or > missing package file / Package 'svn' is not valid / install failed". So > I had to tell it the URL to download from: > > pear install http://pecl.php.net/get/svn-0.1.tgz > > [more is needed here] > > Don't forget to set the preferred state back to stable, or whatever > you're used to: > > pear config-set preferred_state stable > > ===== > > The reason that [more is needed here] is because when I run that > install command, I get pages of errors, starting with: > > /private/tmp/tmpe5moM0/svn-0.1/php_svn.h:37:24: svn_client.h: No such > file or directory > > I linked the includes into /usr/local/include as well: > > cd /usr/local/include > ln -s /sw/include/subversion-1 subversion-1 > > ...but that didn't change anything. So I looked in your config.m4 and > think I found bugs. It looks like the code to find the correct include > directory is only executed if it can't find the svn-config executable, > which seems wrong to me. I moved that code block after the "fi". The > next problem is that the for loop assumes that if it finds the includes > in a directory, then the libraries will also be there. This is not the > case on my system. Everything is in /sw, yes (/sw/bin, /sw/lib, > /sw/include) but as mentioned above, I have the binaries and includes > symlinked into /usr/local. There are so many libraries however that > it's no good to symlink all of them into /usr/local/lib. In particular, > though, the problem is that while all of the discovered include paths > get into the $PHP_SVN_INCLUDES variable, only the *last* one of these > goes into the $PHP_SVN_LDFLAGS variable. > > Long story (not really) short, I think the supplied patch for the > config.m4 would much improve it. The include- and library-directory > check is now done even if svn-config is found. Directory searching > works better when Subversion includes exist in more than one place (now > it takes the first one found instead of the last one). And /sw is among > the searched directories, because that's where Fink puts things, and > Fink is a popular package distribution system on Mac OS X, and a way > that many Mac OS X users would install Subversion. And I put in some > more AC_MSG_CHECKING()s and AC_MSG_RESULT()s which helped track down > the problem, so it might be useful to leave them in. And I fixed a > small typo in your error message. > > Is svn-config required to install your module? Should the script exit > if it can't find it? Currently it trudges bravely on and throws > additional errors. > --- svn-0.1/config.m4 Mon May 30 01:59:49 2005 +++ svn-0.1-rcs/config.m4 Wed Jun 1 15:06:10 2005 @@ -10,7 +10,7 @@ if test "$PHP_SVN" != "no"; then AC_MSG_CHECKING([for svn-config]) if ! test -x $PHP_SVN ; then - for i in $PHP_SVN /usr/local/bin /usr/bin ; do + for i in $PHP_SVN /sw/bin /usr/local/bin /usr/bin ; do if test -x $i/svn-config ; then PHP_SVN=$i/svn-config break; @@ -26,25 +26,31 @@ AC_MSG_RESULT([not found]) AC_MSG_WARN([ Did not find svn-config; please ensure that you have installed -the svn developer package or equivalent for you system. +the svn developer package or equivalent for your system. ]) - PHP_SVN_INCLUDES="" - for i in $PHP_SVN /usr/local /usr ; do + fi + AC_MSG_CHECKING([for svn includes]) + for i in $PHP_SVN /sw /usr/local /usr ; do if test -r $i/include/subversion-1/svn_client.h ; then - PHP_SVN_INCLUDES="$PHP_SVN_INCLUDES -I$i/include/subversion-1" + PHP_SVN_INCLUDES="-I$i/include/subversion-1" PHP_SVN_LDFLAGS="-L$i/lib" if test -d $i/lib64 ; then PHP_SVN_LDFLAGS="-L$i/lib64 $PHP_SVN_LDFLAGS" fi PHP_SVN_LDFLAGS="$PHP_SVN_LDFLAGS -lsvn_client-1 -lapr-0" + break; fi + done + for i in $PHP_SVN /sw /usr/local /usr ; do if test -r $i/include/apr-0/apr.h ; then PHP_SVN_INCLUDES="$PHP_SVN_INCLUDES -I$i/include/apr-0" elif test -r $i/include/apache2/apr.h ; then PHP_SVN_INCLUDES="$PHP_SVN_INCLUDES -I$i/include/apache2" fi done - fi + AC_MSG_RESULT($PHP_SVN_INCLUDES) + AC_MSG_CHECKING([for svn libraries]) + AC_MSG_RESULT($PHP_SVN_LDFLAGS) PHP_CHECK_LIBRARY(svn_client-1,svn_client_create_context, [

« previous php.pecl.dev (#2419) next »