guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gnu: Add imgcat.


From: Kei Kebreau
Subject: Re: [PATCH] gnu: Add imgcat.
Date: Sun, 29 Jan 2017 14:19:34 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

address@hidden writes:

> From: ng0 <address@hidden>
>
> * gnu/packages/image-viewers.scm (imgcat): New variable.
You mean catimg, yes?
> ---
>  gnu/packages/image-viewers.scm | 54 
> ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 54 insertions(+)
>
> diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm
> index bc56041f8..1559e6668 100644
> --- a/gnu/packages/image-viewers.scm
> +++ b/gnu/packages/image-viewers.scm
> @@ -4,6 +4,7 @@
>  ;;; Copyright © 2015, 2016 Alex Kost <address@hidden>
>  ;;; Copyright © 2016 Efraim Flashner <address@hidden>
>  ;;; Copyright © 2017 Alex Griffin <address@hidden>
> +;;; Copyright © 2017 ng0 <address@hidden>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -25,6 +26,7 @@
>    #:use-module (guix download)
>    #:use-module (guix packages)
>    #:use-module (guix build-system gnu)
> +  #:use-module (guix build-system cmake)
>    #:use-module (gnu packages autotools)
>    #:use-module (gnu packages base)
>    #:use-module (gnu packages curl)
> @@ -33,6 +35,7 @@
>    #:use-module (gnu packages gnome)
>    #:use-module (gnu packages gtk)
>    #:use-module (gnu packages image)
> +  #:use-module (gnu packages imagemagick)
>    #:use-module (gnu packages photo)
>    #:use-module (gnu packages pkg-config)
>    #:use-module (gnu packages xorg))
> @@ -205,3 +208,54 @@ your images.  Among its features are:
>  @item Configurable mouse actions
>  @end enumerate\n")
>      (license license:gpl3+)))
> +
> +(define-public catimg
> +  (package
> +    (name "catimg")
> +    (version "2.2.1")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append "https://github.com/posva/catimg/archive";
> +                           "/v" version ".tar.gz"))
> +       (file-name (string-append name "-" version ".tar.gz"))
> +       (sha256
> +        (base32
> +         "14g90zwh2d3s13hgyxypx2vc0rj1g58l6zcxhgc84wsyxfxd6xpb"))))
> +    (build-system cmake-build-system)
> +    (arguments
> +     `(#:tests? #f                      ; no check target
> +       #:phases
> +       (modify-phases %standard-phases
> +         (replace 'configure
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (let* ((magic (assoc-ref %build-inputs "imagemagick"))
> +                    (convert (string-append magic "/bin/convert")))
> +               (substitute* "catimg"
> +                 ;; FIME: The message 'The version of convert'(…)
> +                 ;; gets substituted too, we should revert this.

I'm not sure what to do here, though the message should never appear
when using the officially packaged version of imagemagick that you refer
to here.

> +                 (("convert") convert))
> +               #t)))
> +         (replace 'build
> +           (lambda _
> +             (zero? (system* "cmake" "-D"
> +                             (string-append "CMAKE_INSTALL_PREFIX="
> +                                            (assoc-ref %outputs "out"))
> +                             " " "."))

The " " string isn't necessary here; system* adds its own spaces between
its arguments.

> +             (zero? (system* "make"))))
> +         (add-before 'install 'install-script
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin (string-append out "/bin")))
> +               (install-file "catimg" bin)
> +               (rename-file (string-append bin "/catimg")
> +                            (string-append bin "/catimg.sh"))
> +               #t))))))
> +    (inputs
> +     `(("imagemagick" ,imagemagick))) ; For the script version
> +    (home-page "https://github.com/posva/catimg";)
> +    (synopsis "Render images in the terminal")
> +    (description
> +     "Catimg is a little program that prints images in the terminal.
> +It supports JPEG, PNG and GIF formats.")
> +    (license license:expat)))

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]