Skip to content

Commit

Permalink
Update pdf2htmlEX-0.18.8-rc2 patch
Browse files Browse the repository at this point in the history
  • Loading branch information
ViliusSutkus89 committed Dec 18, 2023
1 parent 6eae4f1 commit 5ea4ed0
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 100 deletions.
4 changes: 2 additions & 2 deletions pdf2htmlEX/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ val portVersion = when(project.findProperty("packageVersion")) {
version = "0.18.8.rc1-beta-5"
"0.18.8.rc1"
}
// https://github.com/pdf2htmlEX/pdf2htmlEX/pull/145 Will probably be named rc2
// https://github.com/pdf2htmlEX/pdf2htmlEX/pull/154 Hoping it will be named rc2
else /* "0.18.8.rc2" */ -> {
version = "0.18.8.rc2-beta-2"
version = "0.18.8.rc2-beta-3"
"0.18.8.rc2"
}
}
Expand Down
2 changes: 1 addition & 1 deletion pdf2htmlEX/patches/0.18.8.rc2/cflags.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- pdf2htmlEX/CMakeLists.txt 2023-11-15 02:31:51.534000000 +0200
+++ pdf2htmlEX/CMakeLists.txt 2023-11-15 02:31:58.159000000 +0200
@@ -40,15 +40,6 @@
@@ -36,15 +36,6 @@
set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} PkgConfig::FONTFORGE)
include_directories(${FONTFORGE_INCLUDEDIR}/private)

Expand Down
39 changes: 19 additions & 20 deletions pdf2htmlEX/patches/0.18.8.rc2/find-libraries.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
--- pdf2htmlEX/CMakeLists.txt 2023-11-14 03:32:25.260000000 +0200
+++ pdf2htmlEX/CMakeLists.txt 2023-11-15 02:28:10.440000000 +0200
@@ -23,90 +23,22 @@

@@ -23,90 +23,18 @@
find_package(PkgConfig)

-
-# SINCE we have a very intimate relationship with a particular version of
-# poppler... we explicitly describe the poppler include and library
-# SINCE we have a very intimate relationship with a particular version of
-# poppler... we explicitly describe the poppler include and library
-# paths.
-#
-include_directories(
Expand All @@ -16,17 +16,17 @@
- ../poppler
-)
-#
-# The following order is critical as the glib functions use functions
-# located in the main poppler library
-# The following order is critical as the glib functions use functions
-# located in the main poppler library
-#
-set(POPPLER_LIBRARIES ${POPPLER_LIBRARIES}
- ${CMAKE_SOURCE_DIR}/../poppler/build/glib/libpoppler-glib.a
- ${CMAKE_SOURCE_DIR}/../poppler/build/libpoppler.a
-)
-
-
+pkg_search_module(POPPLER-GLIB REQUIRED IMPORTED_TARGET poppler-glib=23.12.0)
+set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} PkgConfig::POPPLER-GLIB)

if(ENABLE_SVG)
- pkg_check_modules(CAIRO REQUIRED cairo>=1.10.0)
- message("-- Trying to locate cairo-svg...")
Expand All @@ -47,14 +47,15 @@
- include_directories(${FREETYPE_INCLUDE_DIRS})
- link_directories(${FREETYPE_LIBRARY_DIRS})
-# set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${FREETYPE_LIBRARIES})
-endif()
+ pkg_search_module(CAIRO_SVG REQUIRED IMPORTED_TARGET cairo-svg)
+ set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} PkgConfig::CAIRO_SVG)
+
+ pkg_search_module(FREETYPE REQUIRED IMPORTED_TARGET freetype2)
+ set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} PkgConfig::FREETYPE)
+ set(ENABLE_SVG 1)

