GNU bug report logs - #33756
[PATCH] gnu: Add sct.

Previous Next

Package: guix-patches;

Reported by: Nam Nguyen <namn <at> berkeley.edu>

Date: Sat, 15 Dec 2018 07:11:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33756 in the body.
You can then email your comments to 33756 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#33756; Package guix-patches. (Sat, 15 Dec 2018 07:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nam Nguyen <namn <at> berkeley.edu>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 15 Dec 2018 07:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nam Nguyen <namn <at> berkeley.edu>
To: guix-patches <at> gnu.org
Cc: Nam Nguyen <namn <at> berkeley.edu>
Subject: [PATCH] gnu: Add sct.
Date: Fri, 14 Dec 2018 23:09:59 -0800
* gnu/packages/xdisorg.scm (sct): New variable.
---
 gnu/packages/xdisorg.scm | 44 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 82ed065a3..5d6257ab8 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -24,6 +24,7 @@
 ;;; Copyright © 2018 Thomas Sigurdsen <tonton <at> riseup.net>
 ;;; Copyright © 2018 Rutger Helling <rhelling <at> mykolab.com>
 ;;; Copyright © 2018 Pierre Neidhardt <mail <at> ambrevar.xyz>
+;;; Copyright © 2018 Nam Nguyen <namn <at> berkeley.edu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1555,3 +1556,46 @@ to automatically turn it on on login.")
     (description "This package provides a small utility for inverting the
 colors on all monitors attached to an XRandR-capable X11 display server.")
     (license license:gpl3+)))
