Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[poppler] Add new port #15158

Merged
merged 29 commits into from Jan 4, 2021
Merged

[poppler] Add new port #15158

merged 29 commits into from Jan 4, 2021

Conversation

playgithub
Copy link
Contributor

  • By default it builds in C++14
  • With vcpkg install poppler[cpp17], it builds in C++17

PS: for poppler C++14 and C++17 are not compatible

@ghost
Copy link

ghost commented Dec 16, 2020

CLA assistant check
All CLA requirements met.

Copy link
Member

@vicroms vicroms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @playgithub

Thanks for your contribution! 😄

I pointed out a few things to improve the port. Please let me know if you need any further guidance with this PR.

ports/poppler/0001-remove-tests.patch Outdated Show resolved Hide resolved
ports/poppler/0002-remove-utils.patch Outdated Show resolved Hide resolved
ports/poppler/0004-remove-Qt5-and-Qt6-support.patch Outdated Show resolved Hide resolved
ports/poppler/0005-remove-CMAKE_CXX_STANDARD.patch Outdated Show resolved Hide resolved
ports/poppler/portfile.cmake Outdated Show resolved Hide resolved
ports/poppler/portfile.cmake Outdated Show resolved Hide resolved
ports/poppler/portfile.cmake Outdated Show resolved Hide resolved
ports/poppler/vcpkg.json Outdated Show resolved Hide resolved
ports/poppler/vcpkg.json Outdated Show resolved Hide resolved
@NancyLi1013 NancyLi1013 added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Dec 17, 2020
ports/poppler/vcpkg.json Outdated Show resolved Hide resolved
@NancyLi1013
Copy link
Contributor

Hi @playgithub

Could you please sign CLA first?

@NancyLi1013 NancyLi1013 changed the title add port for poppler [poppler] Add new port Dec 17, 2020
@playgithub
Copy link
Contributor Author

Could you please sign CLA first?

Done

@playgithub playgithub closed this Dec 17, 2020
@playgithub playgithub reopened this Dec 17, 2020
@NancyLi1013
Copy link
Contributor

Could you please look into the failures on x64-linux?

something like this:

