public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: x11-misc/colord/files/, x11-misc/colord/
@ 2021-04-18 21:54 Matt Turner
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Turner @ 2021-04-18 21:54 UTC (permalink / raw
  To: gentoo-commits

commit:     e9f060d99869a65b2bcefe819672a34318cdd4f5
Author:     Daniel Brandt <poncho <AT> spahan <DOT> ch>
AuthorDate: Sun Apr 18 16:22:37 2021 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Sun Apr 18 21:46:53 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9f060d9

x11-misc/colord: Version bump to 1.4.5

* Re-add multilib support (mattst88)
* Various bug fixing (mattst88)

Closes: https://bugs.gentoo.org/738908
Signed-off-by: Daniel Brandt <poncho <AT> spahan.ch>
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 x11-misc/colord/Manifest                           |   1 +
 x11-misc/colord/colord-1.4.5.ebuild                | 135 +++++++++++++++++++++
 .../1.4.5-build-Fix-building-without-vapi.patch    |  53 ++++++++
 ...on-t-use-exact-floating-point-comparisons.patch |  39 ++++++
 4 files changed, 228 insertions(+)

diff --git a/x11-misc/colord/Manifest b/x11-misc/colord/Manifest
index 44de5bad81b..b954e9b2b18 100644
--- a/x11-misc/colord/Manifest
+++ b/x11-misc/colord/Manifest
@@ -1 +1,2 @@
 DIST colord-1.3.5.tar.xz 1263488 BLAKE2B de70f3f76e81d3cec826f444e4c6a1603c03b7d97fedcd04a0b9e1977d1e487d7e1327c8b2738b3cf74e9717fb6803d543786c749d3a244faa1a6480e77e3436 SHA512 a0084ad2c08ae88c8023b8bade68f6cf25e13c77a6a37ef127b2914e86b06e6a7a783f9ab3585243d975dbbe1120d5daae13bdb586aefe519bf675458683025f
+DIST colord-1.4.5.tar.xz 1869084 BLAKE2B 34c886bade6f71b0b81bbed216695d839873fba46423f6422b80ef2f62e88a403edd1686bb705ef78bcaeb352477e0581d784ccd388961cd42d880661b4b31ab SHA512 b6cc8087ceff4a99b7d764087208cc72e1219d9f6bb52bd3e3eb13bb62e3c1e99aefef36237dceff46925ab7680c76795f59057b7a4d1c8a123de6270708e03c

diff --git a/x11-misc/colord/colord-1.4.5.ebuild b/x11-misc/colord/colord-1.4.5.ebuild
new file mode 100644
index 00000000000..d98cb5325f1
--- /dev/null
+++ b/x11-misc/colord/colord-1.4.5.ebuild
@@ -0,0 +1,135 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+VALA_USE_DEPEND="vapigen"
+
+inherit bash-completion-r1 meson multilib-minimal systemd udev vala
+
+DESCRIPTION="System service to accurately color manage input and output devices"
+HOMEPAGE="https://www.freedesktop.org/software/colord/"
+SRC_URI="https://www.freedesktop.org/software/colord/releases/${P}.tar.xz"
+
+LICENSE="GPL-2+"
+SLOT="0/2" # subslot = libcolord soname version
+KEYWORDS="~amd64 ~x86"
+
+IUSE="gtk-doc argyllcms examples extra-print-profiles +introspection scanner systemd test +udev vala"
+RESTRICT="!test? ( test ) test" # Tests try to read and write files in /tmp
+REQUIRED_USE="
+	scanner? ( udev )
+	vala? ( introspection )
+"
+
+DEPEND="
+	>=dev-libs/glib-2.58.0:2[${MULTILIB_USEDEP}]
+	>=media-libs/lcms-2.6:2=[${MULTILIB_USEDEP}]
+	dev-db/sqlite:3=[${MULTILIB_USEDEP}]
+	>=dev-libs/libgusb-0.2.7[${MULTILIB_USEDEP}]
+	udev? (
+		dev-libs/libgudev:=[${MULTILIB_USEDEP}]
+		virtual/libudev:=[${MULTILIB_USEDEP}]
+		virtual/udev
+	)
+	systemd? ( >=sys-apps/systemd-44:0= )
+	scanner? (
+		media-gfx/sane-backends
+		sys-apps/dbus
+	)
+	>=sys-auth/polkit-0.104
+	argyllcms? ( media-gfx/argyllcms )
+	introspection? ( >=dev-libs/gobject-introspection-0.9.8:= )
+"
+RDEPEND="${DEPEND}
+	acct-group/colord
+	acct-user/colord
+"
+BDEPEND="
+	acct-group/colord
+	acct-user/colord
+	dev-libs/libxslt
+	>=dev-util/intltool-0.35
+	>=sys-devel/gettext-0.17
+	virtual/pkgconfig
+	extra-print-profiles? ( media-gfx/argyllcms )
+	vala? ( $(vala_depend) )
+"
+# These dependencies are required to build native build-time programs.
+BDEPEND="${BDEPEND}
+	dev-libs/glib:2
+	media-libs/lcms
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PV}-tests-Don-t-use-exact-floating-point-comparisons.patch
+	"${FILESDIR}"/${PV}-build-Fix-building-without-vapi.patch
+)
+
+src_prepare() {
+	default
+	use vala && vala_src_prepare
+
+	# Test requires a running session
+	# https://github.com/hughsie/colord/issues/94
+	sed -i -e "/test('colord-test-daemon'/d" lib/colord/meson.build || die
+
+	# Adapt to Gentoo paths
+	sed -i \
+		-e "s|find_program('spotread'|find_program('argyll-spotread'|" \
+		-e "s|find_program('colprof'|find_program('argyll-colprof'|" \
+		meson.build || die
+
+	# meson gnome.generate_vapi properly handles VAPIGEN and other vala
+	# environment variables. It is counter-productive to check for an
+	# unversioned vapigen, as that breaks versioned VAPIGEN usages.
+	sed -i -e "/find_program('vapigen')/d" meson.build || die
+}
+
+multilib_src_configure() {
+	local emesonargs=(
+		-Ddaemon=$(multilib_is_native_abi && echo true || echo false)
+		-Dexamples=false
+		-Dbash_completion=false
+		$(meson_use udev udev_rules)
+		-Dsystemd=$(multilib_native_usex systemd true false)
+		-Dlibcolordcompat=true
+		-Dargyllcms_sensor=$(multilib_native_usex argyllcms true false)
+		-Dreverse=false
+		-Dsane=$(multilib_native_usex scanner true false)
+		-Dvapi=$(multilib_native_usex vala true false)
+		-Dprint_profiles=$(multilib_native_usex extra-print-profiles true false)
+		$(meson_use test tests)
+		-Dinstalled_tests=false
+		-Ddaemon_user=colord
+		-Dman=true
+		$(meson_use gtk-doc docs)
+		--localstatedir="${EPREFIX}"/var
+	)
+	meson_src_configure
+}
+
+multilib_src_compile() {
+	meson_src_compile
+}
+
+multilib_src_test() {
+	meson_src_test
+}
+
+multilib_src_install() {
+	meson_src_install
+}
+
+multilib_src_install_all() {
+	newbashcomp data/colormgr colormgr
+
+	# Ensure config and profile directories exist and /var/lib/colord/*
+	# is writable by colord user
+	keepdir /var/lib/color{,d}/icc
+	fowners colord:colord /var/lib/colord{,/icc}
+
+	if use examples; then
+		docinto examples
+		dodoc examples/*.c
+	fi
+}

diff --git a/x11-misc/colord/files/1.4.5-build-Fix-building-without-vapi.patch b/x11-misc/colord/files/1.4.5-build-Fix-building-without-vapi.patch
new file mode 100644
index 00000000000..cbf79a830c0
--- /dev/null
+++ b/x11-misc/colord/files/1.4.5-build-Fix-building-without-vapi.patch
@@ -0,0 +1,53 @@
+From 2bbcefa35225ba836b1672449f1de59ce9a90078 Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Sun, 18 Apr 2021 16:46:52 -0400
+Subject: [PATCH] build: Fix building without vapi
+
+---
+ lib/colord/meson.build   | 2 +-
+ lib/colorhug/meson.build | 2 ++
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/lib/colord/meson.build b/lib/colord/meson.build
+index dbb3d19..3126046 100644
+--- a/lib/colord/meson.build
++++ b/lib/colord/meson.build
+@@ -146,6 +146,7 @@ pkgg.generate(
+   description : 'colord is a system daemon for managing color devices',
+ )
+ 
++if get_option('vapi')
+ libcolord_girtarget = gnome.generate_gir(colord,
+   sources : [
+     'cd-client.c',
+@@ -203,7 +204,6 @@ libcolord_girtarget = gnome.generate_gir(colord,
+ libcolord_gir = libcolord_girtarget[0]
+ libcolord_typelib = libcolord_girtarget[1]
+ 
+-if get_option('vapi')
+ gnome.generate_vapi('colord',
+   sources: libcolord_girtarget[0],
+   packages: ['gio-2.0'],
+diff --git a/lib/colorhug/meson.build b/lib/colorhug/meson.build
+index 9526ea4..9f17553 100644
+--- a/lib/colorhug/meson.build
++++ b/lib/colorhug/meson.build
+@@ -73,6 +73,7 @@ pkgg.generate(
+   description : 'ColorHug is a simple display hardware colorimeter',
+ )
+ 
++if get_option('vapi')
+ libcolorhug_gir = gnome.generate_gir(colorhug,
+   sources : [
+     'ch-common.c',
+@@ -107,6 +108,7 @@ libcolorhug_gir = gnome.generate_gir(colorhug,
+   ],
+   install : true
+ )
++endif
+ 
+ if get_option('tests')
+   e = executable(
+-- 
+2.26.3
+

diff --git a/x11-misc/colord/files/1.4.5-tests-Don-t-use-exact-floating-point-comparisons.patch b/x11-misc/colord/files/1.4.5-tests-Don-t-use-exact-floating-point-comparisons.patch
new file mode 100644
index 00000000000..de56fe14544
--- /dev/null
+++ b/x11-misc/colord/files/1.4.5-tests-Don-t-use-exact-floating-point-comparisons.patch
@@ -0,0 +1,39 @@
+From d68cd11cd31d379e4f3bb4c964b17fd50c8c54a6 Mon Sep 17 00:00:00 2001
+From: Christopher James Halse Rogers <raof@ubuntu.com>
+Date: Wed, 11 Nov 2020 17:13:19 +1100
+Subject: [PATCH] tests: Don't use exact floating point comparisons.
+
+The tests asserting that cd_icc_get_version are exactly equal to 3.4 or
+2.09 fail on (at least) i386, armel, and s390x because floating point is
+hateful.
+
+Signed-off-by: Christopher James Halse Rogers <raof@ubuntu.com>
+---
+ lib/colord/cd-test-private.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/colord/cd-test-private.c b/lib/colord/cd-test-private.c
+index 4b16ca5..231c4ae 100644
+--- a/lib/colord/cd-test-private.c
++++ b/lib/colord/cd-test-private.c
+@@ -1494,7 +1494,7 @@ colord_icc_func (void)
+ 	/* check profile properties */
+ 	g_assert_cmpint (cd_icc_get_size (icc), ==, 25244);
+ 	g_assert_cmpstr (cd_icc_get_checksum (icc), ==, "9ace8cce8baac8d492a93a2a232d7702");
+-	g_assert_cmpfloat (cd_icc_get_version (icc), ==, 3.4);
++	g_assert_cmpfloat_with_epsilon (cd_icc_get_version (icc), 3.4, 0.01);
+ 	g_assert (g_str_has_suffix (cd_icc_get_filename (icc), "ibm-t61.icc"));
+ 	g_assert_cmpint (cd_icc_get_kind (icc), ==, CD_PROFILE_KIND_DISPLAY_DEVICE);
+ 	g_assert_cmpint (cd_icc_get_colorspace (icc), ==, CD_COLORSPACE_RGB);
+@@ -1727,7 +1727,7 @@ colord_icc_save_func (void)
+ 	g_object_unref (file);
+ 
+ 	/* verify changed values */
+-	g_assert_cmpfloat (cd_icc_get_version (icc), ==, 2.09);
++	g_assert_cmpfloat_with_epsilon (cd_icc_get_version (icc), 2.09, 0.001);
+ 	g_assert_cmpint (cd_icc_get_kind (icc), ==, CD_PROFILE_KIND_OUTPUT_DEVICE);
+ 	g_assert_cmpint (cd_icc_get_colorspace (icc), ==, CD_COLORSPACE_XYZ);
+ 	g_assert_cmpstr (cd_icc_get_metadata_item (icc, "SelfTest"), ==, "true");
+-- 
+2.26.3
+


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-misc/colord/files/, x11-misc/colord/
@ 2023-12-02  5:14 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2023-12-02  5:14 UTC (permalink / raw
  To: gentoo-commits

commit:     17ee1596c7eb55a81cfbb018ca62f9900a7e0eac
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Dec  2 05:13:20 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec  2 05:13:36 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=17ee1596

x11-misc/colord: fix modern c issue (32-bit ptr truncation)

Closes: https://bugs.gentoo.org/918990
Signed-off-by: Sam James <sam <AT> gentoo.org>

 x11-misc/colord/colord-1.4.6-r2.ebuild             | 129 +++++++++++++++++++++
 .../files/colord-1.4.6-FILE_OFFSET_BITS.patch      |  38 ++++++
 .../files/colord-1.4.6-time_t-ptr-truncation.patch |  35 ++++++
 3 files changed, 202 insertions(+)

diff --git a/x11-misc/colord/colord-1.4.6-r2.ebuild b/x11-misc/colord/colord-1.4.6-r2.ebuild
new file mode 100644
index 000000000000..20e350ceb6e5
--- /dev/null
+++ b/x11-misc/colord/colord-1.4.6-r2.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+VALA_USE_DEPEND="vapigen"
+
+inherit bash-completion-r1 meson-multilib tmpfiles udev vala
+
+DESCRIPTION="System service to accurately color manage input and output devices"
+HOMEPAGE="https://www.freedesktop.org/software/colord/"
+SRC_URI="https://www.freedesktop.org/software/colord/releases/${P}.tar.xz"
+
+LICENSE="GPL-2+"
+SLOT="0/2" # subslot = libcolord soname version
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
+
+IUSE="gtk-doc argyllcms examples extra-print-profiles +introspection scanner selinux systemd test vala"
+RESTRICT="!test? ( test ) test" # Tests try to read and write files in /tmp
+REQUIRED_USE="vala? ( introspection )"
+
+DEPEND="
+	>=dev-libs/glib-2.58.0:2[${MULTILIB_USEDEP}]
+	>=media-libs/lcms-2.6:2=[${MULTILIB_USEDEP}]
+	dev-db/sqlite:3=[${MULTILIB_USEDEP}]
+	>=dev-libs/libgusb-0.2.7[introspection?,${MULTILIB_USEDEP}]
+
+	dev-libs/libgudev:=[${MULTILIB_USEDEP}]
+	virtual/libudev:=[${MULTILIB_USEDEP}]
+	virtual/udev
+
+	systemd? ( >=sys-apps/systemd-44:0= )
+	scanner? (
+		media-gfx/sane-backends
+		sys-apps/dbus
+	)
+	>=sys-auth/polkit-0.114
+	argyllcms? ( media-gfx/argyllcms )
+	introspection? ( >=dev-libs/gobject-introspection-1.56:= )
+"
+RDEPEND="${DEPEND}
+	acct-group/colord
+	acct-user/colord
+	selinux? ( sec-policy/selinux-colord )
+"
+BDEPEND="
+	acct-group/colord
+	acct-user/colord
+	app-text/docbook-xsl-ns-stylesheets
+	dev-libs/libxslt
+	>=sys-devel/gettext-0.17
+	virtual/pkgconfig
+	extra-print-profiles? ( media-gfx/argyllcms )
+	gtk-doc? (
+		dev-util/gtk-doc
+		app-text/docbook-xml-dtd:4.1.2
+	)
+	vala? ( $(vala_depend) )
+"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-lcms2-corruption.patch
+	"${FILESDIR}"/${P}-time_t-ptr-truncation.patch
+	"${FILESDIR}"/${P}-FILE_OFFSET_BITS.patch
+)
+
+src_prepare() {
+	default
+	use vala && vala_src_prepare
+
+	# Test requires a running session
+	# https://github.com/hughsie/colord/issues/94
+	sed -i -e "/test('colord-test-daemon'/d" lib/colord/meson.build || die
+
+	# Adapt to Gentoo paths
+	sed -i \
+		-e "s|find_program('spotread'|find_program('argyll-spotread'|" \
+		-e "s|find_program('colprof'|find_program('argyll-colprof'|" \
+		meson.build || die
+
+	# meson gnome.generate_vapi properly handles VAPIGEN and other vala
+	# environment variables. It is counter-productive to check for an
+	# unversioned vapigen, as that breaks versioned VAPIGEN usages.
+	sed -i -e "/find_program('vapigen')/d" meson.build || die
+}
+
+multilib_src_configure() {
+	local emesonargs=(
+		$(meson_native_true daemon)
+		-Dbash_completion=false
+		$(meson_native_true udev_rules) # Install udev rules only from native build
+		$(meson_native_use_bool systemd)
+		-Dlibcolordcompat=true
+		$(meson_native_use_bool argyllcms argyllcms_sensor)
+		$(meson_native_use_bool scanner sane)
+		$(meson_native_use_bool introspection)
+		$(meson_native_use_bool vala vapi)
+		$(meson_native_use_bool extra-print-profiles print_profiles)
+		$(meson_use test tests)
+		-Dinstalled_tests=false
+		-Ddaemon_user=colord
+		$(meson_native_true man)
+		$(meson_use gtk-doc docs)
+		--localstatedir="${EPREFIX}"/var
+	)
+	meson_src_configure
+}
+
+multilib_src_install_all() {
+	newbashcomp data/colormgr colormgr
+
+	# Ensure config and profile directories exist and /var/lib/colord/*
+	# is writable by colord user
+	keepdir /var/lib/color{,d}/icc
+	fowners colord:colord /var/lib/colord{,/icc}
+
+	if use examples; then
+		docinto examples
+		dodoc examples/*.c
+	fi
+}
+
+pkg_postinst() {
+	udev_reload
+	tmpfiles_process colord.conf
+}
+
+pkg_postrm() {
+	udev_reload
+}

diff --git a/x11-misc/colord/files/colord-1.4.6-FILE_OFFSET_BITS.patch b/x11-misc/colord/files/colord-1.4.6-FILE_OFFSET_BITS.patch
new file mode 100644
index 000000000000..c41f73e4eb8a
--- /dev/null
+++ b/x11-misc/colord/files/colord-1.4.6-FILE_OFFSET_BITS.patch
@@ -0,0 +1,38 @@
+https://github.com/hughsie/colord/pull/159
+
+From 72cc7bb299de09ec53aa4ce125af370158127d0e Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sat, 2 Dec 2023 05:07:46 +0000
+Subject: [PATCH] meson.build: set FILE_OFFSET_BITS explicitly
+
+This is needed if building introspection because:
+a) Meson's own setting of FILE_OFFSET_BITS (which it does by default) doesn't
+affect the introspection tooling;
+
+b) glibc's headers seem to react poorly to _just_ _TIME_BITS being set, even
+though in this cas, the failure was for a 64-bit ABI anyway.
+
+Fixes: ce9732a87bc2a0ddca841b49b9b9e24351ea78c8
+Signed-off-by: Sam James <sam@gentoo.org>
+---
+ meson.build | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 072a612..b0b1af8 100644
+--- a/meson.build
++++ b/meson.build
+@@ -215,7 +215,9 @@ add_project_arguments('-DCD_COMPILATION', language: 'c')
+ # Needed for realpath() and PATH_MAX
+ add_project_arguments('-D_XOPEN_SOURCE=700', language : 'c')
+ # Needed to opt-in to 64-bit time_t on glibc. We pass 64-bit pointers into
+-# gmtime_r.
++# gmtime_r. We have to set F_O_B here despite Meson defaulting to it because
++# it doesn't get passed down to introspection otherwise.
++add_project_arguments('-D_FILE_OFFSET_BITS=64', language : 'c')
+ add_project_arguments('-D_TIME_BITS=64', language : 'c')
+ 
+ prefix = get_option('prefix')
+-- 
+2.43.0
+

diff --git a/x11-misc/colord/files/colord-1.4.6-time_t-ptr-truncation.patch b/x11-misc/colord/files/colord-1.4.6-time_t-ptr-truncation.patch
new file mode 100644
index 000000000000..687b595feca5
--- /dev/null
+++ b/x11-misc/colord/files/colord-1.4.6-time_t-ptr-truncation.patch
@@ -0,0 +1,35 @@
+https://bugs.gentoo.org/918990
+https://github.com/hughsie/colord/issues/157
+https://github.com/hughsie/colord/commit/ce9732a87bc2a0ddca841b49b9b9e24351ea78c8
+
+From ce9732a87bc2a0ddca841b49b9b9e24351ea78c8 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Fri, 1 Dec 2023 22:20:17 +0000
+Subject: [PATCH] meson.build: use 64-bit time_t
+
+We call `gmtime_r` (which expects `time_t`) with a 64-bit pointer (`gint64*`).
+
+On 32-bit systems, `time_t` is 32-bit unless you opt-in to a 64-bit wide version
+(at least on glibc). To avoid truncation and -Wincompatible-pointer-types,
+opt-in to 64-bit `time_t` for glibc with `-D_TIME_BITS=64` in meson.
+
+This should be fine ABI wise because the time is only passed down into lcms2
+into `_cmsEncodeDateTimeNumber` where it seems to decompose it and it worked already
+for 64-bit systems. Plus, they use their own types like `cmsUInt16Number` to ensure
+they're wide enough.
+
+Fixes: https://github.com/hughsie/colord/issues/157
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/meson.build
++++ b/meson.build
+@@ -214,6 +214,9 @@ add_project_arguments('-DCD_COMPILATION', language: 'c')
+ 
+ # Needed for realpath() and PATH_MAX
+ add_project_arguments('-D_XOPEN_SOURCE=700', language : 'c')
++# Needed to opt-in to 64-bit time_t on glibc. We pass 64-bit pointers into
++# gmtime_r.
++add_project_arguments('-D_TIME_BITS=64', language : 'c')
+ 
+ prefix = get_option('prefix')
+ 
+


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-misc/colord/files/, x11-misc/colord/
@ 2024-03-02  0:55 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2024-03-02  0:55 UTC (permalink / raw
  To: gentoo-commits

commit:     107eb89b10059098953c805aa775ddbd2ffaaff0
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  2 00:55:33 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar  2 00:55:33 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=107eb89b

x11-misc/colord: backport systemd permission fixes

Signed-off-by: Sam James <sam <AT> gentoo.org>

 x11-misc/colord/colord-1.4.7-r1.ebuild             | 130 +++++++++++++++++++++
 .../files/colord-1.4.7-systemd-permissions.patch   |  51 ++++++++
 2 files changed, 181 insertions(+)

diff --git a/x11-misc/colord/colord-1.4.7-r1.ebuild b/x11-misc/colord/colord-1.4.7-r1.ebuild
new file mode 100644
index 000000000000..e6bb102d0a39
--- /dev/null
+++ b/x11-misc/colord/colord-1.4.7-r1.ebuild
@@ -0,0 +1,130 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+VALA_USE_DEPEND="vapigen"
+
+inherit bash-completion-r1 meson-multilib tmpfiles udev vala
+
+DESCRIPTION="System service to accurately color manage input and output devices"
+HOMEPAGE="https://www.freedesktop.org/software/colord/"
+SRC_URI="https://www.freedesktop.org/software/colord/releases/${P}.tar.xz"
+
+LICENSE="GPL-2+"
+SLOT="0/2" # subslot = libcolord soname version
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
+
+IUSE="gtk-doc argyllcms examples extra-print-profiles +introspection scanner selinux systemd test vala"
+RESTRICT="!test? ( test ) test" # Tests try to read and write files in /tmp
+REQUIRED_USE="vala? ( introspection )"
+
+DEPEND="
+	>=dev-libs/glib-2.58.0:2[${MULTILIB_USEDEP}]
+	>=media-libs/lcms-2.6:2=[${MULTILIB_USEDEP}]
+	dev-db/sqlite:3=[${MULTILIB_USEDEP}]
+	>=dev-libs/libgusb-0.2.7[introspection?,${MULTILIB_USEDEP}]
+
+	dev-libs/libgudev:=[${MULTILIB_USEDEP}]
+	virtual/libudev:=[${MULTILIB_USEDEP}]
+	virtual/udev
+
+	systemd? ( >=sys-apps/systemd-44:0= )
+	scanner? (
+		media-gfx/sane-backends
+		sys-apps/dbus
+	)
+	>=sys-auth/polkit-0.114
+	argyllcms? ( media-gfx/argyllcms )
+	introspection? ( >=dev-libs/gobject-introspection-1.56:= )
+"
+RDEPEND="${DEPEND}
+	acct-group/colord
+	acct-user/colord
+	selinux? ( sec-policy/selinux-colord )
+"
+BDEPEND="
+	acct-group/colord
+	acct-user/colord
+	app-text/docbook-xsl-ns-stylesheets
+	dev-libs/libxslt
+	>=sys-devel/gettext-0.17
+	virtual/pkgconfig
+	extra-print-profiles? ( media-gfx/argyllcms )
+	gtk-doc? (
+		dev-util/gtk-doc
+		app-text/docbook-xml-dtd:4.1.2
+	)
+	vala? ( $(vala_depend) )
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.4.7-systemd-permissions.patch
+)
+
+pkg_setup() {
+	use vala && vala_setup
+}
+
+src_prepare() {
+	default
+
+	# Test requires a running session
+	# https://github.com/hughsie/colord/issues/94
+	sed -i -e "/test('colord-test-daemon'/d" lib/colord/meson.build || die
+
+	# Adapt to Gentoo paths
+	sed -i \
+		-e "s|find_program('spotread'|find_program('argyll-spotread'|" \
+		-e "s|find_program('colprof'|find_program('argyll-colprof'|" \
+		meson.build || die
+
+	# meson gnome.generate_vapi properly handles VAPIGEN and other vala
+	# environment variables. It is counter-productive to check for an
+	# unversioned vapigen, as that breaks versioned VAPIGEN usages.
+	sed -i -e "/find_program('vapigen')/d" meson.build || die
+}
+
+multilib_src_configure() {
+	local emesonargs=(
+		$(meson_native_true daemon)
+		-Dbash_completion=false
+		$(meson_native_true udev_rules) # Install udev rules only from native build
+		$(meson_native_use_bool systemd)
+		-Dlibcolordcompat=true
+		$(meson_native_use_bool argyllcms argyllcms_sensor)
+		$(meson_native_use_bool scanner sane)
+		$(meson_native_use_bool introspection)
+		$(meson_native_use_bool vala vapi)
+		$(meson_native_use_bool extra-print-profiles print_profiles)
+		$(meson_use test tests)
+		-Dinstalled_tests=false
+		-Ddaemon_user=colord
+		$(meson_native_true man)
+		$(meson_use gtk-doc docs)
+		--localstatedir="${EPREFIX}"/var
+	)
+	meson_src_configure
+}
+
+multilib_src_install_all() {
+	newbashcomp data/colormgr colormgr
+
+	# Ensure config and profile directories exist and /var/lib/colord/*
+	# is writable by colord user
+	keepdir /var/lib/color{,d}/icc
+	fowners colord:colord /var/lib/colord{,/icc}
+
+	if use examples; then
+		docinto examples
+		dodoc examples/*.c
+	fi
+}
+
+pkg_postinst() {
+	udev_reload
+	tmpfiles_process colord.conf
+}
+
+pkg_postrm() {
+	udev_reload
+}

diff --git a/x11-misc/colord/files/colord-1.4.7-systemd-permissions.patch b/x11-misc/colord/files/colord-1.4.7-systemd-permissions.patch
new file mode 100644
index 000000000000..0a97d8ac579d
--- /dev/null
+++ b/x11-misc/colord/files/colord-1.4.7-systemd-permissions.patch
@@ -0,0 +1,51 @@
+https://github.com/hughsie/colord/commit/08a32b2379fb5582f4312e59bf51a2823df56276
+https://github.com/hughsie/colord/commit/9283abd9c00468edb94d2a06d6fa3681cae2700d
+
+From 08a32b2379fb5582f4312e59bf51a2823df56276 Mon Sep 17 00:00:00 2001
+From: Richard Hughes <richard@hughsie.com>
+Date: Mon, 29 Jan 2024 10:37:11 +0000
+Subject: [PATCH] Fix writing to the database with ProtectSystem=strict
+
+Fixes https://github.com/hughsie/colord/issues/166
+--- a/data/colord.service.in
++++ b/data/colord.service.in
+@@ -17,6 +17,10 @@ ProtectControlGroups=true
+ RestrictRealtime=true
+ RestrictAddressFamilies=AF_UNIX
+ 
++ConfigurationDirectory=colord
++StateDirectory=colord
++CacheDirectory=colord
++
+ # drop all capabilities
+ CapabilityBoundingSet=~CAP_SETUID CAP_SETGID CAP_SETPCAP CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_CHOWN CAP_FSETID CAP_SETFCAP CAP_DAC_OVERRIDE CAP_DAC_READ_SEARCH CAP_FOWNER CAP_IPC_OWNER CAP_NET_ADMIN CAP_SYS_RAWIO CAP_SYS_TIME CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE CAP_KILL CAP_MKNOD CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_NICE CAP_SYS_RESOURCE CAP_MAC_ADMIN CAP_MAC_OVERRIDE CAP_SYS_BOOT CAP_LINUX_IMMUTABLE CAP_IPC_LOCK CAP_SYS_CHROOT CAP_BLOCK_SUSPEND CAP_LEASE CAP_SYS_PACCT CAP_SYS_TTY_CONFIG CAP_WAKE_ALARM
+ 
+
+From 9283abd9c00468edb94d2a06d6fa3681cae2700d Mon Sep 17 00:00:00 2001
+From: Ferdinand Bachmann <ferdinand.bachmann@yrlf.at>
+Date: Tue, 30 Jan 2024 12:44:18 +0100
+Subject: [PATCH] Fix USB scanners not working with RestrictAddressFamilies
+
+colord-sane scanner drivers using libusb can't initialize properly with
+RestrictAddressFamilies set to AF_UNIX. Remove that line to ensure those
+can work properly.
+
+This also avoids a crash in HPLIP due to unchecked calls to libusb_init().
+
+Fixes #165
+---
+ data/colord.service.in | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/data/colord.service.in b/data/colord.service.in
+index c358dc4b..45ec5811 100644
+--- a/data/colord.service.in
++++ b/data/colord.service.in
+@@ -15,7 +15,6 @@ ProtectKernelModules=true
+ ProtectKernelLogs=true
+ ProtectControlGroups=true
+ RestrictRealtime=true
+-RestrictAddressFamilies=AF_UNIX
+ 
+ ConfigurationDirectory=colord
+ StateDirectory=colord


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-02  0:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-02  5:14 [gentoo-commits] repo/gentoo:master commit in: x11-misc/colord/files/, x11-misc/colord/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-03-02  0:55 Sam James
2021-04-18 21:54 Matt Turner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox