From owner-freebsd-ports@FreeBSD.ORG Fri Jul 24 04:47:09 2009 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 570AE1065670 for ; Fri, 24 Jul 2009 04:47:09 +0000 (UTC) (envelope-from bennett@cs.niu.edu) Received: from mp.cs.niu.edu (mp.cs.niu.edu [131.156.145.41]) by mx1.freebsd.org (Postfix) with ESMTP id 1BA5A8FC19 for ; Fri, 24 Jul 2009 04:47:08 +0000 (UTC) (envelope-from bennett@cs.niu.edu) Received: from mp.cs.niu.edu (bennett@localhost [127.0.0.1]) by mp.cs.niu.edu (8.14.3/8.14.3) with ESMTP id n6O4l720028911; Thu, 23 Jul 2009 23:47:07 -0500 (CDT) Date: Thu, 23 Jul 2009 23:47:07 -0500 (CDT) From: Scott Bennett Message-Id: <200907240447.n6O4l7la028910@mp.cs.niu.edu> To: m.seaman@infracaninophile.co.uk Cc: freebsd-ports@freebsd.org Subject: Re: needing install OpenOffice.org without messing up perl X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 04:47:09 -0000 On Wed, 22 Jul 2009 22:44:08 +0100 Matthew Seaman wrote: >Lowell Gilbert wrote: >> Scott Bennett writes: > >>> Why wouldn't OOo, once installed, simply use whatever were >>> installed as /usr/local/bin/perl? >>=20 >> Because perl doesn't tend to be backwards-compatible. > >Untrue. > >perl as a language is generally very good at backwards compatibility. The= >re is >new syntax available in 5.10, but it's pretty much a superset of 5.8, so = >existing >perl programs should "just work"(tm). In fact, I've not seen any problem= >s on a >swathe of machines I've updated. > >{{{ > Aside:: > >The problem comes for applications that embed a perl interpreter. Meanin= >g >they dynamically link against libperl.so. OpenOffice doesn't do this as = >far >as I can tell, but eg. snmpd does: > >happy-idiot-talk:~:% ldd /usr/local/sbin/snmpd=20 >/usr/local/sbin/snmpd: > libnetsnmpagent.so.16 =3D> /usr/local/lib/libnetsnmpagent.so.16 (= >0x28082000) > libnetsnmphelpers.so.16 =3D> /usr/local/lib/libnetsnmphelpers.so.= >16 (0x280c5000) > libnetsnmpmibs.so.16 =3D> /usr/local/lib/libnetsnmpmibs.so.16 (0x= >280e6000) > libwrap.so.5 =3D> /usr/lib/libwrap.so.5 (0x2819b000) > libnetsnmp.so.16 =3D> /usr/local/lib/libnetsnmp.so.16 (0x281a2000= >) > libcrypto.so.5 =3D> /usr/local/lib/libcrypto.so.5 (0x2824f000) > libelf.so.1 =3D> /usr/lib/libelf.so.1 (0x28397000) > libkvm.so.4 =3D> /lib/libkvm.so.4 (0x283c0000) > libdevstat.so.6 =3D> /lib/libdevstat.so.6 (0x283c8000) > libperl.so =3D> /usr/local/lib/perl5/5.10.0/mach/CORE/libperl.so = >(0x283cd000) <<<<--**** > libm.so.5 =3D> /lib/libm.so.5 (0x284fd000) > libcrypt.so.4 =3D> /lib/libcrypt.so.4 (0x28512000) > libutil.so.7 =3D> /lib/libutil.so.7 (0x2852b000) > libc.so.7 =3D> /lib/libc.so.7 (0x28539000) > libz.so.4 =3D> /lib/libz.so.4 (0x2863b000) > libthr.so.3 =3D> /lib/libthr.so.3 (0x2864d000) > >That is dependent on the version of perl installed -- not just because th= >e >version number is embedded in the path to the shlib, but also because the= > >ABI can change between different versions. In this case, you would have = >no >alternative but to recompile the app to link against a different version = >of >perl. > >}}} > >One way to fix the problem of dragging in an unwanted version of perl whe= >n >using precompiled packages for OpenOffice is to do the following: > > 0) I'm assuming perl-5.10 is already installed > > i) Download the openoffice package you want to install. > > # setenv PKG_SITES 'ftp.freebsd.org other.site.org third.site.org' > # pkg_fetch openoffice.org-3.1.0_2 > > ii) Install all required dependencies for OpenOffice /except/ for > perl-5.8 for the package you downloaded: > > # pkg_info -qr ./openoffice.org-3.1.0_2.tbz | grep -v perl | \ > cut -d ' ' -f 2 | xargs portinstall=20 > > iii) Install the OpenOffice package without dependencies: > > # pkg_add -i ./openoffice.org-3.1.0_2.tbz > > iv) Use pkgdb to fix the dependency linkages: > > # pkgdb -F >=20 > (when prompted, substitute perl-5.10 instead of the missing perl-= >5.8 > dependency)=20 > >However, this is quite an inelegant approach which involves spending far = >too >much effort (It's also untested by me and quite possibly won't work at al= >l...). Nevertheless, I'll hang onto your message in case I end up needing to try something like your procedure above. Thank you very much for that. >You'ld have to do the same thing all over again if ever you need to upgra= >de >OpenOffice. Chances are some of the dependencies you install at stage (i= True enough. OOo is such a pain to deal with that I normally do *not* upgrade OOo between releases of FreeBSD. When I install/upgrade to a new FreeBSD release, all the packages and ports are supposed to get trashed and reinstalled anyway. In between releases, I have generally kept OOo ignored in /etc/portupgrade.conf. I have also often done the same for all of the X11-related stuff and only commented out those lines in /etc/portupgrade.conf when I had the time and/or need to update that software because it takes so many hours to rebuild and often needs intervention before it completes. I've now learned the lesson that perl should not be upgraded either when I can avoid doing so. >i) >will have been updated in ports after the openoffice.org package was buil= >t: >this should do no more than cause some warning messages and maybe make yo= >u do >a bit more work at stage (iv). Or it could just make everything break ho= >rribly. :-} > >Note: this *won't* work in the general case -- it relies on perl scripts = >being >compatible across different versions. Using this approach to make arbitr= >ary >substitutions in the dependencies of a package will almost certainly end = >in >tears before bedtime. > My experience has been more like tears six to twelve hours *past* bedtime when I needed to have slept enough to get up and take care of some other commitment. :-( Thanks again for the procedure you suggested above. I may have to attempt it. Scott Bennett, Comm. ASMELG, CFIAG ********************************************************************** * Internet: bennett at cs.niu.edu * *--------------------------------------------------------------------* * "A well regulated and disciplined militia, is at all times a good * * objection to the introduction of that bane of all free governments * * -- a standing army." * * -- Gov. John Hancock, New York Journal, 28 January 1790 * **********************************************************************