FAILED: test/pdf-fullrewrite 
: && /usr/bin/c++ -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wcast-align -Wformat-security -Wframe-larger-than=65536 -Wlogical-op -Wmissing-format-attribute -Wnon-virtual-dtor -Woverloaded-virtual -Wmissing-declarations -Wundef -Wzero-as-null-pointer-constant -Wshadow -Wsuggest-override -fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE -g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline -fPIC -Wl,--as-needed   -rdynamic test/CMakeFiles/pdf-fullrewrite.dir/pdf-fullrewrite.cc.o test/CMakeFiles/pdf-fullrewrite.dir/__/utils/parseargs.cc.o -o test/pdf-fullrewrite -L/mnt/vcpkg-ci/buildtrees/poppler/x64-linux-dbg   -L/mnt/vcpkg-ci/installed/x64-linux/debug/lib libpoppler.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libfreetyped.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libfontconfig.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libjpeg.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libopenjp2.a  -lpthread  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libpng16d.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libtiffd.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libz.a  -lm  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/liblzmad.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libjpeg.a  -pthread && :
/mnt/vcpkg-ci/installed/x64-linux/debug/lib/libfontconfig.a(fcfreetype.o): In function `FcGetPixelSize':
/mnt/vcpkg-ci/buildtrees/fontconfig/x64-linux-dbg/src/fcfreetype.c:1095: undefined reference to `FT_Get_BDF_Property'
/mnt/vcpkg-ci/installed/x64-linux/debug/lib/libfontconfig.a(fcfreetype.o): In function `FcFreeTypeGetFirstName':
/mnt/vcpkg-ci/buildtrees/fontconfig/x64-linux-dbg/src/fcfreetype.c:1177: undefined reference to `FT_Get_Sfnt_Name'
/mnt/vcpkg-ci/installed/x64-linux/debug/lib/libfontconfig.a(fcfreetype.o): In function `FcFreeTypeQueryFaceInternal':
/mnt/vcpkg-ci/buildtrees/fontconfig/x64-linux-dbg/src/fcfreetype.c:1283: undefined reference to `FT_Get_MM_Var'
/mnt/vcpkg-ci/buildtrees/fontconfig/x64-linux-dbg/src/fcfreetype.c:1382: undefined reference to `FT_Get_Sfnt_Table'
/mnt/vcpkg-ci/buildtrees/fontconfig/x64-linux-dbg/src/fcfreetype.c:1410: undefined reference to `FT_Get_Sfnt_Name_Count'
/mnt/vcpkg-ci/buildtrees/fontconfig/x64-linux-dbg/src/fcfreetype.c:1423: undefined reference to `FT_Get_Sfnt_Name'
/mnt/vcpkg-ci/buildtrees/fontconfig/x64-linux-dbg/src/fcfreetype.c:1595: undefined reference to `FT_Get_Sfnt_Name'
/mnt/vcpkg-ci/buildtrees/fontconfig/x64-linux-dbg/src/fcfreetype.c:1660: undefined reference to `FT_Get_Postscript_Name'
/mnt/vcpkg-ci/buildtrees/fontconfig/x64-linux-dbg/src/fcfreetype.c:1728: undefined reference to `FT_Get_Sfnt_Table'
/mnt/vcpkg-ci/buildtrees/fontconfig/x64-linux-dbg/src/fcfreetype.c:1840: undefined reference to `FT_Get_PS_Font_Info'
/mnt/vcpkg-ci/buildtrees/fontconfig/x64-linux-dbg/src/fcfreetype.c:1875: undefined reference to `FT_Get_BDF_Property'
FAILED: test/perf-test 
: && /usr/bin/c++ -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wcast-align -Wformat-security -Wframe-larger-than=65536 -Wlogical-op -Wmissing-format-attribute -Wnon-virtual-dtor -Woverloaded-virtual -Wmissing-declarations -Wundef -Wzero-as-null-pointer-constant -Wshadow -Wsuggest-override -fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE -g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline -fPIC -Wl,--as-needed   -rdynamic test/CMakeFiles/perf-test.dir/perf-test.cc.o test/CMakeFiles/perf-test.dir/perf-test-preview-dummy.cc.o -o test/perf-test -L/mnt/vcpkg-ci/buildtrees/poppler/x64-linux-dbg   -L/mnt/vcpkg-ci/installed/x64-linux/debug/lib libpoppler.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libfreetyped.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libfontconfig.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libjpeg.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libopenjp2.a  -lpthread  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libpng16d.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libtiffd.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libz.a  -lm  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/liblzmad.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libjpeg.a  -pthread && :
/mnt/vcpkg-ci/installed/x64-linux/debug/lib/libfreetyped.a(sfnt.c.o): In function `woff2_decompress':
/mnt/vcpkg-ci/buildtrees/freetype/src/cf45089bd8-41dc4963c4.clean/src/sfnt/sfwoff2.c:325: undefined reference to `BrotliDecoderDecompress'
/mnt/vcpkg-ci/installed/x64-linux/debug/lib/libfreetyped.a(ftbzip2.c.o): In function `ft_bzip2_file_init':
/mnt/vcpkg-ci/buildtrees/freetype/src/cf45089bd8-41dc4963c4.clean/src/bzip2/ftbzip2.c:178: undefined reference to `BZ2_bzDecompressInit'
/mnt/vcpkg-ci/installed/x64-linux/debug/lib/libfreetyped.a(ftbzip2.c.o): In function `ft_bzip2_file_done':
/mnt/vcpkg-ci/buildtrees/freetype/src/cf45089bd8-41dc4963c4.clean/src/bzip2/ftbzip2.c:193: undefined reference to `BZ2_bzDecompressEnd'

Please see the details from install-x64-linux-dbg-out.log here https://dev.azure.com/vcpkg/public/_build/results?buildId=46646&view=artifacts&pathAsName=false&type=publishedArtifacts.

@playgithub
Copy link
Contributor Author

playgithub commented Dec 17, 2020

Could you please look into the failures on x64-linux?

I have no machine running Linux now.
I searched on the web, it might be about version incompatibility.
Add "supports": "!linux" in vcpkg.json as a workaround.

@NancyLi1013
Copy link
Contributor

Since the failures are from test modules. You can disable test to support Linux.

https://github.com/freedesktop/poppler/blob/master/CMakeLists.txt#L753

Would you like to try this? @playgithub

@playgithub
Copy link
Contributor Author

