pdfalto icon indicating copy to clipboard operation
pdfalto copied to clipboard

Use provided xpdf_objs library and disable default targets in xpdf

Open naufraghi opened this issue 3 years ago • 6 comments

This should allow the usage of a plain xpdf mirror, without the need of touching the CMakeLists.txt file.

https://cmake.org/cmake/help/latest/command/add_subdirectory.html#command:add_subdirectory

add_subdirectory(source_dir [binary_dir] [EXCLUDE_FROM_ALL])
  • Use automatic xpdf mirror repo
    • https://gitlab.com/xpdf-mirror/xpdf
  • Add build/ and install/ to gitignore
  • Upgrade osx_image to the current default (9.4)
    • the version 8.3 is deprecated
  • Upgrade cmake to version 3.12.*
    • this allows the usage of the OBJECT library inside a target_link_libraries()
  • Add PATH to use the updated cmake
  • Patch xpdf mirror
    • make Qt optional
    • disable fontconfig
  • Add missing codeToGID argument to XmlAltoOutputDev::getSplashFont()

Closes #99

naufraghi avatar Jul 20 '20 15:07 naufraghi

This code (or a very similar one) works locally with cmake 3.13.4, the restrictions seems to be relaxed with https://gitlab.kitware.com/cmake/cmake/commit/3e774ad78c49cde1f47e1d7285bffef622859d64 that seems to be supported in the release 3.12

naufraghi avatar Jul 21 '20 16:07 naufraghi

Regarding the Add missing codeToGID argument to XmlAltoOutputDev::getSplashFont() I used the already present codeToGID variable, but I have not investigated any further after obtaining a successful build.

cc @kermitt2 or @lfoppiano for a mode detailed review.

naufraghi avatar Jul 27 '20 08:07 naufraghi

Rebased on the current master

naufraghi avatar Oct 21 '20 06:10 naufraghi

Hi @naufraghi !

First I am very sorry to be so slow to react to your PR... it seems that I have some difficulties to work more than 2-3 days per year on pdfalto :D Thank you very much for the PR and all the improvements it brings.

In between I prepared another mirror for xpdf-4.03 containing additional patch for supporting xpdf language packages with relative paths -> https://github.com/kermitt2/xpdf-4.03 (I think that there were anyway a bit more patch changes to the official xpdf than what you included)

From there I will use this mirror first and then include your PR changes manually with this new mirror version. I am also going to check the codeToGID thingy !

kermitt2 avatar Apr 07 '21 18:04 kermitt2

Update to xpdf-4.03 was actually a bit complicated: new usage of fontconfig (if detected), updated form classes, and the codeToGID parameter required non-trivial specific init (https://github.com/kermitt2/pdfalto/commit/96bec4396819b3716bd4c4e2789a5109ccdcde9f#diff-4a663af7fcefc0e10a654736ff3a8d6184763165c567b28be0321b38167c639b)

Normally everything is good now.

I have not yet updated to cmake version 3.12

kermitt2 avatar Apr 07 '21 21:04 kermitt2

Thanks @kermitt2 , let me know if you'd like a minimal PR extracted from this one

naufraghi avatar Apr 08 '21 07:04 naufraghi