Skip to content

Commit

Permalink
Update FontForge patches and POM
Browse files Browse the repository at this point in the history
  • Loading branch information
ViliusSutkus89 committed Nov 3, 2023
1 parent 8ad45fa commit 2277197
Show file tree
Hide file tree
Showing 19 changed files with 815 additions and 368 deletions.
935 changes: 569 additions & 366 deletions fontforge/build.gradle.kts

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- fsys.c 2017-07-22 05:00:39.154250006 -0000
+++ fsys.c 2019-09-23 02:35:01.093000000 -0000
--- gutils/fsys.c 2017-07-22 05:00:39.154250006 -0000
+++ gutils/fsys.c 2019-09-23 02:35:01.093000000 -0000
@@ -175,6 +175,11 @@
return buffer;
}
Expand Down
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions fontforge/patches/20200314/FindGLib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--- cmake/packages/FindGLIB.cmake 2019-11-13 11:00:19.000000000 +0200
+++ cmake/packages/FindGLIB.cmake 2023-11-03 07:49:34.466000000 +0200
@@ -126,7 +126,8 @@
set_property(TARGET GLIB::GLIB PROPERTY
INTERFACE_INCLUDE_DIRECTORIES "${GLIB_INCLUDE_DIRS}")
set_property(TARGET GLIB::GLIB PROPERTY
- INTERFACE_LINK_LIBRARIES "${GLIB_LIBRARIES}")
+ INTERFACE_LINK_LIBRARIES "${PC_GLIB_LIBRARIES}")
+ set_property(TARGET GLIB::GLIB PROPERTY INTERFACE_LINK_DIRECTORIES "${PC_GLIB_LIBDIR}")
if(DEFINED GLIB_GIO_LIBRARIES)
set_property(TARGET GLIB::GLIB APPEND PROPERTY
INTERFACE_LINK_LIBRARIES "${GLIB_GIO_LIBRARIES}")

--- CMakeLists.txt 2020-03-14 06:01:25.000000000 +0200
+++ CMakeLists.txt 2023-11-03 07:53:25.053000000 +0200
@@ -99,7 +99,7 @@
find_package(Freetype 2.3.7 REQUIRED)
find_package(Gettext REQUIRED)
find_package_with_target(Intl REQUIRED)
-find_package(GLIB 2.6 REQUIRED COMPONENTS gio)
+find_package(GLIB 2.6 REQUIRED COMPONENTS gio gobject gmodule)
find_package(Iconv REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(MathLib REQUIRED)
42 changes: 42 additions & 0 deletions fontforge/patches/20200314/InstallLibrary.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
--- fontforge/CMakeLists.txt 2020-01-27 10:39:51.000000000 +0200
+++ fontforge/CMakeLists.txt 2023-11-03 10:04:11.517000000 +0200
@@ -112,8 +112,6 @@
)

add_library(fontforge
- ${FONTFORGE_NOINST_HEADERS}
- ${FONTFORGE_INST_HEADERS}
activeinui.c
asmfpst.c
autohint.c
@@ -209,6 +207,9 @@
zapfnomen.c
)

+set_target_properties(fontforge PROPERTIES PUBLIC_HEADER "${FONTFORGE_INST_HEADERS}")
+set_target_properties(fontforge PROPERTIES PRIVATE_HEADER "${FONTFORGE_NOINST_HEADERS}")
+
if(ENABLE_WOFF2_RESULT)
target_sources(fontforge PRIVATE woff2.cc)
endif()
@@ -269,11 +270,13 @@
target_link_libraries(fontforge PRIVATE gunicode gutils)
endif()