For commit 965ed9d, the github checks blocks for more than 10 hours.

@playgithub
Copy link
Contributor Author

playgithub commented Dec 20, 2020

@vicroms @BillyONeal

The other thing I would like to confirm is whether all the listed dependencies are actually required or if there are some optional dependencies that could be disabled to reduce the build time.

vcpkg.json has been refined based on testing. It is clueless to refine vcpkg.json based on CMakeLists.txt, because some platform specific required lib names can not be found in it directly, for example devil. Any easy way?

From a clean install:

Computing installation plan...
The following packages will be built and installed:
  * brotli[core]:x86-windows -> 1.0.9
  * bzip2[core]:x86-windows -> 1.0.8#1
  * cairo[core]:x86-windows -> 1.16.0#8
  * devil[core,jasper,lcms,libjpeg,libpng,openexr,tiff]:x86-windows -> 1.8.0#7
  * dirent[core]:x86-windows -> 1.23.2
  * expat[core]:x86-windows -> 2020-08-18
  * fontconfig[core]:x86-windows -> 2.13.1#2
  * freeglut[core]:x86-windows -> 3.2.1-4
  * freetype[brotli,bzip2,core,png,zlib]:x86-windows -> 2.10.2#6
  * gettext[core]:x86-windows -> 0.21
  * jasper[core]:x86-windows -> 2.0.20
  * json-c[core]:x86-windows -> 2019-09-10#1
  * lcms[core]:x86-windows -> 2.11
  * libiconv[core]:x86-windows -> 1.16#6
  * libjpeg-turbo[core]:x86-windows -> 2.0.5#1
  * liblzma[core]:x86-windows -> 5.2.5#2
  * libpng[core]:x86-windows -> 1.6.37#14
  * openexr[core]:x86-windows -> 2.5.0#2
  * opengl[core]:x86-windows -> 0.0#8
  * openjpeg[core]:x86-windows -> 2.3.1#2
  * pixman[core]:x86-windows -> 0.38.4#2
    poppler[core]:x86-windows -> 20.12.1
  * pthread[core]:x86-windows -> 3.0.0
  * pthreads[core]:x86-windows -> 3.0.0-6
  * rapidjson[core]:x86-windows -> 2020-09-14
  * tiff[core]:x86-windows -> 4.1.0
  * zlib[core]:x86-windows -> 1.2.11#9

Anyway to see the list in vcpkg which has installed a lot of libs?

@playgithub
Copy link
Contributor Author

playgithub commented Dec 21, 2020

@vicroms

Remove this feature, CXX_STANDARD should be controllable via toolchain (or triplet).

When building using the triplet below for C++17

x64-windows-cpp17.cmake

set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_CXX_FLAGS "/std:c++17")
set(VCPKG_C_FLAGS "/std:c17")

By far I encountered 2 problems:

I'm not sure if using a triplet to build in C++17 is an efficient way, because I have to pause my job until it is solved.

"name": "devil",
"platform": "(windows | linux) & !arm"
},
"fontconfig",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WITH_FONTCONFIGURATION_FONTCONFIG is true when while "platform": "!(windows | android)"

ports/poppler/vcpkg.json Show resolved Hide resolved
"platform": "!(windows | android)"
},
"freetype",
"libiconv",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also an optional dependency. iconv is only required in cpp module, which might be considered to add a feature.

https://github.com/freedesktop/poppler/blob/master/CMakeLists.txt#L230

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For C++ ENABLE_CPP is always true.

"platform": "osx"
},
{
"name": "devil",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see any places used devil in source codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but without devil it failed to pass checks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might need to figure out where and how it is used in this port.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked the include files, no devil.

ports/poppler/vcpkg.json Show resolved Hide resolved
@NancyLi1013
Copy link
Contributor

@vicroms

Could you please help review this PR again?

Thanks.

@NancyLi1013
Copy link
Contributor

I'm not sure if the dependency lists are suitable. So I add discussion label for this PR. Please help check this point again @vicroms and @BillyONeal.

@vicroms vicroms merged commit 63de431 into microsoft:master Jan 4, 2021
@vicroms
Copy link
Member

vicroms commented Jan 4, 2021

Thanks for the PR @playgithub

Jimmy-Hu added a commit to Jimmy-Hu/vcpkg that referenced this pull request Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants