summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Sokolov <sokolov@google.com>2021-06-22 22:14:47 +0100
committerPatrick McLean <chutzpah@gentoo.org>2021-06-22 16:00:00 -0700
commit65aef5dafc07f7cadbf8d2a9817b9aa4425c294b (patch)
treef3cc43580df2d78085d943a2a55a5d1212ce5599 /app-misc
parentapp-misc/openrgb: drop old (diff)
downloadgentoo-65aef5dafc07f7cadbf8d2a9817b9aa4425c294b.tar.gz
gentoo-65aef5dafc07f7cadbf8d2a9817b9aa4425c294b.tar.bz2
gentoo-65aef5dafc07f7cadbf8d2a9817b9aa4425c294b.zip
app-misc/openrgb: allow installing plugins
Package-Manager: Portage-3.0.20, Repoman-3.0.2 Signed-off-by: Alexey Sokolov <alexey+gentoo@asokolov.org> Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
Diffstat (limited to 'app-misc')
-rw-r--r--app-misc/openrgb/files/OpenRGB-0.6-plugins.patch24
-rw-r--r--app-misc/openrgb/openrgb-0.6-r1.ebuild75
-rw-r--r--app-misc/openrgb/openrgb-9999.ebuild24
3 files changed, 120 insertions, 3 deletions
diff --git a/app-misc/openrgb/files/OpenRGB-0.6-plugins.patch b/app-misc/openrgb/files/OpenRGB-0.6-plugins.patch
new file mode 100644
index 000000000000..ccc83de27ebe
--- /dev/null
+++ b/app-misc/openrgb/files/OpenRGB-0.6-plugins.patch
@@ -0,0 +1,24 @@
+Allow installation of plugins not only in ~/.config
+
+Used by app-misc/openrgb-plugin-* packages
+
+diff --git a/PluginManager.cpp b/PluginManager.cpp
+index b424b8b..991fb75 100644
+--- a/PluginManager.cpp
++++ b/PluginManager.cpp
+@@ -15,7 +15,8 @@ void PluginManager::ScanAndLoadPlugins(bool dark_theme)
+ \*--------------------------------------------------------------------------------------*/
+ OpenRGBPluginInterface *OpenRGBPlugin = nullptr;
+
+- const QDir pluginsDir = QString().fromStdString(ResourceManager::get()->GetConfigurationDirectory()) + "plugins/";
++ for (const QDir pluginsDir : {QString().fromStdString(ResourceManager::get()->GetConfigurationDirectory()) + "plugins/",
++ QString().fromStdString(GENTOO_PLUGINS_DIR)}) {
+
+ std::vector<std::string> FileList;
+
+@@ -54,4 +56,5 @@ void PluginManager::ScanAndLoadPlugins(bool dark_theme)
+ std::cout << loader.errorString().toStdString() << std::endl;
+ }
+ }
++ }
+ }
diff --git a/app-misc/openrgb/openrgb-0.6-r1.ebuild b/app-misc/openrgb/openrgb-0.6-r1.ebuild
new file mode 100644
index 000000000000..9384eedb4eb3
--- /dev/null
+++ b/app-misc/openrgb/openrgb-0.6-r1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 2020-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic qmake-utils
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI=${EGIT_REPO_URI:-"https://gitlab.com/CalcProgrammer1/OpenRGB"}
+else
+ SRC_URI="https://gitlab.com/CalcProgrammer1/OpenRGB/-/archive/release_${PV}/OpenRGB-release_${PV}.tar.bz2"
+ S="${WORKDIR}/OpenRGB-release_${PV}"
+ KEYWORDS="~amd64 ~x86"
+ PATCHES=(
+ "${FILESDIR}"/OpenRGB-0.5-build-system.patch
+ )
+fi
+
+DESCRIPTION="Open source RGB lighting control that doesn't depend on manufacturer software"
+HOMEPAGE="https://gitlab.com/CalcProgrammer1/OpenRGB/"
+LICENSE="GPL-2"
+SLOT="0/1"
+
+RDEPEND="
+ dev-libs/hidapi:=
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5
+ virtual/libusb:1
+"
+DEPEND="
+ ${RDEPEND}
+ dev-cpp/nlohmann_json
+"
+BDEPEND="
+ virtual/pkgconfig
+"
+
+PATCHES+=(
+ "${FILESDIR}"/OpenRGB-0.6-pkgconf.patch
+ "${FILESDIR}"/OpenRGB-0.6-plugins.patch
+)
+
+src_prepare() {
+ default
+ rm -r dependencies/{hidapi,libusb,json}* || die
+}
+
+src_configure() {
+ # Some plugins require symbols defined in the main binary.
+ # The official build system bundles OpenRGB as a submodule instead, and
+ # compiles the .cpp file again.
+ append-ldflags -Wl,--export-dynamic
+
+ eqmake5 \
+ INCLUDEPATH+="${ESYSROOT}/usr/include/nlohmann" \
+ DEFINES+="GENTOO_PLUGINS_DIR=\\\\\"\\\"${EPREFIX}/usr/$(get_libdir)/OpenRGB/plugins\\\\\"\\\""
+}
+
+src_install() {
+ emake INSTALL_ROOT="${ED}" install
+
+ dodoc README.md OpenRGB.patch
+
+ # This is for plugins. Upstream doesn't install any headers at all.
+ insinto /usr/include/OpenRGB
+ doins *.h
+ insinto /usr/include/OpenRGB/RGBController
+ doins RGBController/*.h
+ insinto /usr/include/OpenRGB/i2c_smbus
+ doins i2c_smbus/*.h
+ insinto /usr/include/OpenRGB/net_port
+ doins net_port/*.h
+}
diff --git a/app-misc/openrgb/openrgb-9999.ebuild b/app-misc/openrgb/openrgb-9999.ebuild
index c1f1eb4bbcb3..853ad8e04149 100644
--- a/app-misc/openrgb/openrgb-9999.ebuild
+++ b/app-misc/openrgb/openrgb-9999.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-inherit qmake-utils
+inherit flag-o-matic qmake-utils
if [[ ${PV} == *9999* ]]; then
inherit git-r3
@@ -20,7 +20,7 @@ fi
DESCRIPTION="Open source RGB lighting control that doesn't depend on manufacturer software"
HOMEPAGE="https://gitlab.com/CalcProgrammer1/OpenRGB/"
LICENSE="GPL-2"
-SLOT="0"
+SLOT="0/1"
RDEPEND="
dev-libs/hidapi:=
@@ -40,6 +40,7 @@ BDEPEND="
PATCHES+=(
"${FILESDIR}"/OpenRGB-0.6-pkgconf.patch
+ "${FILESDIR}"/OpenRGB-0.6-plugins.patch
)
src_prepare() {
@@ -48,11 +49,28 @@ src_prepare() {
}
src_configure() {
- eqmake5 INCLUDEPATH+="${ESYSROOT}/usr/include/nlohmann"
+ # Some plugins require symbols defined in the main binary.
+ # The official build system bundles OpenRGB as a submodule instead, and
+ # compiles the .cpp file again.
+ append-ldflags -Wl,--export-dynamic
+
+ eqmake5 \
+ INCLUDEPATH+="${ESYSROOT}/usr/include/nlohmann" \
+ DEFINES+="GENTOO_PLUGINS_DIR=\\\\\"\\\"${EPREFIX}/usr/$(get_libdir)/OpenRGB/plugins\\\\\"\\\""
}
src_install() {
emake INSTALL_ROOT="${ED}" install
dodoc README.md OpenRGB.patch
+
+ # This is for plugins. Upstream doesn't install any headers at all.
+ insinto /usr/include/OpenRGB
+ doins *.h
+ insinto /usr/include/OpenRGB/RGBController
+ doins RGBController/*.h
+ insinto /usr/include/OpenRGB/i2c_smbus
+ doins i2c_smbus/*.h
+ insinto /usr/include/OpenRGB/net_port
+ doins net_port/*.h
}