Skip to content

Commit

Permalink
Add fontforge-share patch to pdf2htmlEX
Browse files Browse the repository at this point in the history
  • Loading branch information
ViliusSutkus89 committed Dec 14, 2023
1 parent 4adf6ab commit f613fcd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pdf2htmlEX/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ dependencies {
implementation("com.viliussutkus89.ndk.thirdparty:fontforge${ndkVersionSuffix}-static:20200314-beta-9")
implementation("com.viliussutkus89.ndk.thirdparty:poppler${ndkVersionSuffix}-static:0.89.0-beta-3")
}
// "0.18.8.rc2" -> {
// implementation("com.viliussutkus89.ndk.thirdparty:fontforge${ndkVersionSuffix}-static:20230101-beta-8")
// implementation("com.viliussutkus89.ndk.thirdparty:poppler${ndkVersionSuffix}-static:21.02.0-beta-3")
// }
}
}

Expand Down Expand Up @@ -95,6 +99,9 @@ tasks.extractSrc {
.patch("cflags.patch")
.patch("missing-tests.patch")
srcDir.patch("make-a-library.patch")

srcDir.resolve("pdf2htmlEX/src/util/ffw.c")
.patch("fontforge-share.patch")
}
}
}
Expand All @@ -114,7 +121,6 @@ tasks.register<CMakePortTask>("buildPort") {
cmake { }

doLast {
// @TODO: verify other ABIs have matching assets
val dst = layout.buildDirectory.asFile.get().resolve("assets/pdf2htmlEX/share/pdf2htmlEX").apply { mkdirs() }
installDirectoryFor(com.android.ndkports.Abi.Arm).resolve("share/pdf2htmlEX").copyRecursively(dst) { file, exception ->
if (exception !is FileAlreadyExistsException) {
Expand Down
13 changes: 13 additions & 0 deletions pdf2htmlEX/patches/0.18.8.rc1/fontforge-share.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- pdf2htmlEX/src/util/ffw.c 2023-12-14 07:45:44.994000000 +0200
+++ pdf2htmlEX/src/util/ffw.c 2023-12-14 07:46:21.870000000 +0200
@@ -70,7 +70,9 @@
void ffw_init(const char* progPath, int debug)
{
ffwSetAction("initialize");
- char *localProgPath = strdup(progPath);
+ char *localProgPath = NULL;
+ if (progPath != NULL)
+ localProgPath = strdup(progPath);
FindProgDir(localProgPath);
InitSimpleStuff();
if ( default_encoding==NULL )

0 comments on commit f613fcd

Please sign in to comment.