ghostscript-9.21

Introduction to Ghostscript

Ghostscript is a versatile processor for PostScript data with the ability to render PostScript to different targets. It is a mandatory part of the cups printing stack.

This package is known to build and work properly using an LFS-8.1 platform.

Package Information

Additional Downloads

If you wish, you can download additional fonts.

Standard Fonts

Other Fonts

Ghostscript Dependencies

Recommended

Optional

Cairo-1.14.10, Cups-2.2.4 (required for building the “cups” device backend, which is needed by cups-filters), Fontconfig-2.12.4 (required, if you are installing any suggested font), GTK+-3.22.18, libidn-1.33, libpaper-1.1.24+nmu5, Little CMS-1.19 (not used by default, nor if lcms2 is present or found), and X Window System

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/gs

Installation of Ghostscript

[Note]

Note

The Ghostscript build system is not user-friendly. In order to use system copies of various graphics libraries, you must do it using unconventional methods.

GPL Ghostscript includes (old) copies of several libraries. Some of these seem to have been patched to fix known vulnerabilities, but others of these copies are less-well maintained. To ensure that any future fixes are applied throughout the whole system, it is recommended that you first install the released versions of these libraries and then configure GPL Ghostscript to link to them.

If you have installed the recommended dependencies on your system, remove the copies of freetype, lcms2, libjpeg, and libpng:

rm -rf freetype lcms2 jpeg libpng

Compile Ghostscript:

rm -rf zlib &&

./configure --prefix=/usr           \
            --disable-compile-inits \
            --enable-dynamic        \
            --with-system-libtiff   &&
make
[Note]

Note

The shared library depends on GTK+-2.24.31. It is only used by external programs like asymptote-2.41, ImageMagick-7.0.6-10, and texlive-20170524.

To compile the shared library libgs.so, run the following additional command as an unprivileged user:

make so

This package does not come with a test suite. A set of example files may be used for testing, but it is only possible after installation of the package.

Now, as the root user:

make install

If you want the shared library too:

make soinstall &&
install -v -m644 base/*.h /usr/include/ghostscript &&
ln -v -s ghostscript /usr/include/ps

Now make the documentation accessible from the normal place:

ln -sfvn ../ghostscript/9.21/doc /usr/share/doc/ghostscript-9.21

If you have downloaded any fonts, unpack them to /usr/share/ghostscript and ensure the ownerships of the files are root: root. Substitute <font-tarball> appropriately in the command below for the fonts you wish to install:

tar -xvf ../<font-tarball> -C /usr/share/ghostscript --no-same-owner &&
fc-cache -v /usr/share/ghostscript/fonts/

You can now test the rendering of various postscript and pdf files from the /usr/share/ghostscript/9.21/examples , for example (you need an X window system display):

gs -q -dBATCH /usr/share/ghostscript/9.21/examples/tiger.eps

Command Explanations

rm -rf zlib : zlib was installed as part of LFS.

--disable-compile-inits: This option makes gs and libgs.so slightly smaller.

--with-system-libtiff: Remove this option if you've not installed LibTIFF-4.0.8.

install -v -m644 base/*.h... : Some packages (ImageMagick is one) need the Ghostscript interface headers in place to link to the shared library. These commands install the headers.

ln -v -s ghostscript /usr/include/ps: Some packages expect to find the interface headers in an alternate location.

ln -sfv ../ghostscript-9.21/doc ... : This puts a symbolic link to the documentation where it is expected to be found.

--disable-cups: this option will save a tiny amount of space by not linking gs and libgs.so to the Cups-2.2.4 libraries if you have installed those.

Contents

Installed Programs: dvipdf, eps2eps, font2c, gs, gsbj, gsc (from soinstall), gsdj, gsdj500, gslj, gslp, gsnd, gsx (from soinstall), lprsetup.sh, pdf2dsc, pdf2ps, pf2afm, pfbtopfa, pphs, printafm, ps2ascii, ps2epsi, ps2pdf, ps2pdf12, ps2pdf13, ps2pdf14, ps2pdfwr, ps2ps, ps2ps2, unix-lpr.sh, and wftopfa
Installed Library: libgs.so and /usr/lib/ghostscript/9.21/X11.so
Installed Directories: /usr/include/ghostscript, /usr/lib/ghostscript, /usr/share/ghostscript, and /usr/share/doc/ghostscript-9.21

Short Descriptions

gs

is an interpreter for Adobe Systems' PostScript(tm) and Portable Document Format (PDF).

libgs.so

provides Ghostscript functionality to other programs, such as GSView, ImageMagick, and libspectre.

GPL Ghostscript provides many different scripts used to convert PostScript, PDF, and other formats. Please refer to the HTML documentation or the man pages for information about the capabilities provided.

Last updated on 2017-08-24 18:56:23 -0700