-# No dev package -> no need to install if static
-if(BUILD_SHARED_LIBS)
- if(WIN32)
- install(TARGETS fontforge RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
- else()
- install(TARGETS fontforge RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
- endif()
+if(WIN32)
+ install(TARGETS fontforge RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+else()
+ install(TARGETS fontforge
+ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ )
endif()
24 changes: 24 additions & 0 deletions fontforge/patches/20200314/gutils-fsys.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--- gutils/fsys.c 2017-07-22 05:00:39.154250006 -0000
+++ gutils/fsys.c 2019-09-23 02:35:01.093000000 -0000
@@ -175,6 +175,11 @@
return buffer;
}
return NULL;
+#elif defined(__ANDROID__)
+ static char *dir;
+ dir = getenv("HOME");
+ if ( dir!=NULL )
+ return( copy(dir) );
#else
static char *dir;
uid_t uid;
@@ -893,6 +898,9 @@
return dir;
}
return NULL;
+#elif defined(__ANDROID__)
+ char *home = getenv("HOME");
+ return home;
#else
uid_t uid;
struct passwd *pw;
10 changes: 10 additions & 0 deletions fontforge/patches/20200314/include-iconv.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- inc/CMakeLists.txt 2019-11-13 11:00:19.000000000 +0200
+++ inc/CMakeLists.txt 2023-11-03 07:30:10.325000000 +0200
@@ -15,6 +15,7 @@
target_link_libraries(fontforge_common_headers
INTERFACE
GLIB::GLIB
+ Iconv::Iconv
)

if(ENABLE_CODE_COVERAGE_RESULT)
27 changes: 27 additions & 0 deletions fontforge/patches/20200314/pie.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--- gutils/CMakeLists.txt 2019-11-13 11:00:19.000000000 +0200
+++ gutils/CMakeLists.txt 2023-11-03 08:16:14.105000000 +0200
@@ -33,9 +33,7 @@
unicodelibinfo.c
)

-if(BUILD_SHARED_LIBS)
- set_property(TARGET gutils PROPERTY POSITION_INDEPENDENT_CODE ON)
-endif()
+set_property(TARGET gutils PROPERTY POSITION_INDEPENDENT_CODE ON)

if(ENABLE_LIBGIF_RESULT)
list(APPEND gutils_LIBRARIES GIF::GIF)

--- Unicode/CMakeLists.txt 2020-03-03 11:24:02.000000000 +0200
+++ Unicode/CMakeLists.txt 2023-11-03 07:33:25.986000000 +0200
@@ -43,9 +43,7 @@
charset/ZapfDingbats.c
)

-if(BUILD_SHARED_LIBS)
- set_property(TARGET gunicode PROPERTY POSITION_INDEPENDENT_CODE ON)
-endif()
+set_property(TARGET gunicode PROPERTY POSITION_INDEPENDENT_CODE ON)

if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
make_object_interface(gunicode
24 changes: 24 additions & 0 deletions fontforge/patches/20230101/FindGLib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--- cmake/packages/FindGLIB.cmake 2019-11-13 11:00:19.000000000 +0200
+++ cmake/packages/FindGLIB.cmake 2023-11-03 07:49:34.466000000 +0200
@@ -126,7 +126,8 @@
set_property(TARGET GLIB::GLIB PROPERTY
INTERFACE_INCLUDE_DIRECTORIES "${GLIB_INCLUDE_DIRS}")
set_property(TARGET GLIB::GLIB PROPERTY
- INTERFACE_LINK_LIBRARIES "${GLIB_LIBRARIES}")
+ INTERFACE_LINK_LIBRARIES "${PC_GLIB_LIBRARIES}")
+ set_property(TARGET GLIB::GLIB PROPERTY INTERFACE_LINK_DIRECTORIES "${PC_GLIB_LIBDIR}")
if(DEFINED GLIB_GIO_LIBRARIES)
set_property(TARGET GLIB::GLIB APPEND PROPERTY
INTERFACE_LINK_LIBRARIES "${GLIB_GIO_LIBRARIES}")

