* [bug#52960] [PATCH 0/2] Add hueplusplus and openrgb packages
@ 2022-01-02 17:12 John Kehayias via Guix-patches via
2022-01-02 17:15 ` [bug#52960] [PATCH 1/2] gnu: Add hueplusplus John Kehayias via Guix-patches via
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: John Kehayias via Guix-patches via @ 2022-01-02 17:12 UTC (permalink / raw)
To: 52960
Hi Guix,
Incoming are two patches for control of hardware lights, hueplusplus (the Hue lighting system, but I haven't tried it) and OpenRGB. I've been using OpenRGB on my computer to control all those LEDs and it has worked well. The package includes needed udev rules, but that could be split out if desired (is just a single file in the source tree).
Both packages required some unbundling, mbedtls for hueplusplus and json plus hueplusplus for OpenRGB. OpenRGB has other libraries in the dependencies folder, but as far as I can tell the others are either for different systems (Windows), or are modified/updated versions of other libraries. A few also just seem like smaller helper libraries that only live in there. Please let me know if I missed something though.
Thanks!
John
^ permalink raw reply [flat|nested] 4+ messages in thread
* [bug#52960] [PATCH 1/2] gnu: Add hueplusplus.
2022-01-02 17:12 [bug#52960] [PATCH 0/2] Add hueplusplus and openrgb packages John Kehayias via Guix-patches via
@ 2022-01-02 17:15 ` John Kehayias via Guix-patches via
2022-01-02 17:16 ` [bug#52960] [PATCH 2/2] gnu: Add openrgb John Kehayias via Guix-patches via
2022-01-06 18:27 ` [bug#52960] [PATCH 0/2] Add hueplusplus and openrgb packages Leo Famulari
2 siblings, 0 replies; 4+ messages in thread
From: John Kehayias via Guix-patches via @ 2022-01-02 17:15 UTC (permalink / raw)
To: 52960@debbugs.gnu.org
[-- Attachment #1: Type: text/plain, Size: 13 bytes --]
Empty Message
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-hueplusplus.patch --]
[-- Type: text/x-patch; name=0001-gnu-Add-hueplusplus.patch, Size: 4358 bytes --]
From ea9b2e7650f0cae46912d23e598b6bcfd148a2bf Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Sun, 2 Jan 2022 11:38:03 -0500
Subject: [PATCH 1/2] gnu: Add hueplusplus.
* gnu/packages/hardware.scm (hueplusplus): New variable.
* gnu/packages/patches/hueplusplus-mbedtls.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
gnu/local.mk | 1 +
gnu/packages/hardware.scm | 39 ++++++++++++++++++-
.../patches/hueplusplus-mbedtls.patch | 20 ++++++++++
3 files changed, 59 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/hueplusplus-mbedtls.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 852f9f3246..b427edb4a4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1260,6 +1260,7 @@ dist_patch_DATA = \
%D%/packages/patches/helm-fix-gcc-9-build.patch \
%D%/packages/patches/http-parser-CVE-2020-8287.patch \
%D%/packages/patches/hubbub-sort-entities.patch \
+ %D%/packages/patches/hueplusplus-mbedtls.patch \
%D%/packages/patches/hurd-cross.patch \
%D%/packages/patches/hurd-xattr.patch \
%D%/packages/patches/hydra-disable-darcs-test.patch \
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 28647477fe..227a359adb 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -8,7 +8,7 @@
;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
-;;; Copyright © 2021 John Kehayias <john.kehayias@protonmail.com>
+;;; Copyright © 2021, 2022 John Kehayias <john.kehayias@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -341,6 +341,43 @@ (define-public headsetcontrol
battery state, controlling LEDs, and setting the inactive time.")
(license license:gpl3+)))
+(define-public hueplusplus
+ (package
+ (name "hueplusplus")
+ (version "1.1.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/enwi/hueplusplus")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1jy8m2a0h0kf0aw8jbniz069q9j7cx67b1zlv2vz1ymq921qk0pm"))
+ (patches
+ (search-patches "hueplusplus-mbedtls.patch"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:tests? #f)) ;; Tests require Google's gtest and gmock
+ (inputs
+ (list mbedtls-apache))
+ (synopsis "Simple C++ library to control Philips Hue lights")
+ (description "Hueplusplus is a simple and easy to use library for Philips Hue Lights.
+Features:
+
+@itemize
+@item find bridges with SSDP or set an ip manually
+@item all common light functions (brightness, color, temperature)
+@item extended @code{alert()} functions, which alert in a specific
+color (good for notifications)
+@item supports sensors, rules, groups, scenes and schedules
+@item streaming with entertainment mode
+@item documented with doxygen
+@item tested with google test, google mock and gcov/lcov
+@end itemize")
+ (home-page "https://github.com/enwi/hueplusplus")
+ (license license:lgpl3)))
+
(define-public i7z
(let ((revision "0")
(commit "1a41ff13db747e962456ddbb5ccb2b7fc43ca0cb"))
diff --git a/gnu/packages/patches/hueplusplus-mbedtls.patch b/gnu/packages/patches/hueplusplus-mbedtls.patch
new file mode 100644
index 0000000000..894590af8d
--- /dev/null
+++ b/gnu/packages/patches/hueplusplus-mbedtls.patch
@@ -0,0 +1,20 @@
+Remove references to bundled mbedtls library to use the one from inputs.
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1e27d21..f0eb1a5 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -85,13 +85,6 @@ endif()
+
+ set(USE_STATIC_MBEDTLS_LIBRARY ON)
+ set(USE_SHARED_MBEDTLS_LIBRARY OFF)
+-add_subdirectory("lib/mbedtls" EXCLUDE_FROM_ALL)
+-
+-# Compile the mbedtls library as a static with position independent code,
+-# because we need it for both a shared and static library
+-set_property(TARGET mbedtls PROPERTY POSITION_INDEPENDENT_CODE ON)
+-set_property(TARGET mbedcrypto PROPERTY POSITION_INDEPENDENT_CODE ON)
+-set_property(TARGET mbedx509 PROPERTY POSITION_INDEPENDENT_CODE ON)
+
+ add_subdirectory(src)
+
--
2.34.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [bug#52960] [PATCH 2/2] gnu: Add openrgb.
2022-01-02 17:12 [bug#52960] [PATCH 0/2] Add hueplusplus and openrgb packages John Kehayias via Guix-patches via
2022-01-02 17:15 ` [bug#52960] [PATCH 1/2] gnu: Add hueplusplus John Kehayias via Guix-patches via
@ 2022-01-02 17:16 ` John Kehayias via Guix-patches via
2022-01-06 18:27 ` [bug#52960] [PATCH 0/2] Add hueplusplus and openrgb packages Leo Famulari
2 siblings, 0 replies; 4+ messages in thread
From: John Kehayias via Guix-patches via @ 2022-01-02 17:16 UTC (permalink / raw)
To: 52960@debbugs.gnu.org
[-- Attachment #1: Type: text/plain, Size: 13 bytes --]
Empty Message
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-gnu-Add-openrgb.patch --]
[-- Type: text/x-patch; name=0002-gnu-Add-openrgb.patch, Size: 9429 bytes --]
From a94e57199dfe0fa9c3b11d5b6075f7be25105f74 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Sun, 2 Jan 2022 11:55:27 -0500
Subject: [PATCH 2/2] gnu: Add openrgb.
* gnu/packages/hardware.scm (openrgb): New variable.
* gnu/packages/patches/openrgb-unbundle-hueplusplus.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
gnu/local.mk | 1 +
gnu/packages/hardware.scm | 69 +++++++++++++++++++
.../openrgb-unbundle-hueplusplus.patch | 58 ++++++++++++++++
3 files changed, 128 insertions(+)
create mode 100644 gnu/packages/patches/openrgb-unbundle-hueplusplus.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index b427edb4a4..a162275eca 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1559,6 +1559,7 @@ dist_patch_DATA = \
%D%/packages/patches/openmpi-mtl-priorities.patch \
%D%/packages/patches/openssh-hurd.patch \
%D%/packages/patches/openresolv-restartcmd-guix.patch \
+ %D%/packages/patches/openrgb-unbundle-hueplusplus.patch \
%D%/packages/patches/opensles-add-license-file.patch \
%D%/packages/patches/openssl-runpath.patch \
%D%/packages/patches/openssl-1.1-c-rehash-in.patch \
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 227a359adb..a146132b04 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -651,6 +651,75 @@ (define-public openhmd
technology, such as head mounted displays with built in head tracking.")
(license license:boost1.0)))
+(define-public openrgb
+ (package
+ (name "openrgb")
+ (version "0.7")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/CalcProgrammer1/OpenRGB")
+ (commit (string-append "release_" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0xhfaz0b74nfnh7il2cz5c0338xlzay00g6hc2h3lsncarj8d5n7"))
+ (patches
+ (search-patches "openrgb-unbundle-hueplusplus.patch"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ ;; Delete the bundled hueplusplus and json libraries.
+ (delete-file-recursively "dependencies/hueplusplus-1.0.0")
+ (delete-file-recursively "dependencies/json")))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:tests? #f ; doesn't have tests
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'unbundle
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "OpenRGB.pro"
+ (("dependencies/hueplusplus-1.0.0/include/hueplusplus")
+ (search-input-directory inputs "include/hueplusplus"))
+ (("dependencies/json")
+ (search-input-directory inputs "include/nlohmann")))))
+ ;; Call qmake instead of configure to create a Makefile.
+ (replace 'configure
+ (lambda _ (invoke "qmake" "PREFIX=/" "OpenRGB.pro"))))
+ #:make-flags
+ (list (string-append "INSTALL_ROOT=" (assoc-ref %outputs "out")))))
+ (inputs
+ (list hidapi
+ hueplusplus
+ json-modern-cxx
+ libusb
+ mbedtls-apache
+ qtbase-5))
+ (native-inputs
+ (list pkg-config))
+ (synopsis "Open source RGB lighting control")
+ (description
+ "OpenRGB is lighting control that doesn't depend on manufacturer software.
+ASUS, ASRock, Corsair, G.Skill, Gigabyte, HyperX, MSI, Razer, ThermalTake, and more
+supported.
+
+Features:
+
+@itemize
+@item Set colors and select effect modes for a wide variety of RGB hardware
+@item Save and load profiles
+@item Control lighting from third party software using the OpenRGB SDK
+@item Command line interface
+@item Connect multiple instances of OpenRGB to synchronize lighting across multiple PCs
+@item Can operate standalone or in a client/headless server configuration
+@item View device information
+@item No official/manufacturer software required
+@item Graphical view of device LEDs makes creating custom patterns easy
+@end itemize")
+ (home-page "https://openrgb.org/")
+ (license license:gpl2))) ; Included libccmmk is lgpl3+, CRC is bsd-3
+
(define-public wavemon
(package
(name "wavemon")
diff --git a/gnu/packages/patches/openrgb-unbundle-hueplusplus.patch b/gnu/packages/patches/openrgb-unbundle-hueplusplus.patch
new file mode 100644
index 0000000000..7454e1efbe
--- /dev/null
+++ b/gnu/packages/patches/openrgb-unbundle-hueplusplus.patch
@@ -0,0 +1,58 @@
+Remove references to hueplusplus in order to unbundle and use the input package.
+
+diff --git a/OpenRGB.pro b/OpenRGB.pro
+index 61758892..8702d998 100644
+--- a/OpenRGB.pro
++++ b/OpenRGB.pro
+@@ -493,35 +493,6 @@ SOURCES +=
+ dependencies/Swatches/swatches.cpp \
+ dependencies/dmiinfo.cpp \
+ dependencies/ColorWheel/ColorWheel.cpp \
+- dependencies/hueplusplus-1.0.0/src/Action.cpp \
+- dependencies/hueplusplus-1.0.0/src/APICache.cpp \
+- dependencies/hueplusplus-1.0.0/src/BaseDevice.cpp \
+- dependencies/hueplusplus-1.0.0/src/BaseHttpHandler.cpp \
+- dependencies/hueplusplus-1.0.0/src/Bridge.cpp \
+- dependencies/hueplusplus-1.0.0/src/BridgeConfig.cpp \
+- dependencies/hueplusplus-1.0.0/src/CLIPSensors.cpp \
+- dependencies/hueplusplus-1.0.0/src/ColorUnits.cpp \
+- dependencies/hueplusplus-1.0.0/src/EntertainmentMode.cpp \
+- dependencies/hueplusplus-1.0.0/src/ExtendedColorHueStrategy.cpp \
+- dependencies/hueplusplus-1.0.0/src/ExtendedColorTemperatureStrategy.cpp \
+- dependencies/hueplusplus-1.0.0/src/Group.cpp \
+- dependencies/hueplusplus-1.0.0/src/HueCommandAPI.cpp \
+- dependencies/hueplusplus-1.0.0/src/HueDeviceTypes.cpp \
+- dependencies/hueplusplus-1.0.0/src/HueException.cpp \
+- dependencies/hueplusplus-1.0.0/src/Light.cpp \
+- dependencies/hueplusplus-1.0.0/src/ModelPictures.cpp \
+- dependencies/hueplusplus-1.0.0/src/NewDeviceList.cpp \
+- dependencies/hueplusplus-1.0.0/src/Scene.cpp \
+- dependencies/hueplusplus-1.0.0/src/Schedule.cpp \
+- dependencies/hueplusplus-1.0.0/src/Sensor.cpp \
+- dependencies/hueplusplus-1.0.0/src/SimpleBrightnessStrategy.cpp \
+- dependencies/hueplusplus-1.0.0/src/SimpleColorHueStrategy.cpp \
+- dependencies/hueplusplus-1.0.0/src/SimpleColorTemperatureStrategy.cpp \
+- dependencies/hueplusplus-1.0.0/src/StateTransaction.cpp \
+- dependencies/hueplusplus-1.0.0/src/TimePattern.cpp \
+- dependencies/hueplusplus-1.0.0/src/UPnP.cpp \
+- dependencies/hueplusplus-1.0.0/src/Utils.cpp \
+- dependencies/hueplusplus-1.0.0/src/ZLLSensors.cpp \
+ dependencies/libe131/src/e131.c \
+ dependencies/libcmmk/src/libcmmk.c \
+ main.cpp \
+@@ -1188,6 +1159,7 @@ unix:!macx {
+ -lmbedx509 \
+ -lmbedtls \
+ -lmbedcrypto \
++ -lhueplusplusshared \
+
+ COMPILER_VERSION = $$system($$QMAKE_CXX " -dumpversion")
+ if (!versionAtLeast(COMPILER_VERSION, "9")) {
+@@ -1218,7 +1190,6 @@ unix:!macx {
+ }
+
+ SOURCES += \
+- dependencies/hueplusplus-1.0.0/src/LinHttpHandler.cpp \
+ i2c_smbus/i2c_smbus_linux.cpp \
+ serial_port/find_usb_serial_port_linux.cpp \
+ AutoStart/AutoStart-Linux.cpp \
--
2.34.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [bug#52960] [PATCH 0/2] Add hueplusplus and openrgb packages
2022-01-02 17:12 [bug#52960] [PATCH 0/2] Add hueplusplus and openrgb packages John Kehayias via Guix-patches via
2022-01-02 17:15 ` [bug#52960] [PATCH 1/2] gnu: Add hueplusplus John Kehayias via Guix-patches via
2022-01-02 17:16 ` [bug#52960] [PATCH 2/2] gnu: Add openrgb John Kehayias via Guix-patches via
@ 2022-01-06 18:27 ` Leo Famulari
2 siblings, 0 replies; 4+ messages in thread
From: Leo Famulari @ 2022-01-06 18:27 UTC (permalink / raw)
To: 52960; +Cc: 52960-done
On Sun, Jan 02, 2022 at 05:12:56PM +0000, John Kehayias via Guix-patches via wrote:
> Hi Guix,
>
> Incoming are two patches for control of hardware lights, hueplusplus (the Hue lighting system, but I haven't tried it) and OpenRGB. I've been using OpenRGB on my computer to control all those LEDs and it has worked well. The package includes needed udev rules, but that could be split out if desired (is just a single file in the source tree).
>
> Both packages required some unbundling, mbedtls for hueplusplus and json plus hueplusplus for OpenRGB. OpenRGB has other libraries in the dependencies folder, but as far as I can tell the others are either for different systems (Windows), or are modified/updated versions of other libraries. A few also just seem like smaller helper libraries that only live in there. Please let me know if I missed something though.
Thanks! I pushed as b1cf1d44f402cef3fccbb37277554bc7d5dd27d4 with the
following changes:
I changed the license of hueplusplus from lgpl3 to lgpl3+. This is
because the source file license headers all say "either version 3 of the License, or
(at your option) any later version." For example:
https://github.com/enwi/hueplusplus/blob/master/src/Schedule.cpp
From the hueplusplus description, I removed from the feature list
"tested with google test", since we aren't doing that yet.
I alo removed some of the so-called "marketing language" from the
synopsis and description of hueplusplus. For example, "simple and easy
to use". This subject is mentioned here:
https://guix.gnu.org/manual/devel/en/html_node/Synopses-and-Descriptions.html
For OpenRGB, I changed the arguments field to use the new style, with
G-Expressions. And I removed the phrase "Open source" from its synopsis.
Everything in Guix is free and open source, so we don't mention it :)
Thanks again for these contributions!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-01-06 19:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-02 17:12 [bug#52960] [PATCH 0/2] Add hueplusplus and openrgb packages John Kehayias via Guix-patches via
2022-01-02 17:15 ` [bug#52960] [PATCH 1/2] gnu: Add hueplusplus John Kehayias via Guix-patches via
2022-01-02 17:16 ` [bug#52960] [PATCH 2/2] gnu: Add openrgb John Kehayias via Guix-patches via
2022-01-06 18:27 ` [bug#52960] [PATCH 0/2] Add hueplusplus and openrgb packages Leo Famulari
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.