Hi,
as noticed by naddy@, poppler detects and tries to use
boost/containers/small_vector.hpp when boost is installed at configure
time (and may later fail if boost is removed early enough during
the build).
According to comments and the git commit message
(355fd8d58ca0209284fe568b3add28f207e995c1), small_vector is a
header-only class, so it's enough to add devel/boost as a build
dependency.
This removes two exported symbols (and adds three new), so I've
bumped the majer version of libpoppler.
The reason for using small_vector is performance. Full commit message
from upstream:
SplashXPathScanner: Optionally use small_vector from boost
Currently, each row in the intersections vector is allocated separately,
when the first intersection is added.
To avoid these allocations for common simple polygons,
boost::container::small_vector<4, T> is used, which stores up to
4 intersections inline. small_vector is a header-only class.
For the documents from #57 (fdo#96728) and #24 (fdo#78728), the
runtime/memory is significantly reduced (according to /usr/bin/time -v):
(1) $> pdftoppm -r 18 -aa no runsforever-poppler.pdf
(2) $> pdftoppm surf-types.pdf
Before/After
runsforever-poppler | surf-types
User time (seconds): 2348.08 / 1773.53 | 7.76 / 5.02
Maximum resident set size (kbytes): 46288 / 45896 | 14076 / 13748
Comments? Objections? As an alternative, I could also just patch
out the detection of an installed boost at configure time.
Ciao,
Kili
Index: Makefile
===================================================================
RCS file: /cvs/ports/print/poppler/Makefile,v
retrieving revision 1.146
diff -u -p -r1.146 Makefile
--- Makefile 10 Sep 2019 13:52:42 -0000 1.146
+++ Makefile 14 Sep 2019 18:39:55 -0000
@@ -6,6 +6,7 @@ COMMENT-utils= PDF conversion tools and
V= 0.80.0
DISTNAME= poppler-$V
+REVISION-main= 0
CATEGORIES= print
PKGNAME-main= poppler-$V
PKGNAME-utils= poppler-utils-$V
@@ -13,7 +14,7 @@ PKGNAME-qt5= poppler-qt5-$V
EXTRACT_SUFX= .tar.xz
-SHARED_LIBS += poppler 54.0 # 90.0
+SHARED_LIBS += poppler 55.0 # 90.0
SHARED_LIBS += poppler-glib 19.3 # 8.14
SHARED_LIBS += poppler-qt5 7.3 # 1.21
SHARED_LIBS += poppler-cpp 11.0 # 0.7
@@ -42,7 +43,10 @@ MODULES= devel/cmake
MODULES+= x11/qt5
-BUILD_DEPENDS+= devel/gobject-introspection
+# devel/boost only as build dependency, because poppler uses
+# header-only classes (from boost/containers/small_vector.hpp).
+BUILD_DEPENDS+= devel/boost \
+ devel/gobject-introspection
RUN_DEPENDS-main= \
print/poppler-data>=0.4.7