1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/x11-misc/colord/colord-1.2.11.ebuild,v 1.1 2015/07/05 08:43:40 pacho Exp $
8 VALA_USE_DEPEND="vapigen"
10 inherit autotools bash-completion-r1 check-reqs eutils gnome2 user systemd udev vala multilib-minimal
12 DESCRIPTION="System service to accurately color manage input and output devices"
13 HOMEPAGE="http://www.freedesktop.org/software/colord/"
14 SRC_URI="http://www.freedesktop.org/software/colord/releases/${P}.tar.xz"
17 SLOT="0/2" # subslot = libcolord soname version
18 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
20 # We prefer policykit enabled by default, bug #448058
21 IUSE="argyllcms examples extra-print-profiles +gusb +introspection +policykit scanner systemd +udev vala"
25 vala? ( introspection )
30 >=dev-libs/glib-2.36:2[${MULTILIB_USEDEP}]
31 >=media-libs/lcms-2.6:2=[${MULTILIB_USEDEP}]
32 argyllcms? ( media-gfx/argyllcms )
33 gusb? ( >=dev-libs/libgusb-0.2.2[introspection?,${MULTILIB_USEDEP}] )
34 introspection? ( >=dev-libs/gobject-introspection-0.9.8:= )
35 policykit? ( >=sys-auth/polkit-0.103 )
37 media-gfx/sane-backends
39 systemd? ( >=sys-apps/systemd-44:0= )
43 virtual/libudev:=[${MULTILIB_USEDEP}]
46 RDEPEND="${COMMON_DEPEND}
47 !media-gfx/shared-color-profiles
48 !<=media-gfx/colorhug-client-0.1.13
50 DEPEND="${COMMON_DEPEND}
52 >=dev-util/gtk-doc-am-1.9
53 >=dev-util/intltool-0.35
54 >=sys-devel/gettext-0.17
55 virtual/pkgconfig[${MULTILIB_USEDEP}]
56 extra-print-profiles? ( media-gfx/argyllcms )
57 vala? ( $(vala_depend) )
60 # FIXME: needs pre-installed dbus service files
63 # According to upstream comment in colord.spec.in, building the extra print
64 # profiles requires >=4G of memory
68 use extra-print-profiles && check-reqs_pkg_pretend
72 use extra-print-profiles && check-reqs_pkg_setup
74 enewuser colord -1 -1 /var/lib/colord colord
78 # Adapt to Gentoo paths
79 sed -i -e 's/spotread/argyll-spotread/' \
80 src/sensors/cd-sensor-argyll.c \
83 epatch "${FILESDIR}"/${P}-multiple-users.patch
86 use vala && vala_src_prepare
90 multilib_src_configure() {
91 # Reverse tools require gusb
92 # bash-completion test does not work on gentoo
94 --disable-bash-completion
97 --enable-libcolordcompat
98 --with-daemon-user=colord
99 --localstatedir="${EPREFIX}"/var
100 $(multilib_native_use_enable argyllcms argyllcms-sensor)
101 $(multilib_native_use_enable extra-print-profiles print-profiles)
102 $(multilib_native_usex extra-print-profiles COLPROF="$(type -P argyll-colprof)" "")
104 $(multilib_native_use_enable gusb reverse)
105 $(multilib_native_use_enable introspection)
106 $(multilib_native_use_enable policykit polkit)
107 $(multilib_native_use_enable scanner sane)
108 $(multilib_native_use_enable systemd systemd-login)
110 --with-udevrulesdir="$(get_udevdir)"/rules.d
111 $(multilib_native_use_enable vala)
112 "$(systemd_with_unitdir)"
115 if ! multilib_is_native_abi; then
116 # disable some extraneous checks
118 SQLITE_{CFLAGS,LIBS}=' '
119 GUDEV_{CFLAGS,LIBS}=' '
124 gnome2_src_configure "${myconf[@]}"
127 multilib_src_compile() {
128 if multilib_is_native_abi; then
132 use gusb && emake -C lib/colorhug
137 multilib_src_test() {
138 if multilib_is_native_abi; then
141 emake -C lib/colord check
142 use gusb && emake -C lib/colorhug check
143 emake -C lib/compat check
147 multilib_src_install() {
148 if multilib_is_native_abi; then
151 gnome2_src_install -C lib/colord
152 use gusb && gnome2_src_install -C lib/colorhug
153 gnome2_src_install -C lib/compat
154 gnome2_src_install -C contrib/session-helper install-libcolord_includeHEADERS
158 multilib_src_install_all() {
159 DOCS="AUTHORS ChangeLog MAINTAINERS NEWS README.md TODO"
162 newbashcomp data/colormgr colormgr
164 # Ensure config and profile directories exist and /var/lib/colord/*
165 # is writable by colord user
166 keepdir /var/lib/color{,d}/icc
167 fowners colord:colord /var/lib/colord{,/icc}
169 if use examples; then