summarylogtreecommitdiffstats
path: root/01-okular-subpixel-rendering-by-poppler.patch
blob: 24de94cf2be84563982fe3b9d0db12fce420c7d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
From: Jeffrey Feng <galago1992@gmail.com>
Subject: okular LCD subpixel rendering by poppler
---
 CMakeLists.txt                    | 9 +++++----
 generators/poppler/CMakeLists.txt | 9 +++++++--
 2 files changed, 12 insertions(+), 6 deletions(-)

diff -ru a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt	2019-04-27 09:12:24.161327890 +0800
+++ b/CMakeLists.txt	2019-04-27 09:39:31.871255641 +0800
@@ -113,10 +113,9 @@
 find_package(ZLIB REQUIRED)
 
 # This is here instead of in generators since we use if(Poppler_Qt5_FOUND) in autotests/
-find_package(Poppler "0.12.1" COMPONENTS Qt5)
-set_package_properties("Poppler" PROPERTIES
-        TYPE RECOMMENDED
-        PURPOSE "Support for PDF files in okular.")
+# Use standalone subpixel-patched poppler-0.76 for PDF files.")
+set(Poppler_Qt5_FOUND 1)
+set(Poppler_VERSION "0.76.0")
 
 add_definitions(-DQT_USE_FAST_OPERATOR_PLUS)
 add_definitions(-DTRANSLATION_DOMAIN="okular")
@@ -140,6 +139,8 @@
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov")
 endif()
+# Always link to standalone patched poppler library
+STRING(REGEX REPLACE "--as-needed" "--no-as-needed" CMAKE_MODULE_LINKER_FLAGS ${CMAKE_MODULE_LINKER_FLAGS})
 
 add_subdirectory( ui )
 add_subdirectory( shell )
diff -ru a/generators/poppler/CMakeLists.txt b/generators/poppler/CMakeLists.txt
--- a/generators/poppler/CMakeLists.txt	2019-04-27 09:47:44.217900447 +0800
+++ b/generators/poppler/CMakeLists.txt	2019-04-27 10:51:48.444707284 +0800
@@ -19,7 +19,7 @@
   set (HAVE_POPPLER_0_37 1)
 endif()
 
-set(CMAKE_REQUIRED_LIBRARIES Poppler::Qt5 Qt5::Core Qt5::Gui)
+set(CMAKE_REQUIRED_LIBRARIES Qt5::Core Qt5::Gui)
 
 check_cxx_source_compiles("
 #include <poppler-qt5.h>
@@ -142,6 +142,8 @@
 
 include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/../..
+   ${POPPLER_LIB_DIR}/../include/poppler
+   ${POPPLER_LIB_DIR}/../include/poppler/qt5
 )
 
 ########### next target ###############
@@ -161,7 +163,10 @@
 
 okular_add_generator(okularGenerator_poppler ${okularGenerator_poppler_PART_SRCS})
 
-target_link_libraries(okularGenerator_poppler okularcore KF5::I18n KF5::Completion Poppler::Qt5 Qt5::Xml)
+set(POPPLER_LIB ${POPPLER_LIB_DIR}/libpoppler.so)
+set(POPPLER_QT5_LIB ${POPPLER_LIB_DIR}/libpoppler-qt5.so)
+set_target_properties(okularGenerator_poppler PROPERTIES INSTALL_RPATH ${POPPLER_LIB_RPATH})
+target_link_libraries(okularGenerator_poppler okularcore KF5::I18n KF5::Completion ${POPPLER_QT5_LIB} ${POPPLER_LIB} Qt5::Xml)
 
 ########### install files ###############
 install( FILES okularPoppler.desktop  DESTINATION  ${KDE_INSTALL_KSERVICES5DIR} )