[PATCH 0/2] Add hueplusplus and openrgb packages

  • Done
  • quality assurance status badge
Details
2 participants
  • John Kehayias
  • Leo Famulari
Owner
unassigned
Submitted by
John Kehayias
Severity
normal

Debbugs page

John Kehayias wrote 3 years ago
(name . Guix-patches)(address . guix-patches@gnu.org)
8kDa5BwxgvImH1twP-arHvnr2uWjd9fD1W1aps78RfNGeGGJHrssV32IjguzF08xnrg1Bu-jiqlt9A1dmVj02SP2qKesg6vQMcDQy7SB7Qs=@protonmail.com
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
John Kehayias wrote 3 years ago
[PATCH 1/2] gnu: Add hueplusplus.
(name . 52960@debbugs.gnu.org)(address . 52960@debbugs.gnu.org)
AtnbmVLO4X5c4ua1Lrwia6r1XhxluwNvaXcpJw7TaQOEuQMVkJz1fMcw_iyVmSY4bTYoBnte9G7InRX5UAi1nRRcjB7ipCerKtrfbjlpGLE=@protonmail.com
Empty Message
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

Toggle diff (97 lines)
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
John Kehayias wrote 3 years ago
[PATCH 2/2] gnu: Add openrgb.
(name . 52960@debbugs.gnu.org)(address . 52960@debbugs.gnu.org)
5qKkTt1McZS-UbTwU5kWWoWP9ITNBOXiPGzPszfABZ5JfEQwS99cu-8rV-8X6U7P9gywqc5v8pQkF6nio8dhyIyN1lGq57LKUSD2vZF5vKw=@protonmail.com
Empty Message
Leo Famulari wrote 3 years ago
Re: [bug#52960] [PATCH 0/2] Add hueplusplus and openrgb packages
(name . John Kehayias via Guix-patches via)(address . guix-patches@gnu.org)(address . 52960-done@debbugs.gnu.org)
Ydc0jGwb3bfiLYR/@jasmine.lan
On Sun, Jan 02, 2022 at 05:12:56PM +0000, John Kehayias via Guix-patches via wrote:
Toggle quote (6 lines)
> 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:


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:


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!
?
Your comment

This issue is archived.

To comment on this conversation send an email to 52960@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 52960
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help