colord: fix use of /var

Currently the package is built with /var in $out/var. That fails when it
tries to create/write things at runtime (nix store is read-only).
Instead, tell it to use /var (global directory) and fixup the
installation phase so it doesn't touch /var (leave that for runtime).

This unbreaks the colord dbus service, which apparently is needed by
cups to create color profiles for printers.

(cherry picked from commit 9cdf17e822)
This commit is contained in:
Bjørn Forsman
2016-01-03 20:37:15 +01:00
parent c2b35f9dd3
commit 2732772ae1

View File

@@ -15,14 +15,20 @@ stdenv.mkDerivation rec {
configureFlags = [
"--with-udevrulesdir=$out/lib/udev/rules.d"
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
"--localstatedir=/var"
"--disable-bash-completion"
];
# don't touch /var at install time, colord creates what it needs at runtime
postPatch = ''
sed -i -e "s|if test -w .*;|if false;|" src/Makefile.in
sed -i -e "s|if test -w .*;|if false;|" src/Makefile.am
'';
buildInputs = [ glib polkit pkgconfig intltool gusb libusb1 lcms2 sqlite systemd dbus gobjectIntrospection
bashCompletion argyllcms automake autoconf ];
postInstall = ''
rm -fr $out/var/lib/colord
mkdir -p $out/etc/bash_completion.d
cp -v data/colormgr $out/etc/bash_completion.d
'';