Darwin Ports Pextlib Problem

I decided to try Darwin Ports out today. I’ve used Fink in the past but I hate the fact that their unstable distro is source only. Try installing anything on fink and not having TeX build for an hour. So reacting on the bad taste that fink always leaves me with I set out installing Ports from source (since I want it in /usr/local/ports and not crappy “/opt”).

Everything appeared to install with no errors but when I’d run “port” I’d get this:

$ port sync
can't find package Pextlib 1.0
    while executing
"package_native require Pextlib 1.0"
    ("eval" body line 1)
    invoked from within
"eval package_native $args"
    (procedure "package" line 14)
    invoked from within
"package require Pextlib 1.0"
    (procedure "dportinit" line 310)
    invoked from within
"dportinit ui_options global_options global_variations"
Error: /usr/local/ports/bin/port: Failed to initialize ports system, can't find package Pextlib 1.0

Web searching turned up nothing helpful

After playing around and brushing up on my Tcl I discovered that /usr/local/ports/share/darwinports/Tcl/pextlib1.0/pkgIndex.tcl contained only a comment:

 # Tcl package index file, version 1.1
 # This file is generated by the "pkg_mkIndex" command
 # and sourced either when an application starts up or
 # by a "package unknown" script.  It invokes the
 # "package ifneeded" command to set up package-related
 # information so that packages will be loaded automatically
 # in response to "package require" commands.  When this
 # script is sourced, the variable $dir must contain the
 # full path name of this file's directory.

Seems something got screwed up in the installation process and didn’t generate the pkgIndex.tcl file correctly. On a hunch I checked and discovered I had an old PowerPC tcl sitting in /usr/local/bin (and not stowed — I hate stupid Mac installers that install into /usr/local. That is *my* directory). I deleted all the Tcl-ish things in


(and didn’t find anything anywhere else, oddly enough), reinstalled Darwin Ports, and it worked! Yay.

Now I’ll see if it’s worth the 2 hours I spent debugging. 🙂

Last Modified on: Dec 31, 2014 18:59pm