Re: print/poppler: use boost (also fixes possible build breakage)
Hi, On Sun, Sep 15, 2019 at 01:40:35PM +0100, Stuart Henderson wrote: > > > -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 > > > > Don't you need to adjust RUN_DEPENDS for API dependency? > > > > $ rg -i boost /usr/local/include/poppler > > /usr/local/include/poppler/poppler-config.h > > 114:/* Use header-only classes from Boost in the Splash backend */ > > 115:#ifndef USE_BOOST_HEADERS > > 116:#define USE_BOOST_HEADERS 1 > > > > /usr/local/include/poppler/splash/SplashXPathScanner.h > > 30:#ifdef USE_BOOST_HEADERS > > 31:#include > > 103:#ifdef USE_BOOST_HEADERS > > 104: typedef boost::container::small_vector > > IntersectionLine; > > 122:#ifdef USE_BOOST_HEADERS > > 123: typedef boost::container::small_vector > > IntersectionLine; > > > > Oh, good catch. > > Index: Makefile > === > RCS file: /cvs/ports/print/poppler/Makefile,v > retrieving revision 1.147 > diff -u -p -r1.147 Makefile > --- Makefile 14 Sep 2019 20:14:26 - 1.147 > +++ Makefile 15 Sep 2019 12:40:10 - > @@ -6,7 +6,7 @@ COMMENT-utils=PDF conversion tools and > > V= 0.80.0 > DISTNAME=poppler-$V > -REVISION-main= 0 > +REVISION-main= 1 > CATEGORIES= print > PKGNAME-main=poppler-$V > PKGNAME-utils= poppler-utils-$V > @@ -43,13 +43,16 @@ MODULES= devel/cmake > > MODULES+=x11/qt5 > > -# devel/boost only as build dependency, because poppler uses > -# header-only classes (from boost/containers/small_vector.hpp). > +# devel/boost only as build+run dependency, poppler uses > +# header-only classes (from boost/containers/small_vector.hpp) > +# which are pulled in by installed headers, but does not use > +# boost libraries. > BUILD_DEPENDS+= devel/boost \ > devel/gobject-introspection > > RUN_DEPENDS-main= \ > - print/poppler-data>=0.4.7 > + print/poppler-data>=0.4.7 \ > + devel/boost > > LIB_DEPENDS-main=${MODGCC4_CPPLIBDEP} \ > converters/libiconv \ ok. Ciao, Kili
Re: print/poppler: use boost (also fixes possible build breakage)
On 2019/09/15 04:48, Jan Beich wrote: > Matthias Kilian writes: > > > -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 > > Don't you need to adjust RUN_DEPENDS for API dependency? > > $ rg -i boost /usr/local/include/poppler > /usr/local/include/poppler/poppler-config.h > 114:/* Use header-only classes from Boost in the Splash backend */ > 115:#ifndef USE_BOOST_HEADERS > 116:#define USE_BOOST_HEADERS 1 > > /usr/local/include/poppler/splash/SplashXPathScanner.h > 30:#ifdef USE_BOOST_HEADERS > 31:#include > 103:#ifdef USE_BOOST_HEADERS > 104: typedef boost::container::small_vector > IntersectionLine; > 122:#ifdef USE_BOOST_HEADERS > 123: typedef boost::container::small_vector > IntersectionLine; > Oh, good catch. Index: Makefile === RCS file: /cvs/ports/print/poppler/Makefile,v retrieving revision 1.147 diff -u -p -r1.147 Makefile --- Makefile14 Sep 2019 20:14:26 - 1.147 +++ Makefile15 Sep 2019 12:40:10 - @@ -6,7 +6,7 @@ COMMENT-utils= PDF conversion tools and V= 0.80.0 DISTNAME= poppler-$V -REVISION-main= 0 +REVISION-main= 1 CATEGORIES=print PKGNAME-main= poppler-$V PKGNAME-utils= poppler-utils-$V @@ -43,13 +43,16 @@ MODULES=devel/cmake MODULES+= x11/qt5 -# devel/boost only as build dependency, because poppler uses -# header-only classes (from boost/containers/small_vector.hpp). +# devel/boost only as build+run dependency, poppler uses +# header-only classes (from boost/containers/small_vector.hpp) +# which are pulled in by installed headers, but does not use +# boost libraries. BUILD_DEPENDS+= devel/boost \ devel/gobject-introspection RUN_DEPENDS-main= \ - print/poppler-data>=0.4.7 + print/poppler-data>=0.4.7 \ + devel/boost LIB_DEPENDS-main=${MODGCC4_CPPLIBDEP} \ converters/libiconv \
Re: print/poppler: use boost (also fixes possible build breakage)
Matthias Kilian writes: > -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 Don't you need to adjust RUN_DEPENDS for API dependency? $ rg -i boost /usr/local/include/poppler /usr/local/include/poppler/poppler-config.h 114:/* Use header-only classes from Boost in the Splash backend */ 115:#ifndef USE_BOOST_HEADERS 116:#define USE_BOOST_HEADERS 1 /usr/local/include/poppler/splash/SplashXPathScanner.h 30:#ifdef USE_BOOST_HEADERS 31:#include 103:#ifdef USE_BOOST_HEADERS 104: typedef boost::container::small_vector IntersectionLine; 122:#ifdef USE_BOOST_HEADERS 123: typedef boost::container::small_vector IntersectionLine;
print/poppler: use boost (also fixes possible build breakage)
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 --- Makefile10 Sep 2019 13:52:42 - 1.146 +++ Makefile14 Sep 2019 18:39:55 - @@ -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