unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Tobias Geerinckx-Rice via Guix-patches via <guix-patches@gnu.org>
To: 37166@debbugs.gnu.org
Subject: [bug#37166] [PATCH 1/2] gnu: Add jbigkit.
Date: Fri, 23 Aug 2019 23:30:23 +0200	[thread overview]
Message-ID: <20190823213024.3250-1-me@tobias.gr> (raw)
In-Reply-To: <877e73shhy.fsf@nckx>

* gnu/packages/image.scm (jbigkit): New public variable.
---
 gnu/packages/image.scm | 75 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 5f3cf0ac2c..670aeff85a 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -643,6 +643,81 @@ work.")
     (home-page "https://jbig2dec.com")
     (license license:gpl2+)))
 
+(define-public jbigkit
+  (package
+    (name "jbigkit")
+    (version "2.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://www.cl.cam.ac.uk/~mgk25/jbigkit/"
+                           "download/jbigkit-" version ".tar.gz"))
+       (sha256
+        (base32 "0cnrcdr1dwp7h7m0a56qw09bv08krb37mpf7cml5sjdgpyv0cwfy"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           ;; Remove files without clear licence information.
+           (for-each delete-file-recursively
+                     (list "contrib" "examples"))
+           #t))))
+    (build-system gnu-build-system)
+    (outputs (list "out" "pbmtools"))
+    (arguments
+     `(#:modules ((srfi srfi-26)
+                  ,@%gnu-build-system-modules)
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)            ; no configure script
+         (replace 'install              ; no ‘make install’ target
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (lib (string-append out "/lib"))
+                    (include (string-append out "/include")))
+               (with-directory-excursion "libjbig"
+                 (for-each (cut install-file <> include)
+                           (find-files "." "\\.h$"))
+                 (for-each (cut install-file <> lib)
+                           (find-files "." "\\.a$")))
+               #t)))
+         (add-after 'install 'install-pbmtools
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "pbmtools"))
+                    (bin (string-append out "/bin"))
+                    (man1 (string-append out "/share/man/man1"))
+                    (man5 (string-append out "/share/man/man5")))
+               (with-directory-excursion "pbmtools"
+                 (for-each (cut install-file <> bin)
+                           (list "jbgtopbm" "jbgtopbm85"
+                                 "pbmtojbg" "pbmtojbg85"))
+
+                 (for-each (cut install-file <> man1)
+                           (find-files "." "\\.1$"))
+                 (for-each (cut install-file <> man5)
+                           (find-files "." "\\.5$"))
+                 #t)))))
+       #:test-target "test"
+       #:tests? #f))                    ; tests depend on examples/
+    (home-page "https://www.cl.cam.ac.uk/~mgk25/jbigkit/")
+    (synopsis "Lossless compression for bi-level high-resolution images")
+    (description
+     "JBIG-KIT implements the JBIG1 data compression standard (ITU-T T.82 and
+ISO/IEC 11544:1993), designed for bi-level (one bit per pixel) images such as
+black-and-white scanned documents.  It is widely used in fax products, printer
+firmware and drivers, document management systems, and imaging software.
+
+This package provides a static C library of (de)compression functions and some
+simple command-line converters similar to those provided by netpbm.
+
+Two JBIG1 variants are available.  One (@file{jbig.c}) implements nearly all
+options of the standard but has to keep the full uncompressed image in memory.
+The other (@file{jbig85.c}) implements just the ITU-T T.85 profile, with
+memory management optimized for embedded and fax applications.  It buffers
+only a few lines of the uncompressed image in memory and is able to stream
+images of initially unknown height.")
+    (license (list license:isc          ; pbmtools/p?m.5
+                   license:gpl2+))))    ; the rest
+
 (define-public openjpeg
   (package
     (name "openjpeg")
-- 
2.23.0

  reply	other threads:[~2019-08-23 21:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23 21:23 [bug#37166] Add QPDL (Samsung laser &c.) printer drivers Tobias Geerinckx-Rice via Guix-patches via
2019-08-23 21:30 ` Tobias Geerinckx-Rice via Guix-patches via [this message]
2019-08-23 21:30   ` [bug#37166] [PATCH 2/2] gnu: Add splix Tobias Geerinckx-Rice via Guix-patches via
2019-09-27 10:39 ` bug#37166: Add QPDL (Samsung laser &c.) printer drivers Tobias Geerinckx-Rice via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190823213024.3250-1-me@tobias.gr \
    --to=guix-patches@gnu.org \
    --cc=37166@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).