ghostscript-10.07.1

#### Beyond Linux® From Scratch (systemd Edition) - Version r13.0-1357

### Chapter 46. Printing

- Prev

  cups-filters-2.0.1

- Next

  Gutenprint-5.3.5

- Up
- Home

# ghostscript-10.07.1

## 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.

### Note

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

### Package Information

- Download (HTTP): https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10071/ghostscript-10.07.1.tar.xz

- Download MD5 sum: 9e987b203c535d3c7829e1daefb85e98

- Download size: 66 MB

- Estimated disk space required: 1.1 GB (with fonts and libgs.so)

- Estimated build time: 1.9 SBU (Using parallelism=4; with libgs.so)

### Additional Downloads

If you wish, you can download additional fonts.

Standard Fonts

- Download (HTTP): https://downloads.sourceforge.net/gs-fonts/ghostscript-fonts-std-8.11.tar.gz

- Download MD5 sum: 6865682b095f8c4500c54b285ff05ef6

- Download size: 3.7 MB

Other Fonts

- Download (HTTP): https://downloads.sourceforge.net/gs-fonts/gnu-gs-fonts-other-6.0.tar.gz

- Download MD5 sum: 33457d3f37de7ef03d2eea05a9e6aa4f

- Download size: 796 KB

### Ghostscript Dependencies

#### Recommended

Cups-2.4.19 (required for building the “cups” device backend, which is needed by cups-filters), Fontconfig-2.18.3 (required if you are installing any of the suggested fonts), FreeType-2.14.3, Little CMS-2.19.1, libjpeg-turbo-3.2.0, libpng-1.6.58, tiff-4.7.2, and OpenJPEG-2.5.4

#### Optional

Cairo-1.18.4, GTK-3.24.52, libidn-1.44, libpaper-2.2.8, libwebp-1.6.0, and a graphical environment

## Installation of Ghostscript

### 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.

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 Ghostscript to link to them.

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

    rm -rf freetype lcms2mt jpeg libpng openjpeg

Compile Ghostscript:

    rm -rf zlib &&

    ./configure --prefix=/usr           \
                --disable-compile-inits \
                --with-system-libtiff   \
                CFLAGS="${CFLAGS:--g -O3} -fPIC" &&
    make

### Note

The shared library depends on GTK-3.24.52. It is only used by external programs like asymptote-3.10, dvisvgm-3.6, and ImageMagick-7.1.2-13.

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 built the shared library, install it with:

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

Now make the documentation accessible from a standard place:

    mv -v /usr/share/doc/ghostscript/10.07.1 /usr/share/doc/ghostscript-10.07.1 &&
    rmdir /usr/share/doc/ghostscript                                            &&
    cp -r examples/ -T /usr/share/ghostscript/10.07.1/examples

If you have downloaded the fonts, unpack them to `/usr/share/ghostscript` and ensure the ownership of the files are `root`: `root`.

    tar -xvf ../ghostscript-fonts-std-8.11.tar.gz -C /usr/share/ghostscript --no-same-owner &&
    tar -xvf ../gnu-gs-fonts-other-6.0.tar.gz     -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/10.07.1/examples` . To do this, run the following command (in a X11 session):

    gs -q -dBATCH /usr/share/ghostscript/10.07.1/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 tiff-4.7.2.

`CFLAGS="${CFLAGS:--g -O3} -fPIC"`: These flags are needed to prevent a linker error during the build process.

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 -sfvn ghostscript /usr/include/ps: Some packages expect to find the interface headers in an alternate location.

mv -v /usr/share/doc/ghostscript/10.07.1 /usr/share/doc/ghostscript-10.07.1: This moves the documentation to 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.4.19 libraries if you have installed those.

## Contents

Installed Programs: dvipdf, eps2eps, 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, and unix-lpr.sh
Installed Library: libgs.so
Installed Directories: /usr/include/ghostscript, /usr/share/ghostscript, and /usr/share/doc/ghostscript-10.07.1

### 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

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.

- Prev

  cups-filters-2.0.1

- Next

  Gutenprint-5.3.5

- Up
- Home