-# SINCE we have a very intimate relationship with a particular version of
-# fontforge... we explicitly describe the fontforge include and library
endif()
-
-# SINCE we have a very intimate relationship with a particular version of
-# fontforge... we explicitly describe the fontforge include and library
-# paths.
-#
-include_directories(
Expand All @@ -72,14 +73,12 @@
-
-# If we are using Alpine Linux then we need to add -lintl
-#
-if (EXISTS /usr/lib/libintl.so )
-if (EXISTS /usr/lib/libintl.so )
- set(LIB_INTL_LIBRARIES -lintl )
-else ()
- set(LIB_INTL_LIBRARIES "" )
+ pkg_search_module(FREETYPE REQUIRED IMPORTED_TARGET freetype2)
+ set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} PkgConfig::FREETYPE)
endif()

-endif()
-
-set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS}
- ${POPPLER_LIBRARIES}
- ${FONTFORGE_LIBRARIES}
Expand All @@ -92,13 +91,13 @@
- -lxml2
- -lglib-2.0
- -lgio-2.0
- -pthread
- -lgobject-2.0
- -lz
- -lm
-)
+pkg_search_module(FONTFORGE REQUIRED IMPORTED_TARGET libfontforge=20230101)
+set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} PkgConfig::FONTFORGE)
+include_directories(${FONTFORGE_INCLUDEDIR}/private)

# debug build flags (overwrite default cmake debug flags)
set(CMAKE_C_FLAGS_DEBUG "-ggdb -pg")
19 changes: 16 additions & 3 deletions pdf2htmlEX/patches/0.18.8.rc2/make-a-library.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
--- pdf2htmlEX/CMakeLists.txt 2023-11-15 02:31:58.159000000 +0200
+++ pdf2htmlEX/CMakeLists.txt 2023-12-17 08:09:48.771000000 +0200
@@ -63,7 +63,6 @@
@@ -62,7 +62,6 @@

set(PDF2HTMLEX_SRC ${PDF2HTMLEX_SRC}
src/Param.h
- src/pdf2htmlEX.cc
src/pdf2htmlEX-config.h
src/HTMLRenderer/HTMLRenderer.h
src/HTMLRenderer/draw.cc
@@ -124,8 +123,11 @@
@@ -123,8 +122,11 @@
src/TmpFiles.cc
)

Expand All @@ -22,7 +22,7 @@

add_custom_target(pdf2htmlEX_resources ALL DEPENDS
${CMAKE_SOURCE_DIR}/share/base.min.css
@@ -150,7 +152,14 @@
@@ -149,7 +151,14 @@
${CMAKE_SOURCE_DIR}/share/fancy.css
)

Expand Down Expand Up @@ -926,3 +926,16 @@ new file mode 100644
+
+} // namespace pdf2htmlEX
\ No newline at end of file
--- pdf2htmlEX/src/util/ffw.c 2020-08-19 23:43:25.000000000 +0300
+++ pdf2htmlEX/src/util/ffw.c 2023-12-17 10:40:47.807000000 +0200
@@ -70,8 +70,9 @@
void ffw_init(const char* progPath, int debug)
{
ffwSetAction("initialize");
- char *localProgPath = strdup(progPath);
+ char *localProgPath = strcopy(progPath);
FindProgRoot(localProgPath);
+ free(localProgPath);
InitSimpleStuff();
if ( default_encoding==NULL )
default_encoding=FindOrMakeEncoding("ISO8859-1");
2 changes: 1 addition & 1 deletion pdf2htmlEX/patches/0.18.8.rc2/missing-tests.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- pdf2htmlEX/CMakeLists.txt 2020-08-19 23:43:25.000000000 +0300
+++ pdf2htmlEX/CMakeLists.txt 2023-11-14 03:29:50.860000000 +0200
@@ -180,8 +180,9 @@
@@ -179,8 +179,9 @@
file(MAKE_DIRECTORY ${PDF2HTMLEX_DATDIR})
file(MAKE_DIRECTORY ${PDF2HTMLEX_PNGDIR})
file(MAKE_DIRECTORY ${PDF2HTMLEX_OUTDIR})
Expand Down
Loading

0 comments on commit 5ea4ed0

Please sign in to comment.