A Plea to Reduce Dependences (e.g., for swig)
M.E. O'Neill
oneill at cs.hmc.edu
Tue Aug 16 12:23:44 PDT 2011
Many MacPorts packages depend on other MacPorts packages of software that already exists on a Mac OS X system, such as
perl5
bison
m4
openssl
bzip2
zip
ncurses
and so on. I realize that some users may want to run the latest and greatest versions of everything, but in a lot of cases, a user has one particular package they want to install, and doing so seems to require a cascade of other packages be dragged in.
For example, I recently wanted to install swig (because a system-supplied swig has vanished in Lion/Xcode 4.1).
By default, swig has build dependences on bison and gsed. Yet swig builds fine on stock OS X, so special versions of bison and gsed are *NOT* required. If I remove these build dependences by hand (and remove the line that edits the configure script to use gsed rather than sed), everything still builds just fine.
Swig also has a library dependency on pcre, but pcre wants to pull in readline, zlib, bzip2. Readline pulls in ncurses.
Thus, if I decide to install just swig, the dependency chain indicates that it would pull in:
swig
+ bison, gsed, pcre
+ gettext, m4, libiconv, readline, zlib, bzip2
+ ncurses, expat, gperf
+ ncursesw
But we're only just getting started. The Portfile for swig only provides a minimal swig core that is nonfunctional by itself; it strips out the actual support for different programming languages so that support for each language can be provided in separate packages. Individual language-support packages have their own dependences.
If I wanted a version that supported Python, Perl and Java (languages provided with OS X), it appears that the install would pull in the following:
swig, swig-perl, swig-python, swig-java+
+ bison, gsed, pcre, swig, perl5, python_select, kaffe
+ gettext, m4, libiconv, readline, zlib, bzip2, perl5.12, jikes, pkgconfig, esound, gmp, gtk2, libart_lgpl, freetype, xorg-libXtst, xorg-libsm
+ ncurses, expat, gperf, glib2, audiofile, atk, pango, gdk-pixbuf2, xorg-libXi, xorg-libXrandr, xorg-libXcursor, xorg-libXinerama, xorg-libXdamage, xorg-libXcomposite, xorg-libXfixes, shared-mime-info, xorg-libXext, xorg-recordproto, xorg-xtrans, xorg-libice
+ ncursesw, autoconf, automake, libtool, gtk-doc, cairo, Xft2, libpng, jasper, tiff, xorg-inputproto, xorg-libX11, xrender, xorg-randrproto, xorg-fixesproto, xorg-renderproto, xorg-xineramaproto, xorg-damageproto, xorg-compositeproto, xorg-xextproto, intltool, libxml2, xorg-util-macros, xorg-xproto
+ help2man, gnome-doc-utils, rarian, docbook-xml, docbook-xsl, python27, py27-libxml2, libpixman, fontconfig, xorg-xcb-util, unzip, jpeg, xorg-bigreqsproto, xorg-xcmiscproto, xorg-xf86bigfontproto, xorg-libXdmcp, xorg-libXau, xorg-libxcb, xorg-kbproto, gnome-common, p5.12-xml-parser, p5.12-getopt-long, p5.12-pathtools, p5.12-scalar-list-utils
+ p5.12-locale-gettext, libxslt, iso-codes, getopt, docbook-xml-4.1.2, docbook-xml-4.2, docbook-xml-4.3, docbook-xml-4.4, docbook-xml-4.5, docbook-xml-5.0, xmlcatmgr, openssl, sqlite3, db46, gdbm, xorg-xcb-proto, xorg-libpthread-stubs
It may be that things aren't so bad as this (I just wrote a script to follow the dependency chain reported by port reps, and didn't check variants etc.), but past experience has taken me into exactly this kind of hell.
With a couple of judicious edits to the Portfile, I created a version of swig removed the unnecessary dependencies and didn't strip out the language support (essentially having working versions of swig-tcl, swig-perl, swig-python, swig-java, swig-ruby, swig-php5 and slightly broken versions of all the others). All it really required was pcre, and pcre didn't need many of its claimed dependencies.
I likewise had a similar issue recently building cmake, which has the following dependency chain:
cmake
+ libidn, openssl
+ libiconv, gettext, zlib
+ gperf, ncurses, expat
+ ncursesw
Again, cmake does *not* really need the very latest and greatest openssl, and it builds very happily without libidn (surprisingly enough, my use of cmake doesn't really need to worry about unicode characters in domain names).
On the positive side, there is a certain sense of personal fulfillment that comes from battling MacPorts and preventing it from installing duplicated and unnecessary software I neither need nor want, but it would sure be nice if I didn't have to. (I get a similar feeling frustration and mild accomplishment from forcing MacPorts against its will not to build things as root.)
So, please consider this a plea to give users like me a way to just install the software we actually want and rely as much as possible on what is already there and working quite-well-enough-thank-you on the system.
Best regards,
M.E.O.
P.S. Here are the dependencies for each of the swig modules.
swig-allegro
+ bison, gsed, allegro
+ gettext, m4, libiconv, cmake
+ ncurses, expat, gperf, libidn, openssl
+ ncursesw, zlib
swig-chicken
+ bison, gsed, chicken
+ gettext, m4, libiconv
+ ncurses, expat, gperf
+ ncursesw
swig-clisp
+ bison, gsed, clisp
+ gettext, m4, libiconv, readline, libsigsegv
+ ncurses, expat, gperf
+ ncursesw
swig-csharp
+ bison, gsed, mono
+ gettext, m4, libiconv, pkgconfig, gawk, glib2, zlib, libgdiplus, xorg-libX11
+ ncurses, expat, gperf, readline, autoconf, automake, libtool, perl5, jpeg, tiff, giflib, libpng, fontconfig, libexif, cairo, xorg-libsm, xrender, xorg-util-macros, xorg-xtrans, xorg-bigreqsproto, xorg-xcmiscproto, xorg-xextproto, xorg-xf86bigfontproto, xorg-inputproto, xorg-libXdmcp, xorg-libXau, xorg-libxcb, xorg-xproto, xorg-kbproto
+ ncursesw, help2man, perl5.12, freetype, libpixman, xorg-xcb-util, xorg-libice, xorg-renderproto, xorg-xcb-proto, xorg-libpthread-stubs, python27
+ p5.12-locale-gettext, bzip2, libxml2, openssl, sqlite3, db46, gdbm, python_select
swig-gcj
+ bison, gsed, gcc44
+ gettext, m4, libiconv, gmp, mpfr, gcc_select
+ ncurses, expat, gperf, xz
+ ncursesw
swig-go
+ bison, gsed, go
+ gettext, m4, libiconv, mercurial, gmake, gawk, ed
+ ncurses, expat, gperf, python26, curl-ca-bundle, readline
+ ncursesw, zlib, openssl, sqlite3, db46, gdbm, bzip2, python_select, perl5
+ perl5.12
swig-guile
+ bison, gsed, guile
+ gettext, m4, libiconv, readline, libtool, gmp
+ ncurses, expat, gperf, automake
+ ncursesw, autoconf, perl5
+ help2man, perl5.12
+ p5.12-locale-gettext
swig-java
+ bison, gsed, kaffe
+ gettext, m4, libiconv, jikes, pkgconfig, esound, gmp, gtk2, libart_lgpl, freetype, xorg-libXtst, xorg-libsm
+ ncurses, expat, gperf, glib2, audiofile, perl5, atk, pango, gdk-pixbuf2, xorg-libXi, xorg-libXrandr, xorg-libXcursor, xorg-libXinerama, xorg-libXdamage, xorg-libXcomposite, xorg-libXfixes, shared-mime-info, zlib, bzip2, xorg-libXext, xorg-recordproto, xorg-xtrans, xorg-libice
+ ncursesw, autoconf, automake, libtool, perl5.12, gtk-doc, cairo, Xft2, libpng, jasper, tiff, xorg-inputproto, xorg-libX11, xrender, xorg-randrproto, xorg-fixesproto, xorg-renderproto, xorg-xineramaproto, xorg-damageproto, xorg-compositeproto, xorg-xextproto, intltool, libxml2, xorg-util-macros, xorg-xproto
+ help2man, gnome-doc-utils, rarian, docbook-xml, docbook-xsl, python27, py27-libxml2, libpixman, fontconfig, xorg-xcb-util, unzip, jpeg, xorg-bigreqsproto, xorg-xcmiscproto, xorg-xf86bigfontproto, xorg-libXdmcp, xorg-libXau, xorg-libxcb, xorg-kbproto, gnome-common, p5.12-xml-parser, p5.12-getopt-long, p5.12-pathtools, p5.12-scalar-list-utils
+ p5.12-locale-gettext, libxslt, iso-codes, getopt, docbook-xml-4.1.2, docbook-xml-4.2, docbook-xml-4.3, docbook-xml-4.4, docbook-xml-4.5, docbook-xml-5.0, xmlcatmgr, openssl, sqlite3, db46, gdbm, readline, python_select, xorg-xcb-proto, xorg-libpthread-stubs
swig-lua
+ bison, gsed, lua
+ gettext, m4, libiconv, readline
+ ncurses, expat, gperf
+ ncursesw
swig-mzscheme
+ bison, gsed, mzscheme
+ gettext, m4, libiconv, jpeg, libpng
+ ncurses, expat, gperf, zlib
+ ncursesw
swig-ocaml
+ bison, gsed, ocaml
+ gettext, m4, libiconv
+ ncurses, expat, gperf
+ ncursesw
swig-octave
+ bison, gsed, octave
+ gettext, m4, libiconv, gawk, perl5, texinfo, gcc44, arpack, curl, fftw-3, fftw-3-single, ftgl, ghostscript, glpk, GraphicsMagick, gnuplot, hdf5-18, metis, ncurses, pcre, readline, qhull, qrupdate, SuiteSparse, atlas
+ expat, gperf, perl5.12, xz, gmp, mpfr, gcc_select, pkgconfig, zlib, libidn, openssl, curl-ca-bundle, freetype, autoconf, automake, libtool, fontconfig, jpeg, libpaper, libpng, tiff, xorg-libXext, xorg-libXt, libxml2, bzip2, lcms, gd2, pdflib, xpm, aquaterm, szip, ncursesw, cmake, gzip
+ glib2, help2man, xorg-util-macros, xorg-libX11, xorg-xextproto, xorg-libsm, xorg-xproto
+ p5.12-locale-gettext, xorg-xtrans, xorg-bigreqsproto, xorg-xcmiscproto, xorg-xf86bigfontproto, xorg-inputproto, xorg-libXdmcp, xorg-libXau, xorg-libxcb, xorg-kbproto, xorg-libice
+ xorg-xcb-proto, xorg-libpthread-stubs, python27
+ sqlite3, db46, gdbm, python_select
swig-perl
+ bison, gsed, perl5
+ gettext, m4, libiconv, perl5.12
+ ncurses, expat, gperf
+ ncursesw
swig-php5
+ bison, gsed, php5
+ gettext, m4, libiconv, pkgconfig, autoconf213, libtool, libxml2, bzip2, mhash, pcre, readline, zlib, apache2
+ ncurses, expat, gperf, glib2, perl5, gawk, automake, apr, apr-util, openssl
+ ncursesw, autoconf, perl5.12, db46, sqlite3
+ help2man
+ p5.12-locale-gettext
swig-pike
+ bison, gsed, pike
+ gettext, m4, libiconv, bzip2, zlib, gmp, nettle
+ ncurses, expat, gperf
+ ncursesw
swig-python
+ bison, gsed, python_select
+ gettext, m4, libiconv
+ ncurses, expat, gperf
+ ncursesw
swig-r
+ bison, gsed, R
+ gettext, m4, libiconv, icu, glib2, jpeg, pango, readline, tcl, tk, tiff, xorg-libXmu, xorg-libXScrnSaver, gcc44
+ ncurses, expat, gperf, autoconf, automake, libtool, zlib, perl5, pkgconfig, cairo, Xft2, xorg-libXext, xorg-libXt, xorg-scrnsaverproto, gmp, mpfr, gcc_select
+ ncursesw, help2man, perl5.12, libpixman, fontconfig, freetype, libpng, xrender, xorg-xcb-util, xorg-util-macros, xorg-libX11, xorg-xextproto, xorg-libsm, xz
+ p5.12-locale-gettext, bzip2, xorg-renderproto, xorg-libxcb, xorg-xproto, xorg-xtrans, xorg-bigreqsproto, xorg-xcmiscproto, xorg-xf86bigfontproto, xorg-inputproto, xorg-libXdmcp, xorg-libXau, xorg-kbproto, xorg-libice
+ xorg-xcb-proto, xorg-libpthread-stubs, python27
+ libxml2, openssl, sqlite3, db46, gdbm, python_select
swig-ruby
+ bison, gsed, ruby
+ gettext, m4, libiconv, readline, openssl, zlib, ncurses
+ expat, gperf, ncursesw
swig-tcl
+ bison, gsed, tcl
+ gettext, m4, libiconv
+ ncurses, expat, gperf
+ ncursesw
More information about the macports-dev
mailing list