--- CMakeLists.txt 2023-11-03 10:06:29.967000000 +0200
+++ CMakeLists.txt 2023-11-03 10:08:14.996000000 +0200
@@ -109,7 +109,7 @@
find_package(Gettext REQUIRED)
find_package_with_target(Intl REQUIRED)
if(UNIX AND NOT APPLE)
- find_package(GLIB 2.6 REQUIRED COMPONENTS gio gobject)
+ find_package(GLIB 2.6 REQUIRED COMPONENTS gio gobject gmodule)
else()
find_package(GLIB 2.58 REQUIRED COMPONENTS gio gobject)
endif()
42 changes: 42 additions & 0 deletions fontforge/patches/20230101/InstallLibrary.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
--- fontforge/CMakeLists.txt 2020-01-27 10:39:51.000000000 +0200
+++ fontforge/CMakeLists.txt 2023-11-03 10:04:11.517000000 +0200
@@ -112,8 +112,6 @@
)

add_library(fontforge
- ${FONTFORGE_NOINST_HEADERS}
- ${FONTFORGE_INST_HEADERS}
activeinui.c
asmfpst.c
autohint.c
@@ -209,6 +207,9 @@
zapfnomen.c
)

+set_target_properties(fontforge PROPERTIES PUBLIC_HEADER "${FONTFORGE_INST_HEADERS}")
+set_target_properties(fontforge PROPERTIES PRIVATE_HEADER "${FONTFORGE_NOINST_HEADERS}")
+
if(ENABLE_WOFF2_RESULT)
target_sources(fontforge PRIVATE woff2.cc)
endif()
@@ -269,11 +270,13 @@
target_link_libraries(fontforge PRIVATE gunicode gutils)
endif()

-# No dev package -> no need to install if static
-if(BUILD_SHARED_LIBS)
- if(WIN32 OR CYGWIN)
- install(TARGETS fontforge RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
- else()
- install(TARGETS fontforge RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
- endif()
+if(WIN32)
+ install(TARGETS fontforge RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+else()
+ install(TARGETS fontforge
+ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ )
endif()
24 changes: 24 additions & 0 deletions fontforge/patches/20230101/gutils-fsys.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--- gutils/fsys.c 2017-07-22 05:00:39.154250006 -0000
+++ gutils/fsys.c 2019-09-23 02:35:01.093000000 -0000
@@ -175,6 +175,11 @@
return buffer;
}
return NULL;
+#elif defined(__ANDROID__)
+ static char *dir;
+ dir = getenv("HOME");
+ if ( dir!=NULL )
+ return( copy(dir) );
#else
static char *dir;
uid_t uid;
@@ -893,6 +898,9 @@
return dir;
}
return NULL;
+#elif defined(__ANDROID__)
+ char *home = getenv("HOME");
+ return home;
#else
uid_t uid;
struct passwd *pw;
27 changes: 27 additions & 0 deletions fontforge/patches/20230101/pie.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--- gutils/CMakeLists.txt 2019-11-13 11:00:19.000000000 +0200
+++ gutils/CMakeLists.txt 2023-11-03 08:16:14.105000000 +0200
@@ -33,9 +33,7 @@
unicodelibinfo.c
)

-if(BUILD_SHARED_LIBS)
- set_property(TARGET gutils PROPERTY POSITION_INDEPENDENT_CODE ON)
-endif()
+set_property(TARGET gutils PROPERTY POSITION_INDEPENDENT_CODE ON)

if(ENABLE_LIBGIF_RESULT)
list(APPEND gutils_LIBRARIES GIF::GIF)

--- Unicode/CMakeLists.txt 2020-03-03 11:24:02.000000000 +0200
+++ Unicode/CMakeLists.txt 2023-11-03 07:33:25.986000000 +0200
@@ -43,9 +43,7 @@
charset/ZapfDingbats.c
)

-if(BUILD_SHARED_LIBS)
- set_property(TARGET gunicode PROPERTY POSITION_INDEPENDENT_CODE ON)
-endif()
+set_property(TARGET gunicode PROPERTY POSITION_INDEPENDENT_CODE ON)

if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
make_object_interface(gunicode

0 comments on commit 2277197

Please sign in to comment.