ttf2pt1: fix build with gcc14, modernize (#394493)

This commit is contained in:
Peder Bergebakken Sundt
2025-04-08 00:34:15 +02:00
committed by GitHub
2 changed files with 65 additions and 4 deletions
+18 -4
View File
@@ -4,14 +4,15 @@
fetchurl,
perl,
freetype,
fetchpatch,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "ttf2pt1";
version = "3.4.4";
src = fetchurl {
url = "mirror://sourceforge/ttf2pt1/ttf2pt1-${version}.tgz";
url = "mirror://sourceforge/ttf2pt1/ttf2pt1-${finalAttrs.version}.tgz";
sha256 = "1l718n4k4widx49xz7qrj4mybzb8q67kp2jw7f47604ips4654mf";
};
@@ -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";
@@ -36,4 +50,4 @@ stdenv.mkDerivation rec {
license = "ttf2pt1";
platforms = lib.platforms.linux;
};
}
})
@@ -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
)
{