Gentoo Archives: gentoo-commits

From: Jonathan Scruggs <dracwyrm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/ddcutil/, app-misc/ddcutil/files/
Date: Tue, 30 Jan 2018 21:28:29
Message-Id: 1517347678.1c133a7cccdf1f1aff10ec0a00766cb073d72f8b.dracwyrm@gentoo
1 commit: 1c133a7cccdf1f1aff10ec0a00766cb073d72f8b
2 Author: Jonathan Scruggs <j.scruggs <AT> gmail <DOT> com>
3 AuthorDate: Tue Jan 30 21:07:42 2018 +0000
4 Commit: Jonathan Scruggs <dracwyrm <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 30 21:27:58 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1c133a7c
7
8 app-misc/ddcutil: remove pedantic compiler flag
9
10 Closes: https://bugs.gentoo.org/645830
11 Closes: https://github.com/gentoo/gentoo/pull/7003
12
13 app-misc/ddcutil/ddcutil-0.8.6-r1.ebuild | 108 ++++++++++++++++++
14 .../ddcutil-0.8.6-remove-pedantic-cflag.patch | 126 +++++++++++++++++++++
15 2 files changed, 234 insertions(+)
16
17 diff --git a/app-misc/ddcutil/ddcutil-0.8.6-r1.ebuild b/app-misc/ddcutil/ddcutil-0.8.6-r1.ebuild
18 new file mode 100644
19 index 00000000000..a1402f71b64
20 --- /dev/null
21 +++ b/app-misc/ddcutil/ddcutil-0.8.6-r1.ebuild
22 @@ -0,0 +1,108 @@
23 +# Copyright 1999-2018 Gentoo Foundation
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=6
27 +
28 +inherit autotools flag-o-matic linux-info udev user
29 +
30 +DESCRIPTION="Program for querying and changing monitor settings"
31 +HOMEPAGE="http://www.ddcutil.com/"
32 +SRC_URI="https://github.com/rockowitz/ddcutil/archive/v${PV}.tar.gz -> ${P}.tar.gz"
33 +
34 +SLOT="0"
35 +LICENSE="GPL-2"
36 +KEYWORDS="~amd64 ~x86"
37 +IUSE="drm usb-monitor user-permissions video_cards_nvidia X"
38 +REQUIRED_USE="drm? ( X )"
39 +
40 +RDEPEND="dev-libs/glib:2
41 + sys-apps/i2c-tools
42 + virtual/udev
43 + drm? ( x11-libs/libdrm )
44 + usb-monitor? (
45 + dev-libs/hidapi
46 + virtual/libusb:1
47 + sys-apps/usbutils
48 + )
49 + X? (
50 + x11-libs/libXrandr
51 + x11-libs/libX11
52 + )"
53 +
54 +DEPEND="${RDEPEND}
55 + virtual/pkgconfig"
56 +
57 +PATCHES=( ${FILESDIR}/${P}-remove-pedantic-cflag.patch )
58 +
59 +pkg_pretend() {
60 + # This program needs /dev/ic2-* devices to communicate with the monitor.
61 + CONFIG_CHECK="~I2C_CHARDEV"
62 + ERROR_I2C_CHARDEV="You must enable I2C_CHARDEV in your kernel to continue"
63 + if use usb-monitor; then
64 + CONFIG_CHECK+=" ~HIDRAW ~USB_HIDDEV"
65 + ERROR_HIDRAW="HIDRAW is needed to support USB monitors"
66 + ERROR_I2C_CHARDEV="USB_HIDDEV is needed to support USB monitors"
67 + fi
68 +
69 + # Now do the actual checks setup above
70 + check_extra_config
71 +}
72 +
73 +src_prepare() {
74 + default
75 + eautoreconf
76 +}
77 +
78 +src_configure() {
79 + # Bug 607818.
80 + replace-flags -O3 -O2
81 +
82 + local myeconfargs=(
83 + $(use_enable drm)
84 + $(use_enable usb-monitor usb)
85 + $(use_enable X x11)
86 + --enable-lib
87 + --disable-cffi
88 + --disable-cython
89 + --disable-swig
90 + )
91 +
92 + econf "${myeconfargs[@]}"
93 +}
94 +
95 +src_install() {
96 + default
97 + if use user-permissions; then
98 + udev_dorules data/etc/udev/rules.d/45-ddcutil-i2c.rules
99 + if use usb-monitor; then
100 + udev_dorules data/etc/udev/rules.d/45-ddcutil-usb.rules
101 + fi
102 + fi
103 +}
104 +
105 +pkg_postinst() {
106 + if use user-permissions; then
107 + enewgroup i2c
108 + einfo "To allow non-root users access to the /dev/i2c-* devices, add those"
109 + einfo "users to the i2c group: usermod -aG i2c user"
110 + einfo "Restart the computer or reload the i2c-dev module to activate"
111 + einfo "the new udev rule."
112 + einfo "For more information read: http://www.ddcutil.com/i2c_permissions/"
113 +
114 + if use usb-monitor; then
115 + enewgroup video
116 + einfo "To allow non-root users access to USB monitors, add those users"
117 + einfo "to the video group: usermod -aG video user"
118 + einfo "Restart the computer, reload the hiddev and hidraw modules, or replug"
119 + einfo "the monitor to activate the new udev rule."
120 + einfo "For more information read: http://www.ddcutil.com/usb/"
121 + fi
122 +
123 + udev_reload
124 + fi
125 +
126 + if use video_cards_nvidia; then
127 + ewarn "Please read the following webpage on proper usage with the nVidia "
128 + ewarn "binary drivers, or it may not work: http://www.ddcutil.com/nvidia/"
129 + fi
130 +}
131
132 diff --git a/app-misc/ddcutil/files/ddcutil-0.8.6-remove-pedantic-cflag.patch b/app-misc/ddcutil/files/ddcutil-0.8.6-remove-pedantic-cflag.patch
133 new file mode 100644
134 index 00000000000..e20cc36459e
135 --- /dev/null
136 +++ b/app-misc/ddcutil/files/ddcutil-0.8.6-remove-pedantic-cflag.patch
137 @@ -0,0 +1,126 @@
138 +diff -urN a/src/app_sysenv/Makefile.am b/src/app_sysenv/Makefile.am
139 +--- a/src/app_sysenv/Makefile.am 2018-01-20 06:40:55.000000000 +0000
140 ++++ b/src/app_sysenv/Makefile.am 2018-01-28 20:16:44.143484825 +0000
141 +@@ -15,8 +15,8 @@
142 +
143 +
144 + AM_CFLAGS = -Wall
145 +-AM_CFLAGS += -Werror
146 +-AM_CFLAGS += -Wpedantic
147 ++#AM_CFLAGS += -Werror
148 ++#AM_CFLAGS += -Wpedantic
149 +
150 + if ENABLE_CALLGRAPH_COND
151 + AM_CFLAGS += -fdump-rtl-expand
152 +diff -urN a/src/base/Makefile.am b/src/base/Makefile.am
153 +--- a/src/base/Makefile.am 2018-01-20 06:40:55.000000000 +0000
154 ++++ b/src/base/Makefile.am 2018-01-28 20:21:31.124936834 +0000
155 +@@ -4,7 +4,7 @@
156 + -I$(top_srcdir)/src/public
157 +
158 + AM_CFLAGS = -Wall
159 +-AM_CFLAGS += -Werror
160 ++#AM_CFLAGS += -Werror
161 + # AM_CFLAGS += -Wpedantic
162 +
163 + if ENABLE_CALLGRAPH_COND
164 +diff -urN a/src/cmdline/Makefile.am b/src/cmdline/Makefile.am
165 +--- a/src/cmdline/Makefile.am 2018-01-20 06:40:55.000000000 +0000
166 ++++ b/src/cmdline/Makefile.am 2018-01-28 20:20:32.178848976 +0000
167 +@@ -4,7 +4,7 @@
168 + -I$(top_srcdir)/src/public
169 +
170 + AM_CFLAGS = -Wall
171 +-AM_CFLAGS += -Werror
172 ++#AM_CFLAGS += -Werror
173 + # flags g_option parser structs in cmd_parser_goption.c
174 + # AM_CFLAGS += -Wpedantic
175 +
176 +diff -urN a/src/ddc/Makefile.am b/src/ddc/Makefile.am
177 +--- a/src/ddc/Makefile.am 2018-01-20 06:40:55.000000000 +0000
178 ++++ b/src/ddc/Makefile.am 2018-01-28 20:18:09.643626498 +0000
179 +@@ -11,8 +11,8 @@
180 +
181 +
182 + AM_CFLAGS = -Wall
183 +-AM_CFLAGS += -Werror
184 +-AM_CFLAGS += -Wpedantic
185 ++#AM_CFLAGS += -Werror
186 ++#AM_CFLAGS += -Wpedantic
187 +
188 + if ENABLE_CALLGRAPH_COND
189 + AM_CFLAGS += -fdump-rtl-expand
190 +diff -urN a/src/i2c/Makefile.am b/src/i2c/Makefile.am
191 +--- a/src/i2c/Makefile.am 2018-01-20 06:40:55.000000000 +0000
192 ++++ b/src/i2c/Makefile.am 2018-01-28 20:17:30.271562118 +0000
193 +@@ -4,8 +4,8 @@
194 + -I$(top_srcdir)/src/public
195 +
196 + AM_CFLAGS = -Wall
197 +-AM_CFLAGS += -Werror
198 +-AM_CFLAGS += -Wpedantic
199 ++#AM_CFLAGS += -Werror
200 ++#AM_CFLAGS += -Wpedantic
201 +
202 + if ENABLE_CALLGRAPH_COND
203 + AM_CFLAGS += -fdump-rtl-expand
204 +diff -urN a/src/sample_clients/Makefile.am b/src/sample_clients/Makefile.am
205 +--- a/src/sample_clients/Makefile.am 2018-01-20 06:40:55.000000000 +0000
206 ++++ b/src/sample_clients/Makefile.am 2018-01-28 20:19:57.230795822 +0000
207 +@@ -7,7 +7,7 @@
208 + -I$(top_srcdir)/src
209 +
210 + AM_CFLAGS = -Wall -fPIC
211 +-AM_CFLAGS += -Werror
212 ++#AM_CFLAGS += -Werror
213 +
214 + check_PROGRAMS =
215 + if ENABLE_SHARED_LIB_COND
216 +diff -urN a/src/test/Makefile.am b/src/test/Makefile.am
217 +--- a/src/test/Makefile.am 2018-01-20 06:40:55.000000000 +0000
218 ++++ b/src/test/Makefile.am 2018-01-28 20:19:03.509712410 +0000
219 +@@ -12,7 +12,7 @@
220 +
221 +
222 +
223 +-AM_CFLAGS = -Wall -Werror
224 ++AM_CFLAGS = -Wall
225 +
226 + if ENABLE_CALLGRAPH_COND
227 + AM_CFLAGS += -fdump-rtl-expand
228 +diff -urN a/src/usb/Makefile.am b/src/usb/Makefile.am
229 +--- a/src/usb/Makefile.am 2018-01-20 06:40:55.000000000 +0000
230 ++++ b/src/usb/Makefile.am 2018-01-28 20:18:26.146653076 +0000
231 +@@ -5,7 +5,7 @@
232 + -I$(top_srcdir)/src/public
233 +
234 + AM_CFLAGS = -Wall
235 +-AM_CFLAGS += -Wpedantic
236 ++#AM_CFLAGS += -Wpedantic
237 +
238 + if ENABLE_CALLGRAPH_COND
239 + AM_CFLAGS += -fdump-rtl-expand
240 +diff -urN a/src/util/Makefile.am b/src/util/Makefile.am
241 +--- a/src/util/Makefile.am 2018-01-20 06:40:55.000000000 +0000
242 ++++ b/src/util/Makefile.am 2018-01-28 20:21:07.245901502 +0000
243 +@@ -3,7 +3,7 @@
244 + $(LIBDRM_CFLAGS)
245 +
246 + AM_CFLAGS = -Wall
247 +-AM_CFLAGS += -Werror
248 ++#AM_CFLAGS += -Werror
249 + # -pedantic issues warnings re code that doesn't conform to ISO C
250 + # Alas, -m modifier on sscanf is a POSIX extension, not ISO C
251 + # In combination with -Werror, causes device_util.c to fail compilation
252 +diff -urN a/src/vcp/Makefile.am b/src/vcp/Makefile.am
253 +--- a/src/vcp/Makefile.am 2018-01-20 06:40:55.000000000 +0000
254 ++++ b/src/vcp/Makefile.am 2018-01-28 20:19:28.024750741 +0000
255 +@@ -4,7 +4,7 @@
256 + -I$(top_srcdir)/src/public
257 +
258 + AM_CFLAGS = -Wall
259 +-AM_CFLAGS += -Werror
260 ++#AM_CFLAGS += -Werror
261 + # vcp_feature_codes.c requires extensive changes if -Wpedantic
262 + # AM_CFLAGS += -Wpedantic
263 +