diff mbox series

[bug#51477,v2] gnu: Add nsxiv.

Message ID PU1PR01MB2155235C962D4E88F38AE1948D899@PU1PR01MB2155.apcprd01.prod.exchangelabs.com
State Accepted
Headers show
Series [bug#51477,v2] gnu: Add nsxiv. | 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

Foo Chuan Wei Oct. 31, 2021, 9:11 a.m. UTC
* gnu/packages/image-viewers.scm (nsxiv): New variable.
---
 gnu/packages/image-viewers.scm | 54 ++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)


base-commit: 9f2c5e901e988b575d487629976d2d14be4ed61d

Comments

Nicolas Goaziou Nov. 14, 2021, 2:22 p.m. UTC | #1
Hello,

Foo Chuan Wei <chuanwei.foo@hotmail.com> writes:

> * gnu/packages/image-viewers.scm (nsxiv): New variable.

Thank you. Applied with the following changes:

> +         (add-after 'unpack 'fix-paths
> +           (lambda _
> +             ;; Xft.h #includes <ft2build.h> without ‘freetype2/’. The Makefile
> +             ;; works around this by hard-coding /usr/include & $PREFIX.
> +             (substitute* "Makefile"
> +               (("-I/usr/include/freetype2 -I\\$\\(PREFIX\\)/include/freetype2")
> +                (string-append "-I" (assoc-ref %build-inputs "freetype")
> +                               "/include/freetype2")))))

I used the code below instead:

  (lambda* (#:key inputs #:allow-other-keys)
    (let ((freetype (string-append (assoc-ref inputs "freetype")
                                   "/include/freetype2")))
      (substitute* "Makefile"
        (("-I/usr/include/freetype2 -I\\$\\(PREFIX\\)/include/freetype2")
         (string-append "-I" freetype)))))

> +    (description
> +     "nsxiv is a fork of sxiv. Its primary goal is to provide the most basic
> +features required for fast image viewing. It has vi key bindings and works
> +nicely with tiling window managers. Its code base should be kept small and
> +clean to make it easy for you to dig into it and customize it for
> your needs.")

I added two spaces at the end of sentences, per Texinfo syntax.

Regards,
diff mbox series

Patch

diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm
index 4f87b63ca1..8e34ce1608 100644
--- a/gnu/packages/image-viewers.scm
+++ b/gnu/packages/image-viewers.scm
@@ -417,6 +417,60 @@  base should be kept small and clean to make it easy for you to dig into
 it and customize it for your needs.")
     (license license:gpl2+)))
 
+(define-public nsxiv
+  (package
+    (name "nsxiv")
+    (version "27.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/nsxiv/nsxiv")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1na7f0hpc9g04nm7991gzaqr5gkj08n2azx833hgxcm2w1pnn1bk"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; no check target
+       #:make-flags
+       (list (string-append "PREFIX=" %output)
+             (string-append "CC=" ,(cc-for-target)))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)            ; no configure script
+         (add-after 'unpack 'fix-paths
+           (lambda _
+             ;; Xft.h #includes <ft2build.h> without ‘freetype2/’. The Makefile
+             ;; works around this by hard-coding /usr/include & $PREFIX.
+             (substitute* "Makefile"
+               (("-I/usr/include/freetype2 -I\\$\\(PREFIX\\)/include/freetype2")
+                (string-append "-I" (assoc-ref %build-inputs "freetype")
+                               "/include/freetype2")))))
+         (add-after 'install 'install-desktop-file
+           (lambda* (#:key outputs #:allow-other-keys)
+             (install-file "nsxiv.desktop"
+                           (string-append (assoc-ref outputs "out")
+                                          "/share/applications"))))
+         (add-after 'install 'install-icons
+           (lambda* (#:key make-flags #:allow-other-keys)
+             (apply invoke "make" "-C" "icon" "install" make-flags))))))
+    (inputs
+     `(("freetype" ,freetype)
+       ("giflib" ,giflib)
+       ("imlib2" ,imlib2)
+       ("libexif" ,libexif)
+       ("libx11" ,libx11)
+       ("libxft" ,libxft)))
+    (home-page "https://github.com/nsxiv/nsxiv")
+    (synopsis "Neo Simple X Image Viewer")
+    (description
+     "nsxiv is a fork of sxiv. Its primary goal is to provide the most basic
+features required for fast image viewing. It has vi key bindings and works
+nicely with tiling window managers. Its code base should be kept small and
+clean to make it easy for you to dig into it and customize it for your needs.")
+    (license license:gpl2+)))
+
 (define-public viewnior
   (package
     (name "viewnior")