Gentoo Archives: gentoo-commits

From: Mart Raudsepp <leio@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/gnome-disk-utility/, sys-apps/gnome-disk-utility/files/
Date: Tue, 09 Apr 2019 11:46:10
Message-Id: 1554810055.c8773758536fa7cba8843b64eef173d7d828df7e.leio@gentoo
1 commit: c8773758536fa7cba8843b64eef173d7d828df7e
2 Author: Mart Raudsepp <leio <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 9 11:33:29 2019 +0000
4 Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 9 11:40:55 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c8773758
7
8 sys-apps/gnome-disk-utility: add optional elogind support
9
10 Closes: https://bugs.gentoo.org/682134
11 Package-Manager: Portage-2.3.52, Repoman-2.3.12
12 Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>
13
14 .../gnome-disk-utility/files/elogind-support.patch | 114 +++++++++++++++++++++
15 .../gnome-disk-utility-3.30.2-r1.ebuild | 67 ++++++++++++
16 2 files changed, 181 insertions(+)
17
18 diff --git a/sys-apps/gnome-disk-utility/files/elogind-support.patch b/sys-apps/gnome-disk-utility/files/elogind-support.patch
19 new file mode 100644
20 index 00000000000..10ebcdc9f53
21 --- /dev/null
22 +++ b/sys-apps/gnome-disk-utility/files/elogind-support.patch
23 @@ -0,0 +1,114 @@
24 +From 2c09cf164f654a5ed2bc153db30710999842c7a5 Mon Sep 17 00:00:00 2001
25 +From: Mart Raudsepp <leio@g.o>
26 +Date: Tue, 9 Apr 2019 13:16:46 +0300
27 +Subject: [PATCH] build: add elogind support for seat retrieval
28 +
29 +---
30 + meson.build | 21 ++++++++++++---------
31 + meson_options.txt | 3 ++-
32 + src/libgdu/gduutils.c | 4 ++--
33 + src/libgdu/meson.build | 5 +----
34 + 4 files changed, 17 insertions(+), 16 deletions(-)
35 +
36 +diff --git a/meson.build b/meson.build
37 +index a5149c8e..ac641928 100644
38 +--- a/meson.build
39 ++++ b/meson.build
40 +@@ -3,7 +3,7 @@ project(
41 + version: '3.32.0',
42 + license: 'GPL2.0',
43 + default_options: 'buildtype=debugoptimized',
44 +- meson_version: '>= 0.43.0'
45 ++ meson_version: '>= 0.47.0'
46 + )
47 +
48 + gdu_name = 'gnome-disk-utility'
49 +@@ -75,13 +75,16 @@ libnotify_dep = dependency('libnotify', version: '>= 0.7')
50 + liblzma_dep = dependency('liblzma', version: '>= 5.0.5')
51 + m_dep = cc.find_library('m')
52 +
53 +-# *** Check for libsystemd ***
54 +-enable_libsystemd = get_option('libsystemd')
55 +-if enable_libsystemd
56 +- libsystemd_dep = dependency('libsystemd', version: '>= 209', required: false)
57 +- config_h.set('HAVE_LIBSYSTEMD', libsystemd_dep.found(),
58 +- description: 'Define to 1 if libsystemd is available')
59 ++# *** Check for logind ***
60 ++assert(not (get_option('libsystemd').enabled() and get_option('libelogind').enabled()), 'Can not support systemd and elogind at once')
61 ++if not get_option('libelogind').enabled()
62 ++ logind_dep = dependency('libsystemd', version: '>= 209', required: get_option('libsystemd'))
63 + endif
64 ++if get_option('libelogind').enabled() or not logind_dep.found()
65 ++ logind_dep = dependency('libelogind', version: '>= 209', required: get_option('libelogind'))
66 ++endif
67 ++config_h.set('HAVE_LOGIND', logind_dep.found(),
68 ++ description: 'Define to 1 if logind API is available')
69 +
70 + gnome = import('gnome')
71 + i18n = import('i18n')
72 +@@ -123,9 +126,9 @@ output += ' libexecdir: ' + gdu_libexecdir + '\n'
73 + output += ' localedir: ' + gdu_localedir + '\n'
74 + output += ' mandir: ' + gdu_mandir + '\n'
75 + output += ' sysconfdir: ' + gdu_sysconfdir + '\n\n'
76 +-output += ' Use libsystemd: ' + enable_libsystemd.to_string() + '\n'
77 ++output += ' Use logind: ' + logind_dep.found().to_string() + '\n'
78 + output += ' Build g-s-d plug-in: ' + enable_gsd_plugin.to_string() + '\n\n'
79 + output += ' compiler: ' + cc.get_id() + '\n'
80 + output += ' cflags: ' + ' '.join(compiler_flags) + '\n\n'
81 +-output += ' (Change with: meson configure BUILDDIR -D libsystemd=true|false -D gsd_plugin=true|false)\n\n'
82 ++output += ' (Change with: meson configure BUILDDIR -D libelogind=auto|enabled|disabled -D libsystemd=auto|enabled|disabled -D gsd_plugin=true|false)\n\n'
83 + message(output)
84 +diff --git a/meson_options.txt b/meson_options.txt
85 +index 952f5d24..895fc115 100644
86 +--- a/meson_options.txt
87 ++++ b/meson_options.txt
88 +@@ -1,2 +1,3 @@
89 +-option('libsystemd', type: 'boolean', value: true, description: 'build with libsystemd')
90 ++option('libelogind', type: 'feature', value: 'auto', description: 'build with libelogind')
91 ++option('libsystemd', type: 'feature', value: 'auto', description: 'build with libsystemd')
92 + option('gsd_plugin', type: 'boolean', value: true, description: 'build gnome-settings-daemon plug-in')
93 +diff --git a/src/libgdu/gduutils.c b/src/libgdu/gduutils.c
94 +index 59a26f3a..bff70304 100644
95 +--- a/src/libgdu/gduutils.c
96 ++++ b/src/libgdu/gduutils.c
97 +@@ -19,7 +19,7 @@
98 + # include <features.h>
99 + #endif
100 +
101 +-#if defined(HAVE_LIBSYSTEMD)
102 ++#if defined(HAVE_LOGIND)
103 + #include <systemd/sd-login.h>
104 + #endif
105 +
106 +@@ -405,7 +405,7 @@ gdu_options_update_entry_option (GtkWidget *options_entry,
107 + g_free (opts);
108 + }
109 +
110 +-#if defined(HAVE_LIBSYSTEMD)
111 ++#if defined(HAVE_LOGIND)
112 +
113 + const gchar *
114 + gdu_utils_get_seat (void)
115 +diff --git a/src/libgdu/meson.build b/src/libgdu/meson.build
116 +index 00f7edd7..0693b229 100644
117 +--- a/src/libgdu/meson.build
118 ++++ b/src/libgdu/meson.build
119 +@@ -17,14 +17,11 @@ deps = [
120 + udisk_dep,
121 + gtk_dep,
122 + libsecret_dep,
123 ++ logind_dep,
124 + pwquality_dep,
125 + m_dep
126 + ]
127 +
128 +-if enable_libsystemd
129 +- deps += libsystemd_dep
130 +-endif
131 +-
132 + cflags = [
133 + '-DPACKAGE_DATA_DIR="@0@"'.format(gdu_datadir),
134 + '-DG_LOG_DOMAIN="libgdu"',
135 +--
136 +2.17.0
137 +
138
139 diff --git a/sys-apps/gnome-disk-utility/gnome-disk-utility-3.30.2-r1.ebuild b/sys-apps/gnome-disk-utility/gnome-disk-utility-3.30.2-r1.ebuild
140 new file mode 100644
141 index 00000000000..bdc871e209f
142 --- /dev/null
143 +++ b/sys-apps/gnome-disk-utility/gnome-disk-utility-3.30.2-r1.ebuild
144 @@ -0,0 +1,67 @@
145 +# Copyright 1999-2019 Gentoo Authors
146 +# Distributed under the terms of the GNU General Public License v2
147 +
148 +EAPI=6
149 +
150 +inherit gnome.org gnome2-utils meson xdg
151 +
152 +DESCRIPTION="Disk Utility for GNOME using udisks"
153 +HOMEPAGE="https://wiki.gnome.org/Apps/Disks"
154 +
155 +LICENSE="GPL-2+"
156 +SLOT="0"
157 +IUSE="fat elogind gnome systemd"
158 +REQUIRED_USE="?? ( elogind systemd )"
159 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86"
160 +
161 +COMMON_DEPEND="
162 + >=dev-libs/glib-2.31:2
163 + >=sys-fs/udisks-2.7.6:2
164 + >=x11-libs/gtk+-3.16.0:3
165 + >=app-crypt/libsecret-0.7
166 + >=dev-libs/libpwquality-1.0.0
167 + >=media-libs/libcanberra-0.1[gtk3]
168 + >=media-libs/libdvdread-4.2.0
169 + >=x11-libs/libnotify-0.7:=
170 + >=app-arch/xz-utils-5.0.5
171 + elogind? ( >=sys-auth/elogind-209 )
172 + systemd? ( >=sys-apps/systemd-209:0= )
173 +"
174 +RDEPEND="${COMMON_DEPEND}
175 + x11-themes/adwaita-icon-theme
176 + fat? ( sys-fs/dosfstools )
177 + gnome? ( >=gnome-base/gnome-settings-daemon-3.8 )
178 +"
179 +# appstream-glib for developer_name tag in appdata (gettext-0.19.8.1 own appdata.its file doesn't have it yet)
180 +# libxml2 for xml-stripblanks in gresource
181 +DEPEND="${COMMON_DEPEND}
182 + dev-libs/appstream-glib
183 + dev-libs/libxml2:2
184 + dev-libs/libxslt
185 + dev-util/glib-utils
186 + >=sys-devel/gettext-0.19.8
187 + virtual/pkgconfig
188 +"
189 +
190 +PATCHES=(
191 + "${FILESDIR}"/elogind-support.patch # https://gitlab.gnome.org/GNOME/gnome-disk-utility/merge_requests/15
192 +)
193 +
194 +src_configure() {
195 + local emesonargs=(
196 + $(meson_feature elogind libelogind)
197 + $(meson_feature systemd libsystemd)
198 + $(meson_use gnome gsd_plugin)
199 + )
200 + meson_src_configure
201 +}
202 +
203 +pkg_postinst() {
204 + xdg_pkg_postinst
205 + gnome2_schemas_update
206 +}
207 +
208 +pkg_postrm() {
209 + xdg_pkg_postrm
210 + gnome2_schemas_update
211 +}