Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/openrgb/files/, app-misc/openrgb/
Date: Tue, 22 Jun 2021 23:00:11
Message-Id: 1624402800.65aef5dafc07f7cadbf8d2a9817b9aa4425c294b.chutzpah@gentoo
1 commit: 65aef5dafc07f7cadbf8d2a9817b9aa4425c294b
2 Author: Alexey Sokolov <sokolov <AT> google <DOT> com>
3 AuthorDate: Tue Jun 22 21:14:47 2021 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 22 23:00:00 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65aef5da
7
8 app-misc/openrgb: allow installing plugins
9
10 Package-Manager: Portage-3.0.20, Repoman-3.0.2
11 Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org>
12 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
13
14 app-misc/openrgb/files/OpenRGB-0.6-plugins.patch | 24 +++++++++++++++++++
15 .../{openrgb-9999.ebuild => openrgb-0.6-r1.ebuild} | 27 ++++++++++++++++++----
16 app-misc/openrgb/openrgb-9999.ebuild | 24 ++++++++++++++++---
17 3 files changed, 67 insertions(+), 8 deletions(-)
18
19 diff --git a/app-misc/openrgb/files/OpenRGB-0.6-plugins.patch b/app-misc/openrgb/files/OpenRGB-0.6-plugins.patch
20 new file mode 100644
21 index 00000000000..ccc83de27eb
22 --- /dev/null
23 +++ b/app-misc/openrgb/files/OpenRGB-0.6-plugins.patch
24 @@ -0,0 +1,24 @@
25 +Allow installation of plugins not only in ~/.config
26 +
27 +Used by app-misc/openrgb-plugin-* packages
28 +
29 +diff --git a/PluginManager.cpp b/PluginManager.cpp
30 +index b424b8b..991fb75 100644
31 +--- a/PluginManager.cpp
32 ++++ b/PluginManager.cpp
33 +@@ -15,7 +15,8 @@ void PluginManager::ScanAndLoadPlugins(bool dark_theme)
34 + \*--------------------------------------------------------------------------------------*/
35 + OpenRGBPluginInterface *OpenRGBPlugin = nullptr;
36 +
37 +- const QDir pluginsDir = QString().fromStdString(ResourceManager::get()->GetConfigurationDirectory()) + "plugins/";
38 ++ for (const QDir pluginsDir : {QString().fromStdString(ResourceManager::get()->GetConfigurationDirectory()) + "plugins/",
39 ++ QString().fromStdString(GENTOO_PLUGINS_DIR)}) {
40 +
41 + std::vector<std::string> FileList;
42 +
43 +@@ -54,4 +56,5 @@ void PluginManager::ScanAndLoadPlugins(bool dark_theme)
44 + std::cout << loader.errorString().toStdString() << std::endl;
45 + }
46 + }
47 ++ }
48 + }
49
50 diff --git a/app-misc/openrgb/openrgb-9999.ebuild b/app-misc/openrgb/openrgb-0.6-r1.ebuild
51 similarity index 55%
52 copy from app-misc/openrgb/openrgb-9999.ebuild
53 copy to app-misc/openrgb/openrgb-0.6-r1.ebuild
54 index c1f1eb4bbcb..9384eedb4eb 100644
55 --- a/app-misc/openrgb/openrgb-9999.ebuild
56 +++ b/app-misc/openrgb/openrgb-0.6-r1.ebuild
57 @@ -3,7 +3,7 @@
58
59 EAPI=7
60
61 -inherit qmake-utils
62 +inherit flag-o-matic qmake-utils
63
64 if [[ ${PV} == *9999* ]]; then
65 inherit git-r3
66 @@ -20,14 +20,13 @@ fi
67 DESCRIPTION="Open source RGB lighting control that doesn't depend on manufacturer software"
68 HOMEPAGE="https://gitlab.com/CalcProgrammer1/OpenRGB/"
69 LICENSE="GPL-2"
70 -SLOT="0"
71 +SLOT="0/1"
72
73 RDEPEND="
74 dev-libs/hidapi:=
75 dev-qt/qtcore:5
76 dev-qt/qtgui:5
77 dev-qt/qtwidgets:5
78 - net-libs/mbedtls:=
79 virtual/libusb:1
80 "
81 DEPEND="
82 @@ -40,19 +39,37 @@ BDEPEND="
83
84 PATCHES+=(
85 "${FILESDIR}"/OpenRGB-0.6-pkgconf.patch
86 + "${FILESDIR}"/OpenRGB-0.6-plugins.patch
87 )
88
89 src_prepare() {
90 default
91 - rm -r dependencies/{hidapi,libusb,json,mbedtls}* || die
92 + rm -r dependencies/{hidapi,libusb,json}* || die
93 }
94
95 src_configure() {
96 - eqmake5 INCLUDEPATH+="${ESYSROOT}/usr/include/nlohmann"
97 + # Some plugins require symbols defined in the main binary.
98 + # The official build system bundles OpenRGB as a submodule instead, and
99 + # compiles the .cpp file again.
100 + append-ldflags -Wl,--export-dynamic
101 +
102 + eqmake5 \
103 + INCLUDEPATH+="${ESYSROOT}/usr/include/nlohmann" \
104 + DEFINES+="GENTOO_PLUGINS_DIR=\\\\\"\\\"${EPREFIX}/usr/$(get_libdir)/OpenRGB/plugins\\\\\"\\\""
105 }
106
107 src_install() {
108 emake INSTALL_ROOT="${ED}" install
109
110 dodoc README.md OpenRGB.patch
111 +
112 + # This is for plugins. Upstream doesn't install any headers at all.
113 + insinto /usr/include/OpenRGB
114 + doins *.h
115 + insinto /usr/include/OpenRGB/RGBController
116 + doins RGBController/*.h
117 + insinto /usr/include/OpenRGB/i2c_smbus
118 + doins i2c_smbus/*.h
119 + insinto /usr/include/OpenRGB/net_port
120 + doins net_port/*.h
121 }
122
123 diff --git a/app-misc/openrgb/openrgb-9999.ebuild b/app-misc/openrgb/openrgb-9999.ebuild
124 index c1f1eb4bbcb..853ad8e0414 100644
125 --- a/app-misc/openrgb/openrgb-9999.ebuild
126 +++ b/app-misc/openrgb/openrgb-9999.ebuild
127 @@ -3,7 +3,7 @@
128
129 EAPI=7
130
131 -inherit qmake-utils
132 +inherit flag-o-matic qmake-utils
133
134 if [[ ${PV} == *9999* ]]; then
135 inherit git-r3
136 @@ -20,7 +20,7 @@ fi
137 DESCRIPTION="Open source RGB lighting control that doesn't depend on manufacturer software"
138 HOMEPAGE="https://gitlab.com/CalcProgrammer1/OpenRGB/"
139 LICENSE="GPL-2"
140 -SLOT="0"
141 +SLOT="0/1"
142
143 RDEPEND="
144 dev-libs/hidapi:=
145 @@ -40,6 +40,7 @@ BDEPEND="
146
147 PATCHES+=(
148 "${FILESDIR}"/OpenRGB-0.6-pkgconf.patch
149 + "${FILESDIR}"/OpenRGB-0.6-plugins.patch
150 )
151
152 src_prepare() {
153 @@ -48,11 +49,28 @@ src_prepare() {
154 }
155
156 src_configure() {
157 - eqmake5 INCLUDEPATH+="${ESYSROOT}/usr/include/nlohmann"
158 + # Some plugins require symbols defined in the main binary.
159 + # The official build system bundles OpenRGB as a submodule instead, and
160 + # compiles the .cpp file again.
161 + append-ldflags -Wl,--export-dynamic
162 +
163 + eqmake5 \
164 + INCLUDEPATH+="${ESYSROOT}/usr/include/nlohmann" \
165 + DEFINES+="GENTOO_PLUGINS_DIR=\\\\\"\\\"${EPREFIX}/usr/$(get_libdir)/OpenRGB/plugins\\\\\"\\\""
166 }
167
168 src_install() {
169 emake INSTALL_ROOT="${ED}" install
170
171 dodoc README.md OpenRGB.patch
172 +
173 + # This is for plugins. Upstream doesn't install any headers at all.
174 + insinto /usr/include/OpenRGB
175 + doins *.h
176 + insinto /usr/include/OpenRGB/RGBController
177 + doins RGBController/*.h
178 + insinto /usr/include/OpenRGB/i2c_smbus
179 + doins i2c_smbus/*.h
180 + insinto /usr/include/OpenRGB/net_port
181 + doins net_port/*.h
182 }