You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

125 lines
4.8 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (gnu packages pdf)
  19. #:use-module ((guix licenses)
  20. #:renamer (symbol-prefix-proc 'license:))
  21. #:use-module (guix packages)
  22. #:use-module (guix download)
  23. #:use-module (guix build-system gnu)
  24. #:use-module (gnu packages)
  25. #:use-module (gnu packages compression)
  26. #:use-module (gnu packages fontutils)
  27. #:use-module (gnu packages ghostscript)
  28. #:use-module (gnu packages lesstif)
  29. #:use-module (gnu packages libjpeg)
  30. #:use-module (gnu packages libpng)
  31. #:use-module (gnu packages libtiff)
  32. #:use-module (gnu packages pkg-config)
  33. #:use-module (gnu packages xorg)
  34. #:use-module (gnu packages glib)
  35. #:use-module (gnu packages gtk)
  36. #:use-module (srfi srfi-1))
  37. (define-public poppler
  38. (package
  39. (name "poppler")
  40. (version "0.22.0")
  41. (source (origin
  42. (method url-fetch)
  43. (uri (string-append "http://poppler.freedesktop.org/poppler-"
  44. version ".tar.gz"))
  45. (sha256 (base32
  46. "1rmrspavldlpqi6g76fijcmshy80m0kxd01nc1dmy4id3h4las44"))))
  47. (build-system gnu-build-system)
  48. ;; FIXME: more dependencies could be added
  49. ;; cairo output: no (requires cairo >= 1.10.0)
  50. ;; qt4 wrapper: no
  51. ;; introspection: no
  52. ;; use gtk-doc: no
  53. ;; use libcurl: no
  54. ;; use libopenjpeg: no
  55. (inputs `(("fontconfig" ,fontconfig)
  56. ("freetype" ,freetype)
  57. ("libjpeg-8" ,libjpeg-8)
  58. ("libpng" ,libpng)
  59. ("libtiff" ,libtiff)
  60. ("pkg-config" ,pkg-config)
  61. ("zlib" ,zlib)
  62. ;; To build poppler-glib (as needed by Evince), we need Cairo and
  63. ;; GLib. But of course, that Cairo must not depend on Poppler.
  64. ("cairo" ,(package (inherit cairo)
  65. (inputs (alist-delete "poppler"
  66. (package-inputs cairo)))))
  67. ("glib" ,glib)))
  68. (arguments
  69. `(#:tests? #f ; no test data provided with the tarball
  70. #:configure-flags
  71. '("--enable-xpdf-headers" ; to install header files
  72. "--enable-zlib")))
  73. (synopsis "Poppler, a pdf rendering library")
  74. (description
  75. "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
  76. (license license:gpl2+)
  77. (home-page "http://poppler.freedesktop.org/")))
  78. (define-public xpdf
  79. (package
  80. (name "xpdf")
  81. (version "3.03")
  82. (source (origin
  83. (method url-fetch)
  84. (uri (string-append "ftp://ftp.foolabs.com/pub/xpdf/xpdf-"
  85. version ".tar.gz"))
  86. (sha256 (base32
  87. "1jnfzdqc54wa73lw28kjv0m7120mksb0zkcn81jdlvijyvc67kq2"))
  88. (patches (list (search-patch "xpdf-constchar.patch")))))
  89. (build-system gnu-build-system)
  90. (inputs `(("freetype" ,freetype)
  91. ("gs-fonts" ,gs-fonts)
  92. ("lesstif" ,lesstif)
  93. ("libpaper" ,libpaper)
  94. ("libx11" ,libx11)
  95. ("libxext" ,libxext)
  96. ("libxp" ,libxp)
  97. ("libxpm" ,libxpm)
  98. ("libxt" ,libxt)
  99. ("zlib" ,zlib)))
  100. (arguments
  101. `(#:tests? #f ; there is no check target
  102. #:phases
  103. (alist-replace
  104. 'install
  105. (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
  106. (let* ((install (assoc-ref %standard-phases 'install))
  107. (out (assoc-ref outputs "out"))
  108. (xpdfrc (string-append out "/etc/xpdfrc"))
  109. (gs-fonts (assoc-ref inputs "gs-fonts")))
  110. (apply install args)
  111. (substitute* xpdfrc
  112. (("/usr/local/share/ghostscript/fonts")
  113. (string-append gs-fonts "/share/fonts/type1/ghostscript"))
  114. (("#fontFile") "fontFile"))))
  115. %standard-phases)))
  116. (synopsis "Viewer for pdf files based on the Motif toolkit.")
  117. (description
  118. "Xpdf is a viewer for Portable Document Format (PDF) files")
  119. (license license:gpl3) ; or gpl2, but not gpl2+
  120. (home-page "http://www.foolabs.com/xpdf/")))