Gentoo Archives: gentoo-commits

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