Skip to content

Commit

Permalink
testing/horizon: fix ftbfs
Browse files Browse the repository at this point in the history
Due to `-Werror`, this fails to build on gcc >= 10.0.1. This has been
[reported][0] to json upstream, and fixed in this [pr][1].

Backport the fix to horizon

[0]:nlohmann/json#1939
[1]:nlohmann/json#2144
  • Loading branch information
Ikke committed Jan 18, 2021
1 parent 98a9ddd commit c2868da
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
7 changes: 5 additions & 2 deletions testing/horizon/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ makedepends="bcnm-dev boost-dev cmake curl-dev eudev-dev libarchive-dev
linux-headers parted-dev skalibs-dev util-linux-dev libxkbfile-dev"
subpackages="$pkgname-image $pkgname-dbg $pkgname-dev $pkgname-doc
$pkgname-tools"
source="https://code.foxkit.us/adelie/horizon/-/archive/$pkgver/horizon-$pkgver.tar.gz"
source="https://code.foxkit.us/adelie/horizon/-/archive/$pkgver/horizon-$pkgver.tar.gz
json-cast-character-to-unsigned-for-comparrison.patch
"

build() {
if [ "$CBUILD" != "$CHOST" ]; then
Expand Down Expand Up @@ -124,4 +126,5 @@ PROFILE
"$subpkgdir"/usr/share/xsessions/horizon.desktop
}

sha512sums="3ff46980387454f85a326ac3ea123b55cf16fc339faec48fdc77f10334e0bd93e8cf51e6adeed516d2e4309cf4426b9d1ac6760cdd479b196a5f4aa33c1f3a28 horizon-0.9.6.tar.gz"
sha512sums="3ff46980387454f85a326ac3ea123b55cf16fc339faec48fdc77f10334e0bd93e8cf51e6adeed516d2e4309cf4426b9d1ac6760cdd479b196a5f4aa33c1f3a28 horizon-0.9.6.tar.gz
5ab7a35d239210e031739c4149fd8e68570ea0efd278a2eac9330d6e30c601d1310b9c17523563a41424c2a8aa2452e5a9bcbce5d8087330d2697cd1b77b312f json-cast-character-to-unsigned-for-comparrison.patch"
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Description: GCC 10.0.1 started to warn on redundant comparisons. Horizon
builds with -Werror, so this warning is turned into an error. Upstream fixed this,
so backport to Horizon.

Based on https://github.com/nlohmann/json/pull/2144/commits/23051df2c71dd3f9698e01de3cbfab0034c6e50e

diff --git a/3rdparty/json.hpp b/3rdparty/json.hpp
index 06da815..58e3f27 100644
--- a/3rdparty/json.hpp
+++ b/3rdparty/json.hpp
@@ -8491,7 +8491,7 @@ scan_number_done:
std::string result;
for (const auto c : token_string)
{
- if ('\x00' <= c and c <= '\x1F')
+ if (static_cast<unsigned char>(c) <= '\x1F')
{
// escape control characters
std::array<char, 9> cs{{}};

0 comments on commit c2868da

Please sign in to comment.