hashdist/hashdist — pull request #226 by dagss (2014-04-11 10:27:40+00:00)
Title: Support for building packages with relative paths

There's now a `defaults` section in package YAML files that can be used to pre-populate a default for any parameter. This can be used to set the relocateable property to `false`:

```
defaults:
relocateable: false
```

This has to be done e.g. for ncurses as it hard-codes paths to resource files.

For packages that are relocateable, I've added a bunch of tools to `hit build-postprocess`. Some of them are always called, others are called in stages in Hashstack (this may be messy but I'm divided on where the best place to put postprocessing is). The effect in total for relative packages is:

* Linux only: Automatically scan for executable ELF RPATH files and rewrite them.

* Rewrite symlinks that point to the absolute artifact locations and make them relative.

* Symlinks that point outside the artifact raises an error

* Automatically rewrite shell scripts to find the artifact path at run-time instead of install-time (e.g., `bin/*-config` in libpng)

* Remove pkgconfig `lib/pkgconfig/*.pc` files (as they mention the absolute path from install-time)

* A check is run in the end scanning for the absolute path to the artifact in files; any mention of the absolute path raises an error.

At least for now there's no direct unit tests of these tools but it is rather well tested through Hashstack.