Bug 241772

Summary: graphics/gdal will not compile with poppler 0.82 after update
Product: Ports & Packages Reporter: russo
Component: Individual Port(s)Assignee: Po-Chuan Hsieh <sunpoet>
Status: Closed FIXED    
Severity: Affects Only Me CC: tcberner
Priority: --- Flags: bugzilla: maintainer-feedback? (sunpoet)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch combining two upstream fixes to GDAL to allow it to compile with poppler 0.82 none

Description russo 2019-11-07 05:19:01 UTC
Created attachment 208931 [details]
Patch combining two upstream fixes to GDAL to allow it to compile with poppler 0.82

Poppler was updated a few days ago to 0.82.0, after which gdal from ports (version 2.4.2_3) will not compile with poppler support enabled.  The specific issue is a compilation error about two functions in pdfdataset.cpp being declared "override" but not overriding any base class function.

Turns out this issue was addressed in GDAL's development branch specifically to allow it to compile with poppler 0.82.0, and these fixes were also back-ported to the 3.0 release branch, but the fix has not been backported to the branch associated with the 2.4 version present in FreeBSD ports.  Neither has it been back-ported to 2.5.  But the fixes are simple, are easy to find in github, are still applicable to 2.4, and are easy to apply as a patch in the ports tree.

Commits 20c3fc7c and 94dacee in the GDAL project github repo point to the patches needed to restore function in the FreeBSD port.  I have combined these into the attached patch, which simply adds a const keyword in two places if and only if poppler of a late enough version is being used.  Dropping this file into the files directory of the gdal port restores the ability to build with poppler.

Direct links to GDAL git commits that I combined to create this patch:
https://github.com/OSGeo/gdal/commit/20c3fc7cb4a4ec2a67642bd83ddb6e403488b0fe#diff-8c78bb6eb3e70f1b6d945c04a8f5888b
https://github.com/OSGeo/gdal/commit/94daceefebd464858888ddc85170c1a8c4bd50d7#diff-8c78bb6eb3e70f1b6d945c04a8f5888b
Comment 1 Tobias C. Berner freebsd_committer freebsd_triage 2019-11-07 05:44:44 UTC
Non-Default options unfortunately do not get tested, so we did not catch that.

Thanks for the fix.
Comment 2 commit-hook freebsd_committer freebsd_triage 2019-11-07 05:44:47 UTC
A commit references this bug:

Author: tcberner
Date: Thu Nov  7 05:44:09 UTC 2019
New revision: 516938
URL: https://svnweb.freebsd.org/changeset/ports/516938

Log:
  graphics/gdal: fix build of poppler option after poppler-0.82

  PR:		241772
  Submitted by:	russo@bogodyn.org

Changes:
  head/graphics/gdal/files/patch-frmts-pdf-pdfdataset.cpp