Skip to content

Commit

Permalink
add missing find package patch
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand committed Jan 1, 2025
1 parent 80f8085 commit f0a6fe0
Show file tree
Hide file tree
Showing 3 changed files with 210 additions and 0 deletions.
4 changes: 4 additions & 0 deletions recipes/pdf2htmlex/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ patches:
- patch_file: "patches/0.18.8.rc1-git-6f85c88/0002-Update-missing-font-workaround.patch"
- patch_file: "patches/0.18.8.rc1-git-6f85c88/0003-use-find_package.patch"
- patch_file: "patches/0.18.8.rc1-git-6f85c88/0004-build-and-install-library.patch"
"v0.18.8.rc1-odr-git-3dcf842":
- patch_file: "patches/v0.18.8.rc1-odr-git-3dcf842/0001-use-find_package.patch"
"v0.18.8.rc1-odr-pr1":
- patch_file: "patches/v0.18.8.rc1-odr-pr1/0001-use-find_package.patch"
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
From 90261925551ebd76032324728b2ad52eb741902c Mon Sep 17 00:00:00 2001
From: Andreas Stefl <stefl.andreas@gmail.com>
Date: Wed, 18 Sep 2024 19:49:39 +0200
Subject: [PATCH 3/4] use `find_package`

---
pdf2htmlEX/CMakeLists.txt | 75 +++++++++++----------------------------
1 file changed, 20 insertions(+), 55 deletions(-)

diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt
index 84b4a98..73a7eeb 100644
--- a/pdf2htmlEX/CMakeLists.txt
+++ b/pdf2htmlEX/CMakeLists.txt
@@ -21,66 +21,31 @@ add_custom_target(dist
| bzip2 > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

-find_package(PkgConfig)
-
-
-# SINCE we have a very intimate relationship with a particular version of
-# poppler... we explicitly describe the poppler include and library
-# paths.
-#
-include_directories(
- ../poppler/build/poppler
- ../poppler/build
- ../poppler/poppler
- ../poppler
-)
-#
-# 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
+find_package(poppler REQUIRED)
+set(PDF2HTMLEX_LIBS
+ ${PDF2HTMLEX_LIBS}
+ poppler::libpoppler
+ poppler::libpoppler-cpp
+ poppler::libpoppler-splash
+ poppler::libpoppler-cairo
+ poppler::libpoppler-glib
)

-
if(ENABLE_SVG)
- pkg_check_modules(CAIRO REQUIRED cairo>=1.10.0)
- message("-- Trying to locate cairo-svg...")
- find_path(CAIRO_SVG_INCLUDE_PATH cairo-svg.h PATHS ${CAIRO_INCLUDE_DIRS} NO_DEFAULT_PATH)
- if(CAIRO_SVG_INCLUDE_PATH)
- message("-- found cairo-svg...")
- include_directories(${CAIRO_INCLUDE_DIRS})
- if(NOT DEFINED ENV{USING_BREW})
- link_directories(${CAIRO_LIBRARY_DIRS})
- set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${CAIRO_LIBRARIES})
- endif()
- set(ENABLE_SVG 1)
- else()
- message(FATAL_ERROR "Error: no SVG support found in Cairo")
- endif()
-
- find_package(Freetype REQUIRED)
- include_directories(${FREETYPE_INCLUDE_DIRS})
- link_directories(${FREETYPE_LIBRARY_DIRS})
-# set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${FREETYPE_LIBRARIES})
+ find_package(cairo REQUIRED)
+ find_package(freetype REQUIRED)
+ set(PDF2HTMLEX_LIBS
+ ${PDF2HTMLEX_LIBS}
+ cairo::cairo-svg
+ Freetype::Freetype
+ )
+ set(ENABLE_SVG 1)
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(
- ../fontforge/fontforge
- ../fontforge
- ../fontforge/build/inc
- ../fontforge/inc
-)
-#
-include_directories(${FONTFORGE_INCLUDE_DIRS})
-link_directories(${FONTFORGE_LIBRARY_DIRS})
-set(FONTFORGE_LIBRARIES ${FONTFORGE_LIBRARIES}
- ${CMAKE_SOURCE_DIR}/../fontforge/build/lib/libfontforge.a
+find_package(fontforge REQUIRED)
+set(PDF2HTMLEX_LIBS
+ ${PDF2HTMLEX_LIBS}
+ fontforge::fontforge
)

# If we are using Alpine Linux then we need to add -lintl
--
2.39.3 (Apple Git-146)

Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
From 90261925551ebd76032324728b2ad52eb741902c Mon Sep 17 00:00:00 2001
From: Andreas Stefl <stefl.andreas@gmail.com>
Date: Wed, 18 Sep 2024 19:49:39 +0200
Subject: [PATCH 3/4] use `find_package`

---
pdf2htmlEX/CMakeLists.txt | 75 +++++++++++----------------------------
1 file changed, 20 insertions(+), 55 deletions(-)

diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt
index 84b4a98..73a7eeb 100644
--- a/pdf2htmlEX/CMakeLists.txt
+++ b/pdf2htmlEX/CMakeLists.txt
@@ -21,66 +21,31 @@ add_custom_target(dist
| bzip2 > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

-find_package(PkgConfig)
-
-
-# SINCE we have a very intimate relationship with a particular version of
-# poppler... we explicitly describe the poppler include and library
-# paths.
-#
-include_directories(
- ../poppler/build/poppler
- ../poppler/build
- ../poppler/poppler
- ../poppler
-)
-#
-# 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
+find_package(poppler REQUIRED)
+set(PDF2HTMLEX_LIBS
+ ${PDF2HTMLEX_LIBS}
+ poppler::libpoppler
+ poppler::libpoppler-cpp
+ poppler::libpoppler-splash
+ poppler::libpoppler-cairo
+ poppler::libpoppler-glib
)

-
if(ENABLE_SVG)
- pkg_check_modules(CAIRO REQUIRED cairo>=1.10.0)
- message("-- Trying to locate cairo-svg...")
- find_path(CAIRO_SVG_INCLUDE_PATH cairo-svg.h PATHS ${CAIRO_INCLUDE_DIRS} NO_DEFAULT_PATH)
- if(CAIRO_SVG_INCLUDE_PATH)
- message("-- found cairo-svg...")
- include_directories(${CAIRO_INCLUDE_DIRS})
- if(NOT DEFINED ENV{USING_BREW})
- link_directories(${CAIRO_LIBRARY_DIRS})
- set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${CAIRO_LIBRARIES})
- endif()
- set(ENABLE_SVG 1)
- else()
- message(FATAL_ERROR "Error: no SVG support found in Cairo")
- endif()
-
- find_package(Freetype REQUIRED)
- include_directories(${FREETYPE_INCLUDE_DIRS})
- link_directories(${FREETYPE_LIBRARY_DIRS})
-# set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${FREETYPE_LIBRARIES})
+ find_package(cairo REQUIRED)
+ find_package(freetype REQUIRED)
+ set(PDF2HTMLEX_LIBS
+ ${PDF2HTMLEX_LIBS}
+ cairo::cairo-svg
+ Freetype::Freetype
+ )
+ set(ENABLE_SVG 1)
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(
- ../fontforge/fontforge
- ../fontforge
- ../fontforge/build/inc
- ../fontforge/inc
-)
-#
-include_directories(${FONTFORGE_INCLUDE_DIRS})
-link_directories(${FONTFORGE_LIBRARY_DIRS})
-set(FONTFORGE_LIBRARIES ${FONTFORGE_LIBRARIES}
- ${CMAKE_SOURCE_DIR}/../fontforge/build/lib/libfontforge.a
+find_package(fontforge REQUIRED)
+set(PDF2HTMLEX_LIBS
+ ${PDF2HTMLEX_LIBS}
+ fontforge::fontforge
)

# If we are using Alpine Linux then we need to add -lintl
--
2.39.3 (Apple Git-146)

0 comments on commit f0a6fe0

Please sign in to comment.