Urania

A blog named for the muse of Astronomy containing musings by an astronomer

Archive for December 5th, 2008


Installing old libxml2 ports with MacPorts 0

Posted on December 05, 2008 by Juan

There is a problem with libxml2 from version 2.7.1 onward where it completely deletes any greater than (>) and less than symbols (<) sent to it. This is messing up my blog posting unless I do it within the WordPress interface since attempts to use xmlrpc.php use PHP, which is compiled against libxml2, and thus the posting gets mangled.

The solution suggested on the PHP boards is to compile PHP against expat. This would be kind of a pain for me since I am using the MacPorts install of PHP. So I looked into rolling back to an earlier version of libxml2 using MacPorts. The solution was originally outlined in this blog post by Stephen Chu on how to install earlier versions of ruby under DarwinPorts, I have updated it for MacPorts. The key is to create a local MacPorts repository with the version of the port you want copied over to it.

  1. First I identified the version of the libxml2 portfile I wanted by going to http://trac.macports.org/browser/trunk/dports/textproc/libxml2/Portfile and entering revisions into the “View revision” box until I found the appropriate version of the Portfile linking to libxml2 2.6.32 instead of 2.7.1. This turned out to be revision 40211 (actually 39551).
  2. I created a directory to contain my MacPorts repository at /Users/Shared/dports/ and after creating that directory, I edited the MacPorts configuration file /opt/local/etc/macports/sources.conf to include the line:

    file:///Users/Shared/dports

    and you should make this line appear before the “rsync” or svn” port listing in the config file, otherwise it defaults to using that version of the port during the install.

  3. I then installed the old libxml2 port into my local MacPorts respository using subversion:

    svn co --revision 40211 http://trac.macports.org/browser/trunk/dports/textproc/libxml2/ textproc/libxml2/
    
    and then I updated the MacPorts index:

    portindex /Users/Shared/dports

    With this done, I can see the two versions of libxml2 in my ports list, when I issue a

    port list libxml2

    the result is:

    libxml2 @2.7.2 textproc/libxml2 libxml2 @2.6.32 textproc/libxml2

    showing the current libxml2 version in MacPorts and the older one in my repository.

  4. Now I can install the older version of libxml2 by first forcing removal of the current version and then installing the old version:

    sudo port -f uninstall libxml2 @2.7.2_1+darwin_9 sudo port install libxml2 @2.6.32

    [Warning: Unless you place the file:///Users/Shared/dports line before any rsync/svn lines of the config file noted in step 2, this port install command installs the current version instead of the old version]

  5. I had to forcible uninstall and then reinstall libxslt but then my reinstall of php within MacPorts went fine. And I can now use WordPress again without any issues when using a remote blog editor.

I just figured in case anyone else wanted to use an older MacPort port they could use this to figure out how.

MacPorts Misbehavior Update 0

Posted on December 05, 2008 by Juan

FreeType issues under Leopard Resolved: The MacPorts installation of FreeType will now compile a version under Leopard that does NOT throw a

The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.

error when fonts are used in PHP routines (fuller notes on this problem here although with my “hacked” fix, which is no longer needed). This problem as originally reported under Trouble Ticket #15909 on MacPorts.

Careful with that Apache2 upgrade, Eugene: I also discovered I have to be careful when updating apache2 under MacPorts in that it actually wiped out some of the configuration files stored in /opt/local/apache2/conf/, specifically it overwrote my modified versions of the /opt/local/apache2/conf/extra/httpd-dav.conf file and /opt/local/apache2/conf/extra/http-userdir.conf files. So now I am keeping copies of everything in /opt/local/apache2/conf backed up so I can roll back my changes after an upgrade of apache2 in MacPorts.



↑ Top