From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kei Kebreau Subject: Re: [PATCH] gnu: Add imgcat. Date: Sun, 29 Jan 2017 14:19:34 -0500 Message-ID: <874m0hznax.fsf@openmailbox.org> References: <20170119175040.17403-1-contact.ng0@cryptolab.net> <20170119175040.17403-2-contact.ng0@cryptolab.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXv18-0006rb-O3 for guix-devel@gnu.org; Sun, 29 Jan 2017 14:20:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cXv13-00064n-CY for guix-devel@gnu.org; Sun, 29 Jan 2017 14:20:02 -0500 Received: from lb1.openmailbox.org ([5.79.108.160]:59363) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cXv12-000643-Va for guix-devel@gnu.org; Sun, 29 Jan 2017 14:19:57 -0500 In-Reply-To: <20170119175040.17403-2-contact.ng0@cryptolab.net> (contact's message of "Thu, 19 Jan 2017 17:50:40 +0000") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: contact.ng0@cryptolab.net Cc: guix-devel@gnu.org, ng0 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable contact.ng0@cryptolab.net writes: > From: ng0 > > * 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 =C2=A9 2015, 2016 Alex Kost > ;;; Copyright =C2=A9 2016 Efraim Flashner > ;;; Copyright =C2=A9 2017 Alex Griffin > +;;; Copyright =C2=A9 2017 ng0 > ;;; > ;;; 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'(=E2=80=A6) > + ;; 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=3D" > + (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))) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEg7ZwOtzKO2lLzi2m5qXuPBlGeg0FAliOQEYACgkQ5qXuPBlG eg3hgg//aDp3907v1GgWHVAdluTmMsswst1LhL/0iAp8OWh9/kKGSafY2i5qRw+X P4/qr6h+EgO4DXyleO5NtjO+x1VJCqVTh1iEwwtQE9u6JOhqODwbm0kvAb1ZthoW GoeX+SFOmVmm1hM5vFqJi3jvFWC3lBbKuJWXceliUNsUBdh8nziCZNUTPrKmBumW YmTcxUOC2fUHhwBIaDg+qPusreMnEjL8LSvGeYq5DiW+O9qGcfaIVC85Tiuy/fG/ Uu97M8EsXzboRh5qxHM5wWtSpEAhacJrwlqtuRSO9BZ022YP4Y+2vZEwG1T9QQV6 6FIwpPms8I9OpG1KiGDPST0HjLSSXJKOjab5+1PH6B5d0D2FMCP0ila4QHlIt9qO ecNlq/xjkfO2ORhURvk039p0nRUzasjyNrlFzDk1MBEjvNYZfSW+rrwA5IIzZuSD CbtDQ5eaBCFuBpYTKi4XF1ZaMiZQ53mfMiWYWqIoj4seqE8HBU6av9waI1nUVuFr HB2cJswvgCGgU9AOtUnfJhDthTvqYRJ/SqGKUjg7sey7xlYtMRIfmzH25h9teqjU 8aXsoat0qLYQHq6MmpKLldCazg316ifxzCkIkoNYnbLykf3t4iGvxozabVwZIEbH 7lGUTwKYjbhRUiG6oneKh6tRiEcEiW0sdl7SYButgimt3UZtyJI= =vDDt -----END PGP SIGNATURE----- --=-=-=--