Merge pull request #271510 from mfrischknecht/fix-haru-gawk-extension

gawkextlib.haru: fix compilation errors due to typos fixed in libharu
This commit is contained in:
tomberek 2024-01-26 05:17:21 -05:00 committed by GitHub
commit 0e96ec3d95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 75 additions and 7 deletions

View file

@ -0,0 +1,62 @@
diff --git a/haru/pdf.c b/haru/pdf.c
index d16f573..3129427 100644
--- a/haru/pdf.c
+++ b/haru/pdf.c
@@ -105,7 +105,7 @@ static awk_scalar_t HPDF_CS_PATTERN_node;
/* LineCap */
static awk_scalar_t HPDF_BUTT_END_node;
static awk_scalar_t HPDF_ROUND_END_node;
-static awk_scalar_t HPDF_PROJECTING_SCUARE_END_node;
+static awk_scalar_t HPDF_PROJECTING_SQUARE_END_node;
/* _LineJoin */
static awk_scalar_t HPDF_MITER_JOIN_node;
@@ -248,7 +248,7 @@ static awk_scalar_t HPDF_ENCODER_UNKNOWN_node;
/* ByteType */
static awk_scalar_t HPDF_BYTE_TYPE_SINGLE_node;
static awk_scalar_t HPDF_BYTE_TYPE_LEAD_node;
-static awk_scalar_t HPDF_BYTE_TYPE_TRIAL_node;
+static awk_scalar_t HPDF_BYTE_TYPE_TRAIL_node;
static awk_scalar_t HPDF_BYTE_TYPE_UNKNOWN_node;
/* TextAlignment */
@@ -308,7 +308,7 @@ static const struct varinit varinit[] = {
ENTRY(HPDF_CS_PATTERN, 1)
ENTRY(HPDF_BUTT_END, 1)
ENTRY(HPDF_ROUND_END, 1)
- ENTRY(HPDF_PROJECTING_SCUARE_END, 1)
+ ENTRY(HPDF_PROJECTING_SQUARE_END, 1)
ENTRY(HPDF_MITER_JOIN, 1)
ENTRY(HPDF_ROUND_JOIN, 1)
ENTRY(HPDF_BEVEL_JOIN, 1)
@@ -417,7 +417,7 @@ static const struct varinit varinit[] = {
ENTRY(HPDF_ENCODER_UNKNOWN, 1)
ENTRY(HPDF_BYTE_TYPE_SINGLE, 1)
ENTRY(HPDF_BYTE_TYPE_LEAD, 1)
- ENTRY(HPDF_BYTE_TYPE_TRIAL, 1)
+ ENTRY(HPDF_BYTE_TYPE_TRAIL, 1)
ENTRY(HPDF_BYTE_TYPE_UNKNOWN, 1)
ENTRY(HPDF_TALIGN_LEFT, 1)
ENTRY(HPDF_TALIGN_RIGHT, 1)
diff --git a/haru/pdf.h b/haru/pdf.h
index a4ef39a..07cf168 100644
--- a/haru/pdf.h
+++ b/haru/pdf.h
@@ -86,7 +86,7 @@
#define DEFAULT_HPDF_BUTT_END HPDF_BUTT_END
#define DEFAULT_HPDF_ROUND_END HPDF_ROUND_END
-#define DEFAULT_HPDF_PROJECTING_SCUARE_END HPDF_PROJECTING_SCUARE_END
+#define DEFAULT_HPDF_PROJECTING_SQUARE_END HPDF_PROJECTING_SQUARE_END
/* _LineJoin */
#define DEFAULT_HPDF_MITER_JOIN HPDF_MITER_JOIN
@@ -229,7 +229,7 @@
/* ByteType */
#define DEFAULT_HPDF_BYTE_TYPE_SINGLE HPDF_BYTE_TYPE_SINGLE
#define DEFAULT_HPDF_BYTE_TYPE_LEAD HPDF_BYTE_TYPE_LEAD
-#define DEFAULT_HPDF_BYTE_TYPE_TRIAL HPDF_BYTE_TYPE_TRIAL
+#define DEFAULT_HPDF_BYTE_TYPE_TRAIL HPDF_BYTE_TYPE_TRAIL
#define DEFAULT_HPDF_BYTE_TYPE_UNKNOWN HPDF_BYTE_TYPE_UNKNOWN
/* TextAlignment */

View file

@ -5,7 +5,7 @@
let
buildExtension = lib.makeOverridable
({ name, gawkextlib, extraBuildInputs ? [ ], doCheck ? true }:
({ name, gawkextlib, extraBuildInputs ? [ ], doCheck ? true, patches ? [ ] }:
let is_extension = gawkextlib != null;
in stdenv.mkDerivation rec {
pname = "gawkextlib-${name}";
@ -17,6 +17,8 @@ let
sha256 = "sha256-0p3CrQ3TBl7UcveZytK/9rkAzn69RRM2GwY2eCeqlkg=";
};
inherit patches;
postPatch = ''
cd ${name}
'';
@ -83,12 +85,16 @@ let
name = "gd";
extraBuildInputs = [ gd ];
};
# Build has been broken: https://github.com/NixOS/nixpkgs/issues/191072
# haru = buildExtension {
# inherit gawkextlib;
# name = "haru";
# extraBuildInputs = [ libharu ];
# };
haru = buildExtension {
inherit gawkextlib;
name = "haru";
extraBuildInputs = [ libharu ];
patches = [
# Renames references to two identifiers with typos that libharu fixed in 2.4.4
# https://github.com/libharu/libharu/commit/88271b73c68c521a49a15e3555ef00395aa40810
./fix-typos-corrected-in-libharu-2.4.4.patch
];
};
json = buildExtension {
inherit gawkextlib;
name = "json";