Packaging the gitit wiki for pkgsrc work in progress
Notes gathered while trying to package a Haskell wiki engine and its dependency tree for pkgsrc. This is work in progress, written down so the next attempt starts further along.
Why this is fiddly
A package that is written in Haskell tends to depend on a long chain of small libraries. Each library has its own version bounds, and a build only succeeds when the whole set agrees. On a platform where the language toolchain is not part of the base system, every link in that chain has to be described as a package before the program itself can be built.
The usual shape of a pkgsrc package
- A makefile that names the program, its version and its home page.
- A distribution file with the archive name and a checksum.
- A patch set for anything that needs adjusting for the platform.
- A list of dependencies, split into build time and run time.
Approach that avoided dead ends
- Resolve the dependency tree first and add the leaf libraries as packages before anything that depends on them.
- Pin versions in the package makefiles so a later library update cannot silently break the build.
- Build in a clean environment each time, because stale artefacts hide exactly the problems the package is meant to catch.
- Keep every local change as a small patch, so it is obvious what was changed and why when a new upstream release arrives.
Status
This page is a living note. The package descriptions and their patches live in the work in progress tree while they are still moving. Once a set builds from a clean checkout, the pieces are proposed upstream and this note shrinks accordingly.
Background reading on packaging is collected on the resources page.