1 |
commit: a761f1bd3c191d71f44c7f96f546af0750233491 |
2 |
Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 9 22:47:07 2021 +0000 |
4 |
Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 9 22:47:07 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a761f1bd |
7 |
|
8 |
app-misc/ddcutil: bump to EAPI=7 |
9 |
|
10 |
Package-Manager: Portage-3.0.20, Repoman-3.0.3 |
11 |
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org> |
12 |
|
13 |
app-misc/ddcutil/ddcutil-0.9.9-r2.ebuild | 117 +++++++++++++++++++++++++++++++ |
14 |
1 file changed, 117 insertions(+) |
15 |
|
16 |
diff --git a/app-misc/ddcutil/ddcutil-0.9.9-r2.ebuild b/app-misc/ddcutil/ddcutil-0.9.9-r2.ebuild |
17 |
new file mode 100644 |
18 |
index 00000000000..2517c6fbb73 |
19 |
--- /dev/null |
20 |
+++ b/app-misc/ddcutil/ddcutil-0.9.9-r2.ebuild |
21 |
@@ -0,0 +1,117 @@ |
22 |
+# Copyright 1999-2021 Gentoo Authors |
23 |
+# Distributed under the terms of the GNU General Public License v2 |
24 |
+ |
25 |
+EAPI=7 |
26 |
+ |
27 |
+inherit autotools flag-o-matic linux-info udev |
28 |
+ |
29 |
+DESCRIPTION="Program for querying and changing monitor settings" |
30 |
+HOMEPAGE="http://www.ddcutil.com/" |
31 |
+SRC_URI="https://github.com/rockowitz/ddcutil/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
32 |
+ |
33 |
+SLOT="0" |
34 |
+LICENSE="GPL-2" |
35 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" |
36 |
+IUSE="drm introspection usb-monitor user-permissions video_cards_nvidia X" |
37 |
+REQUIRED_USE="drm? ( X )" |
38 |
+ |
39 |
+RDEPEND=" |
40 |
+ dev-libs/glib:2 |
41 |
+ sys-apps/i2c-tools |
42 |
+ virtual/udev |
43 |
+ drm? ( x11-libs/libdrm ) |
44 |
+ introspection? ( >=dev-libs/gobject-introspection-1.54.0:= ) |
45 |
+ usb-monitor? ( |
46 |
+ dev-libs/hidapi |
47 |
+ virtual/libusb:1 |
48 |
+ sys-apps/usbutils |
49 |
+ ) |
50 |
+ user-permissions? ( |
51 |
+ acct-group/i2c |
52 |
+ usb-monitor? ( acct-group/video ) |
53 |
+ ) |
54 |
+ X? ( |
55 |
+ x11-libs/libXrandr |
56 |
+ x11-libs/libX11 |
57 |
+ ) |
58 |
+" |
59 |
+DEPEND="${RDEPEND}" |
60 |
+BDEPEND="virtual/pkgconfig" |
61 |
+ |
62 |
+pkg_pretend() { |
63 |
+ # This program needs /dev/ic2-* devices to communicate with the monitor. |
64 |
+ CONFIG_CHECK="~I2C_CHARDEV" |
65 |
+ ERROR_I2C_CHARDEV="You must enable I2C_CHARDEV in your kernel to continue" |
66 |
+ if use usb-monitor; then |
67 |
+ CONFIG_CHECK+=" ~HIDRAW ~USB_HIDDEV" |
68 |
+ ERROR_HIDRAW="HIDRAW is needed to support USB monitors" |
69 |
+ ERROR_I2C_CHARDEV="USB_HIDDEV is needed to support USB monitors" |
70 |
+ fi |
71 |
+ |
72 |
+ # Now do the actual checks setup above |
73 |
+ check_extra_config |
74 |
+} |
75 |
+ |
76 |
+src_prepare() { |
77 |
+ default |
78 |
+ eautoreconf |
79 |
+ sed -e "s#usr/local/bin#usr/bin#" -i data/etc/udev/rules.d/45-ddcutil-usb.rules || die |
80 |
+} |
81 |
+ |
82 |
+src_configure() { |
83 |
+ # Bug 607818. |
84 |
+ replace-flags -O3 -O2 |
85 |
+ |
86 |
+ local myeconfargs=( |
87 |
+ $(use_enable drm) |
88 |
+ $(use_enable usb-monitor usb) |
89 |
+ $(use_enable X x11) |
90 |
+ --enable-lib |
91 |
+ # Please read upstream's note about the original purpose of these flags before re-enabling them: |
92 |
+ # https://github.com/rockowitz/ddcutil/issues/128 |
93 |
+ # As of 0.9.9 the following no longer compile: |
94 |
+ # Python3 & CFFI is already broken as of Python 3.7, with future removal; |
95 |
+ # SWIG : Python3.7 breakage as well PyFileObject vs PyCodeObject |
96 |
+ --disable-cffi |
97 |
+ --disable-cython |
98 |
+ --disable-swig |
99 |
+ $(use_enable introspection) |
100 |
+ ) |
101 |
+ |
102 |
+ econf "${myeconfargs[@]}" |
103 |
+} |
104 |
+ |
105 |
+src_install() { |
106 |
+ default |
107 |
+ if use user-permissions; then |
108 |
+ udev_dorules data/etc/udev/rules.d/45-ddcutil-i2c.rules |
109 |
+ if use usb-monitor; then |
110 |
+ udev_dorules data/etc/udev/rules.d/45-ddcutil-usb.rules |
111 |
+ fi |
112 |
+ fi |
113 |
+} |
114 |
+ |
115 |
+pkg_postinst() { |
116 |
+ if use user-permissions; then |
117 |
+ einfo "To allow non-root users access to the /dev/i2c-* devices, add those" |
118 |
+ einfo "users to the i2c group: usermod -aG i2c user" |
119 |
+ einfo "Restart the computer or reload the i2c-dev module to activate" |
120 |
+ einfo "the new udev rule." |
121 |
+ einfo "For more information read: http://www.ddcutil.com/i2c_permissions/" |
122 |
+ |
123 |
+ if use usb-monitor; then |
124 |
+ einfo "To allow non-root users access to USB monitors, add those users" |
125 |
+ einfo "to the video group: usermod -aG video user" |
126 |
+ einfo "Restart the computer, reload the hiddev and hidraw modules, or replug" |
127 |
+ einfo "the monitor to activate the new udev rule." |
128 |
+ einfo "For more information read: http://www.ddcutil.com/usb/" |
129 |
+ fi |
130 |
+ |
131 |
+ udev_reload |
132 |
+ fi |
133 |
+ |
134 |
+ if use video_cards_nvidia; then |
135 |
+ ewarn "Please read the following webpage on proper usage with the nVidia " |
136 |
+ ewarn "binary drivers, or it may not work: http://www.ddcutil.com/nvidia/" |
137 |
+ fi |
138 |
+} |