diff mbox series

[bug#56770,v3] gnu: Add grimshot.

Message ID 20220726204858.442904-1-antero@mailbox.org
State Accepted
Headers show
Series [bug#56770,v3] gnu: Add grimshot. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Antero Mejr July 26, 2022, 8:48 p.m. UTC
* gnu/packages/wm.scm (grimshot): New variable.
---
 gnu/packages/wm.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

Comments

M July 26, 2022, 10:06 p.m. UTC | #1
On 26-07-2022 22:48, Antero Mejr wrote:

> +(define-public grimshot
> +  (package
> +    (inherit sway)
> +    (name "grimshot")
> +    (source (origin
> +              (inherit (package-source sway))
> +              (snippet #~(delete-file "contrib/grimshot.1"))))
> +    (build-system copy-build-system)
> +    (arguments
> +     (list #:install-plan #~`(("grimshot" "bin/")
> +                              ("grimshot.1" "usr/share/man/man1/"))
> +           #:phases #~(modify-phases %standard-phases
> +                        (add-after 'unpack 'chdir
> +                          (lambda _
> +                            (chdir "contrib")))
> +                        (add-after 'chdir 'patch-script-dependencies
> +                          (lambda* (#:key inputs #:allow-other-keys)
> +                            (substitute* "grimshot"
> +                              (("\\b(date|grim|jq|notify-send|slurp|swaymsg|wl-copy)\\b"
> +                                _ binary)
> +                               (search-input-file
> +                                inputs (string-append "bin/" binary))))))
> +                        (add-after 'patch-script-dependencies 'build-man-page
> +                          (lambda _
> +                            (with-input-from-file "grimshot.1.scd"
> +                              (lambda _
> +                                (with-output-to-file "grimshot.1"
> +                                  (lambda _
> +                                    (invoke "scdoc"))))))))))
> +    (native-inputs (list scdoc))
> +    (inputs (list coreutils
> +                  grim
> +                  jq
> +                  libnotify
> +                  slurp
> +                  sway
> +                  wl-clipboard))
> +    (synopsis "Screenshot utility for the Sway window manager")
> +    (description "Grimshot is a screenshot utility for @code{sway}.  It provides
> +an interface over @code{grim}, @code{slurp} and @code{jq}, and supports storing
> +the screenshot either directly to the clipboard using @code{wl-copy} or to a
> +file.")))

That's what I had in mind, thanks.

LGTM, with the caveat that I only looked at the package definition 
during reviewing.

To be clear, I only review things, someone else will have to commit this 
(assuming they agree).

(Also, trying out a new convention for indicating that a patch appears 
ready: prefix the subject with LGTM)

Greetings,
Maxime.
Liliana Marie Prikler July 27, 2022, 6:42 p.m. UTC | #2
Am Mittwoch, dem 27.07.2022 um 00:06 +0200 schrieb Maxime Devos:
> LGTM, with the caveat that I only looked at the package definition 
> during reviewing.
Well, I also built the package, so together this must mean it's fine,
right?  Either way, I trust you, so I pushed it.

> (Also, trying out a new convention for indicating that a patch
> appears ready: prefix the subject with LGTM)
IMHO one LGTM per header suffices.  I think the prefix is better than
the suffix because the latter will likely be truncated.

Cheers
diff mbox series

Patch

diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index 8fef7de77b..aa5aa8d1ec 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -2742,3 +2742,46 @@  (define-public avizo
      "Avizo is a simple notification daemon for Sway, mainly intended to be
 used for multimedia keys.")
     (license license:gpl3+)))
+
+(define-public grimshot
+  (package
+    (inherit sway)
+    (name "grimshot")
+    (source (origin
+              (inherit (package-source sway))
+              (snippet #~(delete-file "contrib/grimshot.1"))))
+    (build-system copy-build-system)
+    (arguments
+     (list #:install-plan #~`(("grimshot" "bin/")
+                              ("grimshot.1" "usr/share/man/man1/"))
+           #:phases #~(modify-phases %standard-phases
+                        (add-after 'unpack 'chdir
+                          (lambda _
+                            (chdir "contrib")))
+                        (add-after 'chdir 'patch-script-dependencies
+                          (lambda* (#:key inputs #:allow-other-keys)
+                            (substitute* "grimshot"
+                              (("\\b(date|grim|jq|notify-send|slurp|swaymsg|wl-copy)\\b"
+                                _ binary)
+                               (search-input-file
+                                inputs (string-append "bin/" binary))))))
+                        (add-after 'patch-script-dependencies 'build-man-page
+                          (lambda _
+                            (with-input-from-file "grimshot.1.scd"
+                              (lambda _
+                                (with-output-to-file "grimshot.1"
+                                  (lambda _
+                                    (invoke "scdoc"))))))))))
+    (native-inputs (list scdoc))
+    (inputs (list coreutils
+                  grim
+                  jq
+                  libnotify
+                  slurp
+                  sway
+                  wl-clipboard))
+    (synopsis "Screenshot utility for the Sway window manager")
+    (description "Grimshot is a screenshot utility for @code{sway}.  It provides
+an interface over @code{grim}, @code{slurp} and @code{jq}, and supports storing
+the screenshot either directly to the clipboard using @code{wl-copy} or to a
+file.")))