Monday, September 30, 2013

I finally get it

I have spent too long wondering why things were harder in apt than I wished they were. Mainly this involves my constant complaint that a package could somehow install without the documentation, and not knowing if it's possible to configure synaptic to honor 'suggests' hints, and automatically install -dev and -doc for any selection. I now finally understand apt-get source and apt-get build-dep, which go a long way toward allaying my problems.

In the past, what I had done was something similar to

apt-get install package

and if package was unfortunately lagging (sbcl is a prime example where the repositories kept an old version, but anything under active development is going to have this issue) I would clone a git repo and build myself. Now, the development tree assumes, you know, that you have current versions of all the development tools, and all the development headers for all the dependencies. Since I had run off the apt track, I regressed ten years back and started package hunting, configure, scratch head, read error message, find next dependency, configure, scratch head...

Remember, this is the problem these package managers were supposed to solve. So I now see how it is solved.

apt-get source package
(does not need privileges) downloads the patched sources to build the binary version in dpkg. This is great, you can modify the options a little, but still let dpkg know you have a version installed for this (to prevent a stupid binary being installed into /usr when the live version is in /usr/bin). However, it still gives me the stable/stale version. So this is where the next part comes in handy.

apt-get build-dep package
will make sure that you have a workable toolchain to satisfy configure's needs. Now I clone the latest and greatest from git or svn, and apt-get build-dep package, and then I'm having nearly an 100% success ratio in building. I always knew the debian tools were the best, I had only forgotten why.

No comments: