]> git.bzium.org - embe/overlay.git/blob - x11-misc/colord/colord-1.2.11.ebuild
Dodanie: x11-misc/colord-1.2.11
[embe/overlay.git] / x11-misc / colord / colord-1.2.11.ebuild
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 $
4
5 EAPI="5"
6 GCONF_DEBUG="no"
7 GNOME2_LA_PUNT="yes"
8 VALA_USE_DEPEND="vapigen"
9
10 inherit autotools bash-completion-r1 check-reqs eutils gnome2 user systemd udev vala multilib-minimal
11
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"
15
16 LICENSE="GPL-2+"
17 SLOT="0/2" # subslot = libcolord soname version
18 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
19
20 # We prefer policykit enabled by default, bug #448058
21 IUSE="argyllcms examples extra-print-profiles +gusb +introspection +policykit scanner systemd +udev vala"
22 REQUIRED_USE="
23         gusb? ( udev )
24         scanner? ( udev )
25         vala? ( introspection )
26 "
27
28 COMMON_DEPEND="
29         dev-db/sqlite:3=
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 )
36         scanner? (
37                 media-gfx/sane-backends
38                 sys-apps/dbus )
39         systemd? ( >=sys-apps/systemd-44:0= )
40         udev? (
41                 virtual/udev
42                 virtual/libgudev:=
43                 virtual/libudev:=[${MULTILIB_USEDEP}]
44         )
45 "
46 RDEPEND="${COMMON_DEPEND}
47         !media-gfx/shared-color-profiles
48         !<=media-gfx/colorhug-client-0.1.13
49 "
50 DEPEND="${COMMON_DEPEND}
51         dev-libs/libxslt
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) )
58 "
59
60 # FIXME: needs pre-installed dbus service files
61 RESTRICT="test"
62
63 # According to upstream comment in colord.spec.in, building the extra print
64 # profiles requires >=4G of memory
65 CHECKREQS_MEMORY="4G"
66
67 pkg_pretend() {
68         use extra-print-profiles && check-reqs_pkg_pretend
69 }
70
71 pkg_setup() {
72         use extra-print-profiles && check-reqs_pkg_setup
73         enewgroup colord
74         enewuser colord -1 -1 /var/lib/colord colord
75 }
76
77 src_prepare() {
78         # Adapt to Gentoo paths
79         sed -i -e 's/spotread/argyll-spotread/' \
80                 src/sensors/cd-sensor-argyll.c \
81                 configure.ac || die
82
83         epatch "${FILESDIR}"/${P}-multiple-users.patch
84
85         eautoreconf
86         use vala && vala_src_prepare
87         gnome2_src_prepare
88 }
89
90 multilib_src_configure() {
91         # Reverse tools require gusb
92         # bash-completion test does not work on gentoo
93         local myconf=(
94                 --disable-bash-completion
95                 --disable-examples
96                 --disable-static
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)" "")
103                 $(use_enable gusb)
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)
109                 $(use_enable udev)
110                 --with-udevrulesdir="$(get_udevdir)"/rules.d
111                 $(multilib_native_use_enable vala)
112                 "$(systemd_with_unitdir)"
113         )
114
115         if ! multilib_is_native_abi; then
116                 # disable some extraneous checks
117                 myconf+=(
118                         SQLITE_{CFLAGS,LIBS}=' '
119                         GUDEV_{CFLAGS,LIBS}=' '
120                 )
121         fi
122
123         ECONF_SOURCE=${S} \
124         gnome2_src_configure "${myconf[@]}"
125 }
126
127 multilib_src_compile() {
128         if multilib_is_native_abi; then
129                 gnome2_src_compile
130         else
131                 emake -C lib/colord
132                 use gusb && emake -C lib/colorhug
133                 emake -C lib/compat
134         fi
135 }
136
137 multilib_src_test() {
138         if multilib_is_native_abi; then
139                 default
140         else
141                 emake -C lib/colord check
142                 use gusb && emake -C lib/colorhug check
143                 emake -C lib/compat check
144         fi
145 }
146
147 multilib_src_install() {
148         if multilib_is_native_abi; then
149                 gnome2_src_install
150         else
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
155         fi
156 }
157
158 multilib_src_install_all() {
159         DOCS="AUTHORS ChangeLog MAINTAINERS NEWS README.md TODO"
160         einstalldocs
161
162         newbashcomp data/colormgr colormgr
163
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}
168
169         if use examples; then
170                 docinto examples
171                 dodoc examples/*.c
172         fi
173 }