Bug 263454 - graphics/cairo: Fix build with upcoming autoconf 2.71
Summary: graphics/cairo: Fix build with upcoming autoconf 2.71
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-desktop (Team)
Depends on:
Blocks: 258046
  Show dependency treegraph
Reported: 2022-04-21 15:18 UTC by Yasuhiro Kimura
Modified: 2022-05-27 10:14 UTC (History)
2 users (show)

See Also:
tcberner: maintainer-feedback+

Patch file (759 bytes, patch)
2022-04-21 15:18 UTC, Yasuhiro Kimura
no flags Details | Diff
Updated patch file (683 bytes, patch)
2022-04-21 16:31 UTC, Yasuhiro Kimura
no flags Details | Diff
Updated patch file (1.64 KB, patch)
2022-04-21 23:17 UTC, Yasuhiro Kimura
no flags Details | Diff
patch4 (8.64 KB, patch)
2022-05-05 12:31 UTC, Tijl Coosemans
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yasuhiro Kimura freebsd_committer 2022-04-21 15:18:09 UTC
Created attachment 233378 [details]
Patch file

Fix build with upcoming autoconf 2.71.
Comment 1 Tobias C. Berner freebsd_committer 2022-04-21 16:09:49 UTC
Moin moin 

Why is this not only required for the DOCS option?

mfg Tobias
Comment 2 Yasuhiro Kimura freebsd_committer 2022-04-21 16:31:20 UTC
Created attachment 233381 [details]
Updated patch file

Add textproc/gtk-doc to BUILD_DEPENDS only if DOCS option is enabled.
Comment 3 Yasuhiro Kimura freebsd_committer 2022-04-21 16:31:56 UTC
(In reply to Tobias C. Berner from comment #1)

Oops, I overlooked it. Thanks for pointing out.
Comment 4 Tobias C. Berner freebsd_committer 2022-04-21 16:36:39 UTC
Comment 5 Tijl Coosemans freebsd_committer 2022-04-21 19:57:06 UTC
I think you'll have to patch out GTK_DOC_CHECK from configure.ac in a post-patch-DOCS-off target or something if you want to make the dependency optional.  I see that several post-patch commands touch configure and Makefile.in which doesn't make sense when using autoreconf because the changes are lost when these files are regenerated.
Comment 6 Yasuhiro Kimura freebsd_committer 2022-04-21 23:17:24 UTC
Created attachment 233384 [details]
Updated patch file

(In reply to Tijl Coosemans from comment #5)

Remove post-patch-DOCS-off target and most of oparations in post-patch target.

Though I don't know why these oparations are (or were?) necessary, I understand the results are overwrote when autoreconf is invoked at configure phase. So if this port works fine now, we can safely remove them. Right?
Comment 7 Tijl Coosemans freebsd_committer 2022-05-05 12:31:16 UTC
Created attachment 233744 [details]

I believe this addresses all the issues with patching.  The post-patch commands that are still useful have been converted to real patches.

Old patches have been removed:
- patch-perf_cairo-perf-micro.c and patch-test_Makefile.am
These were added to fix build after the addition of USES=autoreconf broke post-patch commands that disabled the perf and test directories.
- patch-src_cairo-gl.h
No idea why this exists.  make test (if you enable it) checks that there's no #if defined in the headers so I think it's best to remove it.
- patch-src_cairo-xlib-display.c
Old patch from Arch Linux that they have removed in 2012.
- patch-util_cairo-sphinx_sphinx.c
The code defines MAP_NORESERVE to zero now if it's undefined.

This has been build tested with autoconf 2.69 and 2.71, but I think it would be best to do an exp-run before committing this, so I'll include it in the autoconf exp-run.
Comment 8 commit-hook freebsd_committer 2022-05-27 09:56:28 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6fd90bd6606b1a8f648cf807b2f959e037505c66

commit 6fd90bd6606b1a8f648cf807b2f959e037505c66
Author:     Tijl Coosemans <tijl@FreeBSD.org>
AuthorDate: 2022-05-04 14:29:21 +0000
Commit:     Tijl Coosemans <tijl@FreeBSD.org>
CommitDate: 2022-05-27 09:11:04 +0000

    graphics/cairo: prepare for autoconf 2.71

    - configure.ac contains GTK_DOC_CHECK and the new autoreconf runs
      gtkdocize in that case so add a build dependency.
    - fix post-patch commands that patch files which are regenerated by
    - remove old patches while here.

    PR:             263454

 graphics/cairo/Makefile                            | 28 +++++++--------------
 graphics/cairo/files/patch-Makefile.am (new)       | 10 ++++++++
 .../files/patch-build_configure.ac.system (new)    | 17 +++++++++++++
 graphics/cairo/files/patch-configure.ac (new)      | 11 ++++++++
 .../files/patch-perf_cairo-perf-micro.c (gone)     | 10 --------
 graphics/cairo/files/patch-src_cairo-gl.h (gone)   | 29 ----------------------
 .../files/patch-src_cairo-xlib-display.c (gone)    | 14 -----------
 graphics/cairo/files/patch-test_Makefile.am (gone) | 14 -----------
 .../files/patch-util_cairo-sphinx_sphinx.c (gone)  | 11 --------
 9 files changed, 47 insertions(+), 97 deletions(-)