Bug 272673 - print/scribus-devel: clang 16.0.6: scribus/desaxe/digester.cpp: std::unary_function => std::__unary_function
Summary: print/scribus-devel: clang 16.0.6: scribus/desaxe/digester.cpp: std::unary_fu...
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: Piotr Kubaj
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-23 09:10 UTC by Trond Endrestøl
Modified: 2023-08-22 22:39 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (pkubaj)


Attachments
Patch for scribus/desaxe/digester.cpp (516 bytes, patch)
2023-07-23 09:10 UTC, Trond Endrestøl
no flags Details | Diff
Updated patch for scribus/desaxe/digester.cpp handling ISO C++ 2017 and newer and older standards (586 bytes, patch)
2023-07-31 21:17 UTC, Trond Endrestøl
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Trond Endrestøl 2023-07-23 09:10:06 UTC
Created attachment 243562 [details]
Patch for scribus/desaxe/digester.cpp

Clang 16.0.6 in recent current isn't forgiving at all.
std::__unary_function must replace std::unary_function in scribus/desaxe/digester.cpp.
Comment 1 commit-hook freebsd_committer freebsd_triage 2023-07-26 17:24:40 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0df1ef7cd883e13c0b9983150913208e4a05db40

commit 0df1ef7cd883e13c0b9983150913208e4a05db40
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2023-07-26 17:20:50 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2023-07-26 17:23:41 +0000

    print/scribus-devel: fix build with llvm16

    PR:     272673

 .../files/patch-scribus_desaxe_digester.cpp (new)             | 11 +++++++++++
 1 file changed, 11 insertions(+)
Comment 2 Vladimir Druzenko freebsd_committer freebsd_triage 2023-07-30 12:11:57 UTC
(In reply to Trond Endrestøl from comment #0)
> Clang 16.0.6 in recent current isn't forgiving at all.
> std::__unary_function must replace std::unary_function in scribus/desaxe/digester.cpp.

And break build on 13 and 12:

/usr/ports/print/scribus-devel/work/scribus-1.5.8/scribus/desaxe/digester.cpp:451:37: error: no template named '__unary_function' in namespace 'std'; did you mean 'unary_function'?
struct CreateDFAState : public std::__unary_function <std::set<nfa_state_t>, dfa_state_t> {
                               ~~~~~^~~~~~~~~~~~~~~~
                                    unary_function
/usr/include/c++/v1/__functional/unary_function.h:21:29: note: 'unary_function' declared here
struct _LIBCPP_TEMPLATE_VIS unary_function
                            ^
1 error generated.

Workaround:
rm /usr/ports/print/scribus-devel/files/patch-scribus_desaxe_digester.cpp
Comment 3 Trond Endrestøl 2023-07-30 14:01:22 UTC
(In reply to Vladimir Druzenko from comment #2)
Instead of my patch we could try enforcing the C++ standard expected by the source code.
E.g. USE_CXXSTD=	c++11
Comment 4 Trond Endrestøl 2023-07-30 14:02:10 UTC
Sorry.
Comment 5 Vladimir Druzenko freebsd_committer freebsd_triage 2023-07-30 14:22:58 UTC
I don't have 14 to test. Only 12 and 13.
IMHO, revert this commit and create other:
> USE_CXXSTD=	c++11
or enough:
> USES=	compiler:c++11-lang
with testing build on all supported platforms before commit: 12.4, 13.2, 14.
13.1 will EOL tomorrow - can ignore it.
Comment 6 Vladimir Druzenko freebsd_committer freebsd_triage 2023-07-30 14:30:29 UTC
Maybe this need fix too:
CMAKE_ARGS+=    -DWANT_HUNSPELL=YES \
                -DWANT_CPP17=YES \
Comment 7 Trond Endrestøl 2023-07-31 21:17:23 UTC
Created attachment 243755 [details]
Updated patch for scribus/desaxe/digester.cpp handling ISO C++ 2017 and newer and older standards
Comment 8 Trond Endrestøl 2023-07-31 21:21:30 UTC
(In reply to Trond Endrestøl from comment #7)
Let me know if we need to refine the patch further. Poppler and CMake insists on using ISO C++ 2017. Playing with USE_CXXSTD got me nowhere as CMake placed -std=c++17 towards the end of every command line.
Comment 9 commit-hook freebsd_committer freebsd_triage 2023-08-03 16:49:05 UTC
A commit in branch main references this bug:

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

commit fa869802d0318071f8e48f22579a7a3d777c1189
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2023-08-03 16:46:45 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2023-08-03 16:48:02 +0000

    print/scribus-devel: update patch for 14 to fix build on 12 and 13

    PR:     272673
    Submitted by:   Trond Endrestøl

 print/scribus-devel/files/patch-scribus_desaxe_digester.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
Comment 10 Vladimir Druzenko freebsd_committer freebsd_triage 2023-08-22 22:39:04 UTC
Tested build on 13.2 amd64.
I think we can close this.