Skip to content

Commit 65f5cf8

Browse files
authored
Merge pull request #11460 from heitbaum/qt5
qt5,rpi_ws281x,hyperion,hyperhdr: fix Qt5 cross-compilation build
2 parents 9f57a30 + 7700676 commit 65f5cf8

4 files changed

Lines changed: 105 additions & 6 deletions

File tree

packages/addons/addon-depends/qt5/package.mk

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
33

44
PKG_NAME="qt5"
5-
PKG_VERSION="5.15.18"
6-
PKG_SHA256="cea1fbabf02455f3f0e8eaa839f5d6f45cdb56b62c8a83af5c1d00ac05f912ea"
5+
PKG_VERSION="5.15.19"
6+
PKG_SHA256="173c2326dae138bbb0d98921e9d911e55c00163d93a6db29f294b5e19ff306ae"
77
PKG_LICENSE="LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only"
88
PKG_SITE="https://qt-project.org"
99
PKG_URL="https://download.qt.io/archive/qt/${PKG_VERSION%.*}/${PKG_VERSION}/single/qt-everywhere-opensource-src-${PKG_VERSION}.tar.xz"
@@ -12,8 +12,7 @@ PKG_LONGDESC="A cross-platform application and UI framework."
1212
PKG_BUILD_FLAGS="-sysroot"
1313

