diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/libspectre | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libspectre')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/libspectre/default.nix | 33 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/libspectre/libspectre-0.2.7-gs918.patch | 42 |
2 files changed, 75 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libspectre/default.nix b/nixpkgs/pkgs/development/libraries/libspectre/default.nix new file mode 100644 index 000000000000..f1e4169bd48e --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/libspectre/default.nix @@ -0,0 +1,33 @@ +{ fetchurl, stdenv, pkgconfig, ghostscript, cairo }: + +stdenv.mkDerivation rec { + name = "libspectre-0.2.7"; + + src = fetchurl { + url = "https://libspectre.freedesktop.org/releases/${name}.tar.gz"; + sha256 = "1v63lqc6bhhxwkpa43qmz8phqs8ci4dhzizyy16d3vkb20m846z8"; + }; + + patches = [ ./libspectre-0.2.7-gs918.patch ]; + + buildInputs = [ + # Need `libgs.so'. + pkgconfig ghostscript cairo /*for tests*/ + ]; + + doCheck = true; + + meta = { + homepage = http://libspectre.freedesktop.org/; + description = "PostScript rendering library"; + + longDescription = '' + libspectre is a small library for rendering Postscript + documents. It provides a convenient easy to use API for + handling and rendering Postscript documents. + ''; + + license = stdenv.lib.licenses.gpl2Plus; + platforms = stdenv.lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/libspectre/libspectre-0.2.7-gs918.patch b/nixpkgs/pkgs/development/libraries/libspectre/libspectre-0.2.7-gs918.patch new file mode 100644 index 000000000000..e9a4eda192ba --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/libspectre/libspectre-0.2.7-gs918.patch @@ -0,0 +1,42 @@ +Fixed error namespace for >=ghostscript-gpl-9.18 + +https://bugs.gentoo.org/563540 + +--- libspectre-0.2.7/libspectre/spectre-gs.c ++++ libspectre-0.2.7/libspectre/spectre-gs.c +@@ -43,12 +43,12 @@ + + if (code <= -100) { + switch (code) { +- case e_Fatal: ++ case gs_error_Fatal: + fprintf (stderr, "fatal internal error %d", code); + return TRUE; + break; + +- case e_ExecStackUnderflow: ++ case gs_error_ExecStackUnderflow: + fprintf (stderr, "stack overflow %d", code); + return TRUE; + break; +@@ -109,9 +109,9 @@ + set = _spectre_strdup_printf ("%d %d translate\n", -x, -y); + error = gsapi_run_string_continue (ghostscript_instance, set, strlen (set), + 0, &exit_code); +- error = error == e_NeedInput ? 0 : error; ++ error = error == gs_error_NeedInput ? 0 : error; + free (set); +- if (error != e_NeedInput && critic_error_code (error)) { ++ if (error != gs_error_NeedInput && critic_error_code (error)) { + fclose (fd); + return FALSE; + } +@@ -126,7 +126,7 @@ + read = fread (buf, sizeof (char), to_read, fd); + error = gsapi_run_string_continue (ghostscript_instance, + buf, read, 0, &exit_code); +- error = error == e_NeedInput ? 0 : error; ++ error = error == gs_error_NeedInput ? 0 : error; + left -= read; + } + |