Skip to content

Commit

Permalink
Enable native fontforge native scripting
Browse files Browse the repository at this point in the history
  • Loading branch information
ViliusSutkus89 committed Nov 3, 2023
1 parent 65d3803 commit af70907
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fontforge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ tasks.extractSrc {
// fontforgeexe/startnoui.c
srcDir.resolve("fontforgeexe/startnoui.c").patch(projectDir.resolve("patches/fontforgeexe-startnoui.FindOrMakeEncoding.patch"))

// https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md
srcDir.resolve("config.h.in").patch(projectDir.resolve("patches/file_offset_bits.patch"))

// android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/pwd.h
// #if __ANDROID_API__ >= 26
// struct passwd* getpwent(void) __INTRODUCED_IN(26);
Expand Down Expand Up @@ -198,14 +201,13 @@ if (portVersion == "20170731") {
autoconf {
args(
"--disable-programs",
"--disable-native-scripting",
"--disable-python-scripting",
"--disable-python-extension",
"--without-included-ltdl",
)

generatedDependencies.resolve(toolchain.abi.triple).let {
// libfontforge fails to pick up libpng on it's own.
// libfontforge fails to pick up libpng on its own.
// Vars generated by PKG_CONFIG_LIBDIR=${it.resolve("lib/pkgconfig")} pkg-config --libs --static libpng

env["LIBPNG_CFLAGS"] = "-I${it.resolve("include/libpng16")}"
Expand Down Expand Up @@ -239,7 +241,6 @@ if (portVersion == "20170731") {
cmake {
args(
"-DENABLE_GUI=OFF",
// "-DENABLE_NATIVE_SCRIPTING=OFF",
"-DENABLE_PYTHON_SCRIPTING=OFF",
"-DENABLE_PYTHON_EXTENSION=OFF",
)
Expand Down
13 changes: 13 additions & 0 deletions fontforge/patches/file_offset_bits.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- config.h.in 2017-07-31 11:31:43.570015000 +0300
+++ config.h.in 2023-11-03 06:04:58.549000000 +0200
@@ -1514,8 +1514,10 @@
/* Enable large inode numbers on Mac OS X 10.5. */
#undef _DARWIN_USE_64_BIT_INODE

+#if __ANDROID_MIN_SDK_VERSION__ >= 24
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
+#endif

/* Platform specific stuff */
#undef _Keyboard

0 comments on commit af70907

Please sign in to comment.