123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409 |
- (define-module (gnu packages ghostscript)
- #:use-module (gnu packages)
- #:use-module (gnu packages autotools)
- #:use-module (gnu packages compression)
- #:use-module (gnu packages cups)
- #:use-module (gnu packages fontutils)
- #:use-module (gnu packages image)
- #:use-module (gnu packages perl)
- #:use-module (gnu packages pkg-config)
- #:use-module (gnu packages python)
- #:use-module (gnu packages tcl)
- #:use-module (gnu packages xorg)
- #:use-module ((guix licenses) #:prefix license:)
- #:use-module (guix packages)
- #:use-module (guix download)
- #:use-module (guix utils)
- #:use-module (guix build-system gnu)
- #:use-module (guix build-system trivial)
- #:use-module (srfi srfi-1))
- (define-public lcms
- (package
- (name "lcms")
- (version "2.12")
- (source (origin
- (method url-fetch)
- (uri (string-append "mirror://sourceforge/lcms/lcms/" version
- "/lcms2-" version ".tar.gz"))
- (sha256 (base32
- "1x8hzq8kw16lgjxmqpnqah1p3hrqqhjpcl1ymiah8434x22kjrhq"))))
- (build-system gnu-build-system)
- (arguments
- `(#:configure-flags '("--disable-static")))
- (inputs `(("libjpeg" ,libjpeg-turbo)
- ("libtiff" ,libtiff)
- ("zlib" ,zlib)))
- (synopsis "Little CMS, a small-footprint colour management engine")
- (description
- "Little CMS is a small-footprint colour management engine, with special
- focus on accuracy and performance. It uses the International Color
- Consortium standard (ICC), approved as ISO 15076-1.")
- (license license:x11)
- (home-page "https://www.littlecms.com/")
- (properties '((cpe-name . "little_cms_color_engine")))))
- (define-public libpaper
- (package
- (name "libpaper")
- (version "1.1.24")
- (source (origin
- (method url-fetch)
- (uri (string-append
-
-
- "http://pkgs.fedoraproject.org/repo/pkgs/libpaper/libpaper_"
- version ".tar.gz/5bc87d494ba470aba54f6d2d51471834/libpaper_"
- version ".tar.gz"))
- (sha256 (base32
- "0zhcx67afb6b5r936w5jmaydj3ks8zh83n9rm5sv3m3k8q8jib1q"))))
- (build-system gnu-build-system)
- (native-inputs
- (list automake))
- (arguments
- `(#:configure-flags '("--disable-static")
- #:phases
- (modify-phases %standard-phases
- (add-after 'unpack 'fix-configure
- (lambda* (#:key inputs native-inputs #:allow-other-keys)
-
- (for-each (lambda (file)
- (install-file
- (string-append (assoc-ref
- (or native-inputs inputs) "automake")
- "/share/automake-"
- ,(version-major+minor
- (package-version automake))
- "/" file) "."))
- '("config.sub" "config.guess"))
- #t)))))
- (synopsis "Library for handling paper sizes")
- (description
- "The paper library and accompanying files are intended to provide a simple
- way for applications to take actions based on a system- or user-specified
- paper size.")
- (license license:gpl2)
- (home-page "https://packages.qa.debian.org/libp/libpaper.html")))
- (define-public psutils
- (package
- (name "psutils")
- (version "17")
- (source (origin
- (method url-fetch)
- (uri "ftp://ftp.knackered.org/pub/psutils/psutils.tar.gz")
- (sha256 (base32
- "1r4ab1fvgganm02kmm70b2r1azwzbav2am41gbigpa2bb1wynlrq"))))
- (build-system gnu-build-system)
- (inputs (list perl))
- (arguments
- `(#:tests? #f
- #:phases
- (modify-phases %standard-phases
- (replace 'configure
- (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
- (let ((perl (assoc-ref inputs "perl"))
- (out (assoc-ref outputs "out")))
- (copy-file "Makefile.unix" "Makefile")
- (substitute* "Makefile"
- (("/usr/local/bin/perl") (string-append perl "/bin/perl")))
- (substitute* "Makefile"
- (("/usr/local") out))
-
- (substitute* "Makefile"
- (("-mkdir") "mkdir -p"))
-
- (substitute* "Makefile"
- ((" install.include") "")))
- #t)))))
- (synopsis "Collection of utilities for manipulating PostScript documents")
- (description
- "PSUtils is a collection of utilities for manipulating PostScript
- documents. Programs included are psnup, for placing out several logical pages
- on a single sheet of paper, psselect, for selecting pages from a document,
- pstops, for general imposition, psbook, for signature generation for booklet
- printing, and psresize, for adjusting page sizes.")
- (license (license:non-copyleft "file://LICENSE"
- "See LICENSE in the distribution."))
- (home-page "http://knackered.org/angus/psutils/")))
- (define-public ghostscript
- (package
- (name "ghostscript")
- (version "9.54.0")
- (source
- (origin
- (method url-fetch)
- (uri (string-append "https://github.com/ArtifexSoftware/"
- "ghostpdl-downloads/releases/download/gs"
- (string-delete #\. version)
- "/ghostscript-" version ".tar.xz"))
- (sha256
- (base32
- "0fvfvv6di5s6j4sy4gaw65klm23dby39bkdjxxq4w3v0vqyb9dy2"))
- (patches (search-patches "ghostscript-no-header-creationdate.patch"
- "ghostscript-no-header-id.patch"
- "ghostscript-no-header-uuid.patch"))
- (modules '((guix build utils)))
- (snippet
-
-
-
-
- '(begin
- (for-each delete-file-recursively '("freetype" "jbig2dec" "jpeg"
- "libpng" "tiff" "zlib"))
- #t))))
- (build-system gnu-build-system)
- (outputs '("out" "doc"))
- (arguments
- `(#:disallowed-references ("doc")
-
-
-
-
-
-
- #:parallel-tests? #f
- #:configure-flags
- (list (string-append "LDFLAGS=-Wl,-rpath="
- (assoc-ref %outputs "out") "/lib")
- "--with-system-libtiff"
- "LIBS=-lz"
- (string-append "ZLIBDIR="
- (assoc-ref %build-inputs "zlib") "/include")
- "--enable-dynamic"
- "--disable-compile-inits"
- (string-append "--with-fontpath="
- (assoc-ref %build-inputs "font-ghostscript")
- "/share/fonts/type1/ghostscript")
- ,@(if (%current-target-system)
- '(
-
-
- "CCAUX=gcc"
-
-
- "--enable-save_confaux")
- '()))
- #:phases
- (modify-phases %standard-phases
- (add-before 'configure 'create-output-directory
- (lambda* (#:key outputs #:allow-other-keys)
-
-
- (mkdir-p (string-append (assoc-ref outputs "out") "/lib"))
- #t))
- (add-after 'configure 'remove-doc-reference
- (lambda _
-
-
-
- (substitute* "base/gscdef.c"
- (("GS_DOCDIR")
- "\"~/.guix-profile/share/doc/ghostscript\""))
- #t))
- (add-after 'configure 'patch-config-files
- (lambda _
- (substitute* "base/unixhead.mak"
- (("/bin/sh") (which "sh")))
- #t))
- ,@(if (%current-target-system)
- `((add-after 'configure 'add-native-lz
- (lambda _
-
- (substitute* "Makefile"
- (("^AUXEXTRALIBS=(.*)$" _ value)
- (string-append "AUXEXTRALIBS = -lz " value "\n")))
- #t)))
- '())
- (replace 'build
- (lambda _
-
-
- (invoke "make" "so" "-j"
- (number->string (parallel-job-count)))))
- (replace 'install
- (lambda _
- (invoke "make" "soinstall")))
- (add-after 'install 'create-gs-symlink
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
-
- (symlink "gsc" (string-append out "/bin/gs"))
- #t))))))
- (native-inputs
- `(("perl" ,perl)
- ("pkg-config" ,pkg-config)
- ("python" ,python-minimal-wrapper)
- ("tcl" ,tcl)
-
-
- ,@(if (%current-target-system)
- `(("zlib/native" ,zlib)
- ("libjpeg/native" ,libjpeg-turbo))
- '())))
- (inputs
- `(("fontconfig" ,fontconfig)
- ("freetype" ,freetype)
- ("font-ghostscript" ,font-ghostscript)
- ("jbig2dec" ,jbig2dec)
- ("libjpeg" ,libjpeg-turbo)
- ("libpaper" ,libpaper)
- ("libpng" ,libpng)
- ("libtiff" ,libtiff)
- ("zlib" ,zlib)))
- (synopsis "PostScript and PDF interpreter")
- (description
- "Ghostscript is an interpreter for the PostScript language and the PDF
- file format. It also includes a C library that implements the graphics
- capabilities of the PostScript language. It supports a wide variety of
- output file formats and printers.")
- (home-page "https://www.ghostscript.com/")
- (license license:agpl3+)))
- (define-public ghostscript/x
- (package/inherit ghostscript
- (name (string-append (package-name ghostscript) "-with-x"))
- (inputs `(("libxext" ,libxext)
- ("libxt" ,libxt)
- ,@(package-inputs ghostscript)))))
- (define-public ghostscript/cups
- (package/inherit ghostscript
- (name "ghostscript-with-cups")
- (inputs `(("cups" ,cups-minimal)
- ,@(package-inputs ghostscript)))))
- (define-public ijs
- (package
- (name "ijs")
- (version (package-version ghostscript))
- (source (package-source ghostscript))
- (build-system gnu-build-system)
- (native-inputs
- (list libtool automake autoconf))
- (arguments
- `(#:phases
- (modify-phases %standard-phases
- (add-after 'unpack 'autogen
- (lambda _
-
- (system* "autoreconf" "-if")
-
- (substitute* "autogen.sh"
- (("^.*\\$srcdir/configure.*") ""))
- (system* "bash" "autogen.sh")
-
- (chdir "ijs")
-
- (substitute* "autogen.sh"
- (("^.*\\$srcdir/configure.*") "")
- (("^ + && echo Now type.*$") ""))
- (invoke "bash" "autogen.sh"))))))
- (synopsis "IJS driver framework for inkjet and other raster devices")
- (description
- "IJS is a protocol for transmission of raster page images. This package
- provides the reference implementation of the raster printer driver
- architecture.")
- (license license:expat)
- (home-page (package-home-page ghostscript))))
- (define-public font-ghostscript
- (package
- (name "font-ghostscript")
- (version "8.11")
- (source (origin
- (method url-fetch)
- (uri (string-append "mirror://sourceforge/gs-fonts/gs-fonts/"
- version
- "%20%28base%2035%2C%20GPL%29/ghostscript-fonts-std-"
- version
- ".tar.gz"))
- (sha256 (base32
- "00f4l10xd826kak51wsmaz69szzm2wp8a41jasr4jblz25bg7dhf"))))
- (build-system gnu-build-system)
- (arguments
- `(#:tests? #f
- #:modules ((guix build gnu-build-system)
- (guix build utils)
- (srfi srfi-1))
- #:phases
- (modify-phases %standard-phases
- (delete 'configure)
- (delete 'build)
- (replace 'install
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (dir (string-append out "/share/fonts/type1/ghostscript")))
- (mkdir-p dir)
- (for-each
- (lambda (file)
- (copy-file file (string-append dir "/" file)))
- (find-files "." "pfb|afm"))
- #t))))))
- (synopsis "Free replacements for the PostScript fonts")
- (description
- "Ghostscript fonts provides fonts and font metrics customarily distributed with
- Ghostscript. It currently includes the 35 standard PostScript fonts.")
- (license license:gpl2)
- (home-page "https://sourceforge.net/projects/gs-fonts/")))
- (define-public gs-fonts
- (deprecated-package "gs-fonts" font-ghostscript))
- (define-public libspectre
- (package
- (name "libspectre")
- (version "0.2.9")
- (source (origin
- (method url-fetch)
- (uri (string-append "https://libspectre.freedesktop.org/releases"
- "/libspectre-" version ".tar.gz"))
- (sha256
- (base32
- "1vgvxp77d5d9chhx4i9cv9hifw4x10jgw6aw8l2v90dgnm99rbj9"))))
- (build-system gnu-build-system)
- (inputs (list ghostscript))
- (native-inputs (list pkg-config))
- (synopsis "Postscript rendering library")
- (description
- "libspectre is a small library for rendering Postscript documents.
- It provides a convenient easy to use API for handling and rendering
- Postscript documents.")
- (license license:gpl2+)
- (home-page "https://www.freedesktop.org/wiki/Software/libspectre")))
|