+
+(define-public sct
+  (package
+    (name "sct")
+    (version "0.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "https://www.umaxx.net/dl/sct-"
+                       version ".tar.gz"))
+       (sha256
+        (base32
+         "0r57z9ki8pvxhawfxys0v5h85z2x211sqxki0xvk1bga88ryldlv"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'replace-cc-with-gcc
+           ;; Use gcc in Makefile.
+           (lambda _
+             (substitute* "Makefile"
+               (("CC\\?\\=gcc")
+                "CC=gcc"))))
+         (delete 'configure)
+         (delete 'check)
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (install-file "sct" (string-append out "/bin"))
+               (install-file "sctd.sh" (string-append out "/bin"))
+               (mkdir (string-append out "/man"))
+               (mkdir (string-append out "/man/man1"))
+               (install-file "sct.1" (string-append out "/man/man1"))
+               (install-file "sctd.1" (string-append out "/man/man1"))
+               #t))))))
+    (inputs
+     `(("libxrandr" ,libxrandr)))
+    (home-page "https://www.umaxx.net/")
+    (synopsis "Set the color temperature of the screen")
+    (description "@code{sct} is a lightweight utility to set the color
+temperature of the screen.")
+    (license license:bsd-3)))
-- 
2.20.0





Information forwarded to guix-patches <at> gnu.org:
bug#33756; Package guix-patches. (Sat, 15 Dec 2018 16:50:01 GMT) Full text and rfc822 format available.

Message #8 received at 33756 <at> debbugs.gnu.org (full text, mbox):

From: Nam Nguyen <namn <at> berkeley.edu>
To: 33756 <at> debbugs.gnu.org
Subject: correction
Date: Sat, 15 Dec 2018 08:49:15 -0800
The trailing / in home-page should be removed.




Information forwarded to guix-patches <at> gnu.org:
bug#33756; Package guix-patches. (Sun, 16 Dec 2018 11:56:01 GMT) Full text and rfc822 format available.

Message #11 received at 33756 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Nam Nguyen <namn <at> berkeley.edu>
Cc: 33756 <at> debbugs.gnu.org
Subject: Re: [bug#33756] correction
Date: Sun, 16 Dec 2018 12:55:12 +0100
[Message part 1 (text/plain, inline)]
Hi,

thanks for the patch.  I have the following suggestions:

* It's easier to just use #:make-flags to override the CC make variable -- and
it doesn't require a custom phase
* It's clearer to use #:tests? #f to indicate that there are no tests.
* install-file makes sure that the destination directory exists already,
so it's useless to manually create it
* sctd.sh uses "which" to find the "sct" executable.  Please patch it
so that it uses the sct executable of (assoc-ref outputs "out") "/bin"
(i.e. hard-code it) instead
* sctd.sh uses "logger" which is part of inetutils, so inetutils should
be a regular input.  Moreover, please patch sctd.sh so it uses inetutils'
logger (i.e. hard-code it using (assoc-ref inputs "inetutils"))
* sctd.sh uses "date", "printf" and "sleep" which are part of coreutils,
so coreutils should be a regular input.  Moreover, please patch sctd.sh so
it uses coreutils' things (i.e. hard-code it using (assoc-ref inputs "coreutils")

(See other files for how to use "substitute*" to patch things)

Could you send an updated patch?
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#33756; Package guix-patches. (Sun, 16 Dec 2018 21:26:02 GMT) Full text and rfc822 format available.

Message #14 received at 33756 <at> debbugs.gnu.org (full text, mbox):

From: Nam Nguyen <namn <at> berkeley.edu>
To: 33756 <at> debbugs.gnu.org
Subject: [PATCH] gnu: Add sct.
Date: Sun, 16 Dec 2018 13:25:11 -0800
* gnu/packages/xdisorg.scm (sct): New variable.
---
 gnu/packages/xdisorg.scm | 55 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 82ed065a3..dedff620d 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -24,6 +24,7 @@
 ;;; Copyright © 2018 Thomas Sigurdsen <tonton <at> riseup.net>
 ;;; Copyright © 2018 Rutger Helling <rhelling <at> mykolab.com>
 ;;; Copyright © 2018 Pierre Neidhardt <mail <at> ambrevar.xyz>
+;;; Copyright © 2018 Nam Nguyen <namn <at> berkeley.edu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -52,6 +53,8 @@
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages documentation)
+  #:use-module (gnu packages admin)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages check)
@@ -1555,3 +1558,55 @@ to automatically turn it on on login.")
     (description "This package provides a small utility for inverting the
 colors on all monitors attached to an XRandR-capable X11 display server.")
     (license license:gpl3+)))
+
+(define-public sct
+  (package
+    (name "sct")
+    (version "0.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "https://www.umaxx.net/dl/sct-"
+                       version ".tar.gz"))
+       (sha256
+        (base32
+         "0r57z9ki8pvxhawfxys0v5h85z2x211sqxki0xvk1bga88ryldlv"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:make-flags (list "CC=gcc")
+       #:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (delete 'check)
+         (add-after 'unpack 'fix-sctd-paths
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (coreutils (assoc-ref inputs "coreutils"))
+                   (inetutils (assoc-ref inputs "inetutils")))
+               (substitute* "sctd.sh"
+                 (("\\$\\(which sct\\)") (string-append out "/bin/sct"))
+                 (("date") (string-append coreutils "/bin/date"))
+                 (("printf") (string-append coreutils "/bin/printf"))
+                 (("sleep") (string-append coreutils "/bin/sleep"))
+                 (("logger") (string-append inetutils "/bin/logger"))))))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (install-file "sct" (string-append out "/bin"))
+               (install-file "sctd.sh" (string-append out "/bin"))
+               (install-file "sct.1" (string-append out "/man/man1"))
+               (install-file "sctd.1" (string-append out "/man/man1"))
+               (rename-file (string-append out "/bin/sctd.sh")
+                            (string-append out "/bin/sctd"))
+               #t))))))
+    (inputs
+     `(("coreutils" ,coreutils) ; sctd uses "date", "printf" and "sleep"
+       ("inetutils" ,inetutils) ; sctd uses "logger"
+       ("libxrandr" ,libxrandr)))
+    (home-page "https://www.umaxx.net")
+    (synopsis "Set the color temperature of the screen")
+    (description "@code{sct} is a lightweight utility to set the color
+temperature of the screen.")
+    (license license:bsd-3)))
-- 
2.20.0





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sun, 23 Dec 2018 17:38:02 GMT) Full text and rfc822 format available.

Notification sent to Nam Nguyen <namn <at> berkeley.edu>:
bug acknowledged by developer. (Sun, 23 Dec 2018 17:38:02 GMT) Full text and rfc822 format available.

Message #19 received at 33756-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Nam Nguyen <namn <at> berkeley.edu>
Cc: 33756-done <at> debbugs.gnu.org
Subject: Re: [bug#33756] [PATCH] gnu: Add sct.
Date: Sun, 23 Dec 2018 18:37:41 +0100
Nam Nguyen <namn <at> berkeley.edu> skribis:

> * gnu/packages/xdisorg.scm (sct): New variable.

This was applied as commit d852cf9e331888c23b4f9377064145ae74339644,
thank you & Danny!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 21 Jan 2019 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 234 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.