Thursday, 4 September 2008

installing git (and in particular git-svn on solaris)

This might make you really really glad you use a linux with a sane package manager!
Thanks to anyone who wrote on solving problem on the internet.
That helped!

I had one same^H^H^Himilar issue on cygwin and solaris
I want to use git-svn.

cygwin just had one error "Can't locate SVN/" (git package was installed).
This solved by installing the additional subversion-perl package.
$ cygcheck.exe -l subversion-perl

solaris (as usual! was more difficult) ... :-E

solaris 10 opensolaris/blastwave doesn't have a git package !? :-o (for intel/amd)
So I have git installed using sunfreeware packages
AND make sure all the dependancies are installed from SFW also, see the minor grief I had below missing expat (not for git itself but for getting perl Alien::SVN to compile so I could get git-svn working)

First error "Can't locate" solved easily enough.
$ wget
And copy to somewhere in $PERLLIB path.
$ cp /usr/perl5/vendor_perl/

Next error "Can't locate SVN/"

$ perl -MCPAN -e shell
cpan> install Module::Build
cpan> install Alien::SVN
didn't work :( didn't like /usr/sfw/bin/gmake :(

Manifying blib/man3/Alien::SVN.3
/usr/bin/perl "-Iblib/arch" "-Iblib/lib" Build.PL Build
Too early to specify a build action 'Build'. Do 'Build Build' instead.
gmake: *** [Build] Error 2
/usr/sfw/bin/gmake -- NOT OK

$ cd ~/.cpan/build/Alien-SVN-
$ perl "-Iblib/arch" "-Iblib/lib" Build.PL
## manually enter /usr/sfw/bin/gmake
incidentally, $(/usr/sfw/bin/gmake --version) == "GNU Make 3.81"

$ ./Build
starts building subversion but then argh!
"subversion/libsvn_subr/xml.c", line 34: cannot find include file: <expat.h>

$ pkginfo -l |grep expat
NAME: expat - XML Parser Toolkit
VENDOR: packaged for CSW by Damjan Perenic
NAME: libexpat - XML parser library
DESC: libexpat - XML parser library 1.95.7
$ /usr/sbin/pkgchk -l CSWexpat |grep include
NOTE: Couldn't lock the package database.
Pathname: /opt/csw/include
Pathname: /opt/csw/include/expat.h

meh. :-7 mixing packages from CSW and SFW would be a bit messy
get and install SMCexpat (from sunfreeware)

$ ./Build
looks better, goes further
... but linking problems
cc: Warning: option -- passed to ld

Oh right. It used sun compiler throughout.
Back to configure.
$ perl
Would you like to pass any arguments to configure? [--libdir=/usr/perl5/site_perl/5.8.4/i86pc-solaris-64int/Alien/SVN --prefix=/usr/perl5/5.8.4 ]CC=/usr/sfw/bin/gcc

$ ./Build
Undefined first referenced
symbol in file
libintl_bind_textdomain_codeset /.cpan/build/Alien-SVN-
libintl_bindtextdomain /.cpan/build/Alien-SVN-
libintl_dgettext blame-cmd.o
ld: fatal: Symbol referencing errors. No output written to .libs/svn
collect2: ld returned 1 exit status
gmake: *** [subversion/svn/svn] Error 1
building subversion failed at inc/My/SVN/ line 121.

$ vi src/subversion/Makefile
add -lintl to end of BOTH (:-7) of these lines:
SVN_APR_LIBS = /usr/local/lib/ -lsendfile -lrt -lm -lsocket -lnsl -lresolv -lpthread -lintl
SVN_APRUTIL_LIBS = /usr/local/lib/ -ldb-4.2 -lexpat -liconv -lintl

$ ./Build
$ ./Build install

I bet if I just took the perl files from Cygwin or linux it would have done the same job ... !?

bash$ svn ls https://$MYREPO svn: fatal: relocation error: file /usr/local/lib/ symbol libintl_bindtextdomain: referenced symbol not found


reinstall svn sunfreeware package,

svn okay now but git svn still has lib problems

$ git svn clone https://$MYREPO --trunk=trunk --branches=branches --tags=tags git-hash-object: fatal: relocation error: file /usr/local/bin/git-hash-object: symbol deflateBound: referenced symbol not found
Can't use an undefined value as a symbol reference at /usr/local/lib/perl5/site_perl/5.8.8/ line 421.

HA! deflateBound is in libz

I'm so STUPID! Get zlib from sunfreeware (remember what I said earlier about ALL dependancies!!)

and I'm running with this
$ export LD_LIBRARY_PATH=/usr/local/lib:/usr/sfw/lib:$LD_LIBRARY_PATH
probably don't need that but was picking up libgcc, libiconv from /opt/csw instead of /usr/local

So in conclusion: Alien::SVN (which provides SVN::Core) is quite awkward to build for solaris (gmake, cc vs gcc and lib differences on solaris)

No comments: