Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936486 - dev-qt/qtlocation-5.15.14-r1: fails to build with libc++ (error: no template named 'unary_function' in namespace 'std')
Summary: dev-qt/qtlocation-5.15.14-r1: fails to build with libc++ (error: no template ...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords: PATCH, PMASKED
Depends on:
Blocks:
 
Reported: 2024-07-22 11:37 UTC by Sandi (Sandy) Vujaković
Modified: 2025-06-03 20:57 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge log (file_936486.txt,311.01 KB, text/plain)
2024-07-22 11:37 UTC, Sandi (Sandy) Vujaković
Details
emerge --info (file_936486.txt,15.46 KB, text/plain)
2024-07-22 12:01 UTC, Sandi (Sandy) Vujaković
Details
Patches for old boost code (fixes.patch,3.33 KB, patch)
2025-01-16 21:44 UTC, Davide Palma
Details | Diff
Fixing another issue (enums2.patch,902 bytes, patch)
2025-01-16 22:01 UTC, Davide Palma
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sandi (Sandy) Vujaković 2024-07-22 11:37:33 UTC
Created attachment 898105 [details]
emerge log

`std::unary_function` is used in QtLocation's bundled copy of Boost, which leads to the following error in multiple files:
```
/var/tmp/portage/dev-qt/qtlocation-5.15.14-r1/work/qtlocation-everywhere-src-5.15.14/src/3rdparty/mapbox-gl-native/deps/boost/1.65.1/include/boost/functional/hash/hash.hpp:74:33: error: no template named
      'unary_function' in namespace 'std'; did you mean '__unary_function'?
   74 |         struct hash_base : std::unary_function<T, std::size_t> {};
      |                            ~~~~~^~~~~~~~~~~~~~
      |                                 __unary_function
```

It seems that the following needs to be applied to the bundled copy of Boost: https://github.com/boostorg/functional/commit/281e11b2923249869cce3131a415118bb9e2f1e1
Comment 1 Sandi (Sandy) Vujaković 2024-07-22 12:01:40 UTC
Created attachment 898106 [details]
emerge --info
Comment 2 Davide Palma 2025-01-14 12:00:24 UTC
Having the same issue
Comment 3 Davide Palma 2025-01-16 21:44:14 UTC
Created attachment 916781 [details, diff]
Patches for old boost code

Seems to fix the issues.
Comment 4 Davide Palma 2025-01-16 22:00:21 UTC
After getting issue 895516 , I get:
/var/tmp/portage/dev-qt/qtlocation-5.15.16-r1/work/qtlocation-everywhere-src-5.15.16/src/3rdparty/mapbox-gl-native/src/mbgl/layout/symbol_projection.cpp:98:95: error: 
      non-constant-expression cannot be narrowed from type 'value_type' (aka 'double') to 'float' in initializer list [-Wc++11-narrowing-const-reference]
   98 |         return {{ static_cast<float>(pos[0] / pos[3]), static_cast<float>(pos[1] / pos[3]) }, pos[3] };

Nothing that a static_cast can't solve, after the patch below I can finally emerge this package.
Comment 5 Davide Palma 2025-01-16 22:01:55 UTC
Created attachment 916782 [details, diff]
Fixing another issue