| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 |
|
| 27 | (define-module (gnu packages ghostscript)
|
| 28 | #:use-module (gnu packages)
|
| 29 | #:use-module (gnu packages autotools)
|
| 30 | #:use-module (gnu packages compression)
|
| 31 | #:use-module (gnu packages cups)
|
| 32 | #:use-module (gnu packages fontutils)
|
| 33 | #:use-module (gnu packages image)
|
| 34 | #:use-module (gnu packages perl)
|
| 35 | #:use-module (gnu packages pkg-config)
|
| 36 | #:use-module (gnu packages python)
|
| 37 | #:use-module (gnu packages tcl)
|
| 38 | #:use-module (gnu packages xorg)
|
| 39 | #:use-module ((guix licenses) #:prefix license:)
|
| 40 | #:use-module (guix packages)
|
| 41 | #:use-module (guix download)
|
| 42 | #:use-module (guix utils)
|
| 43 | #:use-module (guix build-system gnu)
|
| 44 | #:use-module (guix build-system trivial)
|
| 45 | #:use-module (srfi srfi-1))
|
| 46 |
|
| 47 | (define-public lcms
|
| 48 | (package
|
| 49 | (name "lcms")
|
| 50 | (version "2.9")
|
| 51 | (source (origin
|
| 52 | (method url-fetch)
|
| 53 | (uri (string-append "mirror://sourceforge/lcms/lcms/" version
|
| 54 | "/lcms2-" version ".tar.gz"))
|
| 55 |
|
| 56 | (patches (search-patches "lcms-CVE-2018-16435.patch"))
|
| 57 | (sha256 (base32
|
| 58 | "083xisy6z01zhm7p7rgk4bx9d6zlr8l20qkfv1g29ylnhgwzvij8"))))
|
| 59 | (build-system gnu-build-system)
|
| 60 | (inputs `(("libjpeg" ,libjpeg)
|
| 61 | ("libtiff" ,libtiff)
|
| 62 | ("zlib" ,zlib)))
|
| 63 | (synopsis "Little CMS, a small-footprint colour management engine")
|
| 64 | (description
|
| 65 | "Little CMS is a small-footprint colour management engine, with special
|
| 66 | focus on accuracy and performance. It uses the International Color
|
| 67 | Consortium standard (ICC), approved as ISO 15076-1.")
|
| 68 | (license license:x11)
|
| 69 | (home-page "http://www.littlecms.com/")
|
| 70 | (properties '((cpe-name . "little_cms_color_engine")))))
|
| 71 |
|
| 72 | (define-public libpaper
|
| 73 | (package
|
| 74 | (name "libpaper")
|
| 75 | (version "1.1.24")
|
| 76 | (source (origin
|
| 77 | (method url-fetch)
|
| 78 | (uri (string-append
|
| 79 | |
| 80 | |
| 81 | "http://pkgs.fedoraproject.org/repo/pkgs/libpaper/libpaper_"
|
| 82 | version ".tar.gz/5bc87d494ba470aba54f6d2d51471834/libpaper_"
|
| 83 | version ".tar.gz"))
|
| 84 | (sha256 (base32
|
| 85 | "0zhcx67afb6b5r936w5jmaydj3ks8zh83n9rm5sv3m3k8q8jib1q"))))
|
| 86 | (build-system gnu-build-system)
|
| 87 | (synopsis "Library for handling paper sizes")
|
| 88 | (description
|
| 89 | "The paper library and accompanying files are intended to provide a simple
|
| 90 | way for applications to take actions based on a system- or user-specified
|
| 91 | paper size.")
|
| 92 | (license license:gpl2)
|
| 93 | (home-page "https://packages.qa.debian.org/libp/libpaper.html")))
|
| 94 |
|
| 95 | (define-public psutils
|
| 96 | (package
|
| 97 | (name "psutils")
|
| 98 | (version "17")
|
| 99 | (source (origin
|
| 100 | (method url-fetch)
|
| 101 | (uri "ftp://ftp.knackered.org/pub/psutils/psutils.tar.gz")
|
| 102 | (sha256 (base32
|
| 103 | "1r4ab1fvgganm02kmm70b2r1azwzbav2am41gbigpa2bb1wynlrq"))))
|
| 104 | (build-system gnu-build-system)
|
| 105 | (inputs `(("perl" ,perl)))
|
| 106 | (arguments
|
| 107 | `(#:tests? #f |
| 108 | #:phases
|
| 109 | (modify-phases %standard-phases
|
| 110 | (replace 'configure
|
| 111 | (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
|
| 112 | (let ((perl (assoc-ref inputs "perl"))
|
| 113 | (out (assoc-ref outputs "out")))
|
| 114 | (copy-file "Makefile.unix" "Makefile")
|
| 115 | (substitute* "Makefile"
|
| 116 | (("/usr/local/bin/perl") (string-append perl "/bin/perl")))
|
| 117 | (substitute* "Makefile"
|
| 118 | (("/usr/local") out))
|
| 119 | |
| 120 | (substitute* "Makefile"
|
| 121 | (("-mkdir") "mkdir -p"))
|
| 122 | |
| 123 | (substitute* "Makefile"
|
| 124 | ((" install.include") "")))
|
| 125 | #t)))))
|
| 126 | (synopsis "Collection of utilities for manipulating PostScript documents")
|
| 127 | (description
|
| 128 | "PSUtils is a collection of utilities for manipulating PostScript
|
| 129 | documents. Programs included are psnup, for placing out several logical pages
|
| 130 | on a single sheet of paper, psselect, for selecting pages from a document,
|
| 131 | pstops, for general imposition, psbook, for signature generation for booklet
|
| 132 | printing, and psresize, for adjusting page sizes.")
|
| 133 | (license (license:non-copyleft "file://LICENSE"
|
| 134 | "See LICENSE in the distribution."))
|
| 135 | (home-page "http://knackered.org/angus/psutils/")))
|
| 136 |
|
| 137 | (define-public ghostscript
|
| 138 | (package
|
| 139 | (name "ghostscript")
|
| 140 | (version "9.27")
|
| 141 |
|
| 142 | |
| 143 | |
| 144 | |
| 145 | (replacement ghostscript/fixed)
|
| 146 |
|
| 147 | (source
|
| 148 | (origin
|
| 149 | (method url-fetch)
|
| 150 | (uri (string-append "https://github.com/ArtifexSoftware/"
|
| 151 | "ghostpdl-downloads/releases/download/gs"
|
| 152 | (string-delete #\. version)
|
| 153 | "/ghostscript-" version ".tar.xz"))
|
| 154 | (sha256
|
| 155 | (base32
|
| 156 | "06dnj0mxyaryfbwlsjwaqf847w91w2h8f108kxxcc41nrnx1y3zw"))
|
| 157 | (patches (search-patches "ghostscript-no-header-creationdate.patch"
|
| 158 | "ghostscript-no-header-id.patch"
|
| 159 | "ghostscript-no-header-uuid.patch"))
|
| 160 | (modules '((guix build utils)))
|
| 161 | (snippet
|
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | '(begin
|
| 167 | (for-each delete-file-recursively '("freetype" "jbig2dec" "jpeg"
|
| 168 | "libpng" "tiff" "zlib"))
|
| 169 | #t))))
|
| 170 | (build-system gnu-build-system)
|
| 171 | (outputs '("out" "doc")) |
| 172 | (arguments
|
| 173 | `(#:disallowed-references ("doc")
|
| 174 | |
| 175 | |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | #:parallel-tests? #f
|
| 181 | #:configure-flags
|
| 182 | (list (string-append "LDFLAGS=-Wl,-rpath="
|
| 183 | (assoc-ref %outputs "out") "/lib")
|
| 184 | "--with-system-libtiff"
|
| 185 | "LIBS=-lz"
|
| 186 | (string-append "ZLIBDIR="
|
| 187 | (assoc-ref %build-inputs "zlib") "/include")
|
| 188 | "--enable-dynamic"
|
| 189 |
|
| 190 | ,@(if (%current-target-system)
|
| 191 | '( |
| 192 | |
| 193 | |
| 194 | "CCAUX=gcc"
|
| 195 |
|
| 196 | |
| 197 | |
| 198 | "--enable-save_confaux")
|
| 199 | '()))
|
| 200 | #:phases
|
| 201 | (modify-phases %standard-phases
|
| 202 | (add-before 'configure 'create-output-directory
|
| 203 | (lambda* (#:key outputs #:allow-other-keys)
|
| 204 | |
| 205 | |
| 206 | (mkdir-p (string-append (assoc-ref outputs "out") "/lib"))
|
| 207 | #t))
|
| 208 | (add-after 'configure 'remove-doc-reference
|
| 209 | (lambda _
|
| 210 | |
| 211 | |
| 212 | |
| 213 | (substitute* "base/gscdef.c"
|
| 214 | (("GS_DOCDIR")
|
| 215 | "\"~/.guix-profile/share/doc/ghostscript\""))
|
| 216 | |
| 217 | |
| 218 | (substitute* "base/unixinst.mak"
|
| 219 | (("ln -s \\$\\(DESTDIR\\)\\$\\(docdir\\).*") ""))
|
| 220 | #t))
|
| 221 | (add-after 'configure 'patch-config-files
|
| 222 | (lambda _
|
| 223 | (substitute* "base/unixhead.mak"
|
| 224 | (("/bin/sh") (which "sh")))
|
| 225 | #t))
|
| 226 | ,@(if (%current-target-system)
|
| 227 | `((add-after 'configure 'add-native-lz
|
| 228 | (lambda _
|
| 229 | |
| 230 | (substitute* "Makefile"
|
| 231 | (("^AUXEXTRALIBS=(.*)$" _ value)
|
| 232 | (string-append "AUXEXTRALIBS = -lz " value "\n")))
|
| 233 | #t)))
|
| 234 | '())
|
| 235 | (replace 'build
|
| 236 | (lambda _
|
| 237 | |
| 238 | |
| 239 | (invoke "make" "so" "-j"
|
| 240 | (number->string (parallel-job-count)))))
|
| 241 | (replace 'install
|
| 242 | (lambda _
|
| 243 | (invoke "make" "soinstall")))
|
| 244 | (add-after 'install 'create-gs-symlink
|
| 245 | (lambda* (#:key outputs #:allow-other-keys)
|
| 246 | (let ((out (assoc-ref outputs "out")))
|
| 247 | |
| 248 | (symlink "gsc" (string-append out "/bin/gs"))
|
| 249 | #t))))))
|
| 250 | (native-inputs
|
| 251 | `(("perl" ,perl)
|
| 252 | ("python" ,python-wrapper)
|
| 253 | ("tcl" ,tcl)
|
| 254 |
|
| 255 | |
| 256 | |
| 257 | ,@(if (%current-target-system)
|
| 258 | `(("zlib/native" ,zlib)
|
| 259 | ("libjpeg/native" ,libjpeg))
|
| 260 | '())))
|
| 261 | (inputs
|
| 262 | `(("freetype" ,freetype)
|
| 263 | ("jbig2dec" ,jbig2dec)
|
| 264 | ("libjpeg" ,libjpeg)
|
| 265 | ("libpaper" ,libpaper)
|
| 266 | ("libpng" ,libpng)
|
| 267 | ("libtiff" ,libtiff)
|
| 268 | ("zlib" ,zlib)))
|
| 269 | (synopsis "PostScript and PDF interpreter")
|
| 270 | (description
|
| 271 | "Ghostscript is an interpreter for the PostScript language and the PDF
|
| 272 | file format. It also includes a C library that implements the graphics
|
| 273 | capabilities of the PostScript language. It supports a wide variety of
|
| 274 | output file formats and printers.")
|
| 275 | (home-page "https://www.ghostscript.com/")
|
| 276 | (license license:agpl3+)))
|
| 277 |
|
| 278 | (define ghostscript/fixed
|
| 279 | |
| 280 | |
| 281 | (package/inherit
|
| 282 | ghostscript
|
| 283 | (arguments
|
| 284 | (substitute-keyword-arguments (package-arguments ghostscript)
|
| 285 | ((#:configure-flags flags ''())
|
| 286 | `(append (list "--disable-compile-inits"
|
| 287 | (string-append "--with-fontpath="
|
| 288 | (assoc-ref %build-inputs "gs-fonts")
|
| 289 | "/share/fonts/type1/ghostscript"))
|
| 290 | ,flags))))
|
| 291 | (native-inputs `(("pkg-config" ,pkg-config) |
| 292 | ,@(package-native-inputs ghostscript)))
|
| 293 | (inputs `(("gs-fonts" ,gs-fonts)
|
| 294 | ("fontconfig" ,fontconfig)
|
| 295 | ,@(package-inputs ghostscript)))))
|
| 296 |
|
| 297 | (define-public ghostscript/x
|
| 298 | (package/inherit ghostscript
|
| 299 | (name (string-append (package-name ghostscript) "-with-x"))
|
| 300 | (inputs `(("libxext" ,libxext)
|
| 301 | ("libxt" ,libxt)
|
| 302 | ,@(package-inputs ghostscript)))))
|
| 303 |
|
| 304 | (define-public ghostscript/cups
|
| 305 | (package/inherit ghostscript
|
| 306 | (name "ghostscript-with-cups")
|
| 307 | (inputs `(("cups" ,cups-minimal)
|
| 308 | ,@(package-inputs ghostscript)))))
|
| 309 |
|
| 310 | (define-public ijs
|
| 311 | (package
|
| 312 | (name "ijs")
|
| 313 | (version (package-version ghostscript))
|
| 314 | (source (package-source ghostscript))
|
| 315 | (build-system gnu-build-system)
|
| 316 | (native-inputs
|
| 317 | `(("libtool" ,libtool)
|
| 318 | ("automake" ,automake)
|
| 319 | ("autoconf" ,autoconf)))
|
| 320 | (arguments
|
| 321 | `(#:phases
|
| 322 | (modify-phases %standard-phases
|
| 323 | (add-after 'unpack 'autogen
|
| 324 | (lambda _
|
| 325 | |
| 326 | (system* "autoreconf" "-if")
|
| 327 | |
| 328 | (substitute* "autogen.sh"
|
| 329 | (("^.*\\$srcdir/configure.*") ""))
|
| 330 | (system* "bash" "autogen.sh")
|
| 331 | |
| 332 | (chdir "ijs")
|
| 333 | |
| 334 | (substitute* "autogen.sh"
|
| 335 | (("^.*\\$srcdir/configure.*") "")
|
| 336 | (("^ + && echo Now type.*$") ""))
|
| 337 | (invoke "bash" "autogen.sh"))))))
|
| 338 | (synopsis "IJS driver framework for inkjet and other raster devices")
|
| 339 | (description
|
| 340 | "IJS is a protocol for transmission of raster page images. This package
|
| 341 | provides the reference implementation of the raster printer driver
|
| 342 | architecture.")
|
| 343 | (license license:expat)
|
| 344 | (home-page (package-home-page ghostscript))))
|
| 345 |
|
| 346 | (define-public gs-fonts
|
| 347 | (package
|
| 348 | (name "gs-fonts")
|
| 349 | (version "8.11")
|
| 350 | (source (origin
|
| 351 | (method url-fetch)
|
| 352 | (uri (string-append "mirror://sourceforge/gs-fonts/gs-fonts/"
|
| 353 | version
|
| 354 | "%20%28base%2035%2C%20GPL%29/ghostscript-fonts-std-"
|
| 355 | version
|
| 356 | ".tar.gz"))
|
| 357 | (sha256 (base32
|
| 358 | "00f4l10xd826kak51wsmaz69szzm2wp8a41jasr4jblz25bg7dhf"))))
|
| 359 | (build-system gnu-build-system)
|
| 360 | (arguments
|
| 361 | `(#:tests? #f |
| 362 |
|
| 363 | #:modules ((guix build gnu-build-system)
|
| 364 | (guix build utils)
|
| 365 | (srfi srfi-1))
|
| 366 | #:phases
|
| 367 | (modify-phases %standard-phases
|
| 368 | (delete 'configure)
|
| 369 | (delete 'build)
|
| 370 | (replace 'install
|
| 371 | (lambda* (#:key outputs #:allow-other-keys)
|
| 372 | (let* ((out (assoc-ref outputs "out"))
|
| 373 | (dir (string-append out "/share/fonts/type1/ghostscript")))
|
| 374 | (mkdir-p dir)
|
| 375 | (for-each
|
| 376 | (lambda (file)
|
| 377 | (copy-file file (string-append dir "/" file)))
|
| 378 | (find-files "." "pfb|afm"))
|
| 379 | #t))))))
|
| 380 | (synopsis "Free replacements for the PostScript fonts")
|
| 381 | (description
|
| 382 | "Ghostscript fonts provides fonts and font metrics customarily distributed with
|
| 383 | Ghostscript. It currently includes the 35 standard PostScript fonts.")
|
| 384 | (license license:gpl2)
|
| 385 | (home-page "https://sourceforge.net/projects/gs-fonts/")))
|
| 386 |
|
| 387 | (define-public libspectre
|
| 388 | (package
|
| 389 | (name "libspectre")
|
| 390 | (version "0.2.8")
|
| 391 | (source (origin
|
| 392 | (method url-fetch)
|
| 393 | (uri (string-append "https://libspectre.freedesktop.org/releases/libspectre-"
|
| 394 | version ".tar.gz"))
|
| 395 | (sha256 (base32
|
| 396 | "1a67iglsc3r05mzngyg9kb1gy8whq4fgsnyjwi7bqfw2i7rnl9b5"))))
|
| 397 | (build-system gnu-build-system)
|
| 398 | (inputs `(("ghostscript" ,ghostscript)))
|
| 399 | (native-inputs `(("pkg-config" ,pkg-config)))
|
| 400 | (synopsis "Postscript rendering library")
|
| 401 | (description
|
| 402 | "libspectre is a small library for rendering Postscript documents.
|
| 403 | It provides a convenient easy to use API for handling and rendering
|
| 404 | Postscript documents.")
|
| 405 | (license license:gpl2+)
|
| 406 | (home-page "https://www.freedesktop.org/wiki/Software/libspectre")))
|