ttf2pt1: fix build with gcc14
- add patch fixing build with c99 from fedora: https://src.fedoraproject.org/rpms/ttf2pt1/c/070de5269475785d27ae7996513bee12cb9a0f53 Fixes build error: ``` t1asm.c: In function 'main': t1asm.c:501:15: error: implicit declaration of function 'getopt'; did you mean 'getsubopt'? [] 501 | while ((c = getopt(argc, argv, "bl:")) != -1) | ^~~~~~ | getsubopt ``` - add patch fixing build with gcc14 from fedora https://src.fedoraproject.org/rpms/ttf2pt1/c/1ebb612acb7088095c6bd7242209f0ce848895fb Patch does not apply as is with `fetchpatch` because of incorrect listed files: `diff -u ft.c{.orig,}`. Fixes `-Wincompatible-pointer-types` errors: `error: intialization of ... from incompatible pointer type ...` for `outl_moveto`, `outl_lineto`, `outl_conicto` and `outl_cubicto` in `ft.c`
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
fetchurl,
|
||||
perl,
|
||||
freetype,
|
||||
fetchpatch,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@@ -28,7 +29,20 @@ stdenv.mkDerivation rec {
|
||||
buildInputs = [ freetype ];
|
||||
nativeBuildInputs = [ perl ];
|
||||
|
||||
patches = ./gentoo-makefile.patch; # also contains the freetype patch
|
||||
patches = [
|
||||
./gentoo-makefile.patch # also contains the freetype patch
|
||||
|
||||
# fix build with c99
|
||||
# https://src.fedoraproject.org/rpms/ttf2pt1/c/070de5269475785d27ae7996513bee12cb9a0f53
|
||||
(fetchpatch {
|
||||
url = "https://src.fedoraproject.org/rpms/ttf2pt1/raw/070de5269475785d27ae7996513bee12cb9a0f53/f/ttf2pt1-c99.patch";
|
||||
hash = "sha256-7+RnExqxED+fUJSj3opfYi0eQ5zqswOZnKjQMvlF020=";
|
||||
})
|
||||
|
||||
# fix build with gcc14
|
||||
# https://src.fedoraproject.org/rpms/ttf2pt1/c/1ebb612acb7088095c6bd7242209f0ce848895fb
|
||||
./ttf2pt1-gcc14.patch
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "True Type to Postscript Type 3 converter, fpdf";
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
diff --git a/ft.c b/ft.c
|
||||
index 4ca1ca6..3ae9ac9 100644
|
||||
--- a/ft.c
|
||||
+++ b/ft.c
|
||||
@@ -457,7 +457,7 @@ static double lastx, lasty;
|
||||
|
||||
static int
|
||||
outl_moveto(
|
||||
- FT_Vector *to,
|
||||
+ const FT_Vector *to,
|
||||
void *unused
|
||||
)
|
||||
{
|
||||
@@ -477,7 +477,7 @@ outl_moveto(
|
||||
|
||||
static int
|
||||
outl_lineto(
|
||||
- FT_Vector *to,
|
||||
+ const FT_Vector *to,
|
||||
void *unused
|
||||
)
|
||||
{
|
||||
@@ -493,8 +493,8 @@ outl_lineto(
|
||||
|
||||
static int
|
||||
outl_conicto(
|
||||
- FT_Vector *control1,
|
||||
- FT_Vector *to,
|
||||
+ const FT_Vector *control1,
|
||||
+ const FT_Vector *to,
|
||||
void *unused
|
||||
)
|
||||
{
|
||||
@@ -514,9 +514,9 @@ outl_conicto(
|
||||
|
||||
static int
|
||||
outl_cubicto(
|
||||
- FT_Vector *control1,
|
||||
- FT_Vector *control2,
|
||||
- FT_Vector *to,
|
||||
+ const FT_Vector *control1,
|
||||
+ const FT_Vector *control2,
|
||||
+ const FT_Vector *to,
|
||||
void *unused
|
||||
)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user