1414
PKG_CONFIGURE_OPTS_TARGET="-prefix /usr
15-
-sysroot "${SYSROOT_PREFIX}"
16-
-hostprefix "${TOOLCHAIN}"
15+
-hostprefix /usr/host
1716
-device linux-libreelec-g++
1817
-opensource -confirm-license
1918
-release
@@ -140,3 +139,7 @@ EOF
140139
unset CC CXX LD RANLIB AR AS CPPFLAGS CFLAGS LDFLAGS CXXFLAGS
141140
./configure ${PKG_CONFIGURE_OPTS_TARGET}
142141
}
142+
143+
makeinstall_target() {
144+
make install INSTALL_ROOT="${INSTALL}"
145+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
From ac77fbe9b43c7d5656b521735cc9ab3d3ccc8325 Mon Sep 17 00:00:00 2001
2+
From: Rudi Heitbaum <rudi@heitbaum.com>
3+
Date: Thu, 11 Jun 2026 20:48:08 +1000
4+
Subject: [PATCH] CMakeLists: rename version to VERSION to avoid shadowing
5+
C++20 <version>
6+
7+
Problem
8+
-------
9+
The file named `version` in the repository root contains the plain-text
10+
project version string ("1.1.0") and is read by CMakeLists.txt at
11+
configure time:
12+
13+
file(READ version PROJECT_VERSION)
14+
15+
When rpi_ws281x is used as a CMake subdirectory of a C++20 project, the
16+
subdirectory's source path is typically added to the compiler include
17+
search path so that the library headers (ws2811.h, rpihw.h, etc.) can be
18+
found with angle-bracket includes. On any compiler that implements C++20,
19+
the `<version>` feature-test header is part of the standard library. When
20+
a translation unit (directly, or through a transitively included header)
21+
does:
22+
23+
#include <version>
24+
25+
the preprocessor searches the include path in order. If the rpi_ws281x
26+
source directory appears on that path before the toolchain's system include
27+
directory, the compiler opens the plain-text `version` file instead of the
28+
C++20 standard library header. Attempting to parse "1.1.0" as C++ source
29+
is a hard error:
30+
31+
error: stray '.' in program
32+
33+
Fix
34+
---
35+
Rename `version` to `VERSION`. On Linux (and all other case-sensitive
36+
filesystems) `VERSION` and `version` are distinct names; the compiler
37+
looking for `<version>` will no longer find the version data file.
38+
39+
Update the single `file(READ ...)` call in CMakeLists.txt accordingly.
40+
No other file in this repository references the plain name `version` as a
41+
path: `version.h.in` and `version.py` are separate files with different
42+
names and are unaffected.
43+
44+
Impact
45+
------
46+
Behaviour is identical for all existing build methods (CMake, SCons). The
47+
only observable change is the filename on disk; the content and the
48+
PROJECT_VERSION variable it populates are unchanged.
49+
---
50+
CMakeLists.txt | 4 ++--
51+
version => VERSION | 0
52+
2 files changed, 2 insertions(+), 2 deletions(-)
53+
rename version => VERSION (100%)
54+
55+
diff --git a/CMakeLists.txt b/CMakeLists.txt
56+
index ba5dd90..19bb717 100644
57+
--- a/CMakeLists.txt
58+
+++ b/CMakeLists.txt
59+
@@ -1,7 +1,7 @@
60+
cmake_minimum_required(VERSION 3.0.0)
61+
62+
-# read and parse version file
63+
-file(READ version PROJECT_VERSION)
64+
+# read and parse VERSION file
65+
+file(READ VERSION PROJECT_VERSION)
66+
string(STRIP ${PROJECT_VERSION} PROJECT_VERSION)
67+
string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" VERSION_MAJOR ${PROJECT_VERSION})
68+
string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" VERSION_MINOR ${PROJECT_VERSION})
69+
diff --git a/VERSION b/VERSION
70+
new file mode 100644
71+
index 0000000..9084fa2
72+
--- /dev/null
73+
+++ b/VERSION
74+
@@ -0,0 +1 @@
75+
+1.1.0
76+
diff --git a/version b/version
77+
deleted file mode 100644
78+
index 9084fa2..0000000
79+
--- a/version
80+
+++ /dev/null
81+
@@ -1 +0,0 @@
82+
-1.1.0
83+
--
84+
2.53.0
85+

packages/addons/service/hyperhdr/package.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
PKG_NAME="hyperhdr"
55
PKG_VERSION="21.0.0.0"
66
PKG_SHA256="fde381b8ae701c93b57b23cfa95c56dcbbecee7e5e7b2cce5d8b5f97ed86a676"
7-
PKG_REV="1"
7+
PKG_REV="2"
88
PKG_LICENSE="MIT"
99
PKG_SITE="https://github.com/awawa-dev/HyperHDR"
1010
PKG_URL="https://github.com/awawa-dev/HyperHDR/archive/v${PKG_VERSION}.tar.gz"
@@ -49,6 +49,11 @@ PKG_CMAKE_OPTS_TARGET="-DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON \
4949
-Wno-dev"
5050

5151
pre_configure_target() {
52+
cat > "${PKG_BUILD}/toolchain-qt5.cmake" <<EOF
53+
include("${CMAKE_CONF}")
54+
list(APPEND CMAKE_FIND_ROOT_PATH "$(get_install_dir qt5)/usr")
55+
EOF
56+
PKG_CMAKE_OPTS_TARGET+=" -DCMAKE_TOOLCHAIN_FILE=${PKG_BUILD}/toolchain-qt5.cmake"
5257
pkg_flatbuffers_version=$(get_pkg_version flatbuffers)
5358
tar --strip-components=1 -xf "${SOURCES}/flatbuffers/flatbuffers-${pkg_flatbuffers_version}.tar.gz" -C "${PKG_BUILD}/external/flatbuffers"
5459
cp -a $(get_build_dir rpi_ws281x)/* ${PKG_BUILD}/external/rpi_ws281x

packages/addons/service/hyperion/package.mk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ PKG_NAME="hyperion"
55
PKG_VERSION="fb413cd7e8825ffc26925013f57ac93a774f12bc"
66
PKG_SHA256="fafa4eeddacb15a8fd96b0e69fac400faa735c6e1ccd78673c9d96b0ac84d7a3"
77
PKG_VERSION_DATE="2019-08-19"
8-
PKG_REV="1"
8+
PKG_REV="2"
99
PKG_ARCH="any"
1010
PKG_LICENSE="MIT"
1111
PKG_SITE="https://github.com/hyperion-project/hyperion"
@@ -53,6 +53,12 @@ pre_build_target() {
5353

5454
pre_configure_target() {
5555
echo "" >../cmake/FindGitVersion.cmake
56+
57+
cat > "${PKG_BUILD}/toolchain-qt5.cmake" <<EOF
58+
include("${CMAKE_CONF}")
59+
list(APPEND CMAKE_FIND_ROOT_PATH "$(get_install_dir qt5)/usr")
60+
EOF
61+
PKG_CMAKE_OPTS_TARGET+=" -DCMAKE_TOOLCHAIN_FILE=${PKG_BUILD}/toolchain-qt5.cmake"
5662
}
5763

5864
addon() {

0 commit comments

Comments
 (0)