Prechádzať zdrojové kódy

package/fluent-bit: build fix for toolchains w/o CXX

Since the package bump [1] the fluent-bit package started to fail
because of an update introduced in fluent-bit v3.2.7 (see [2]).

The following error appeared on the autobuilder in the LTS branch.

```
CMake Error at /home/buildroot/instance-0/output-1/host/share/cmake-3.31/Modules/CMakeTestCXXCompiler.cmake:73 (message):
  The C++ compiler

    "/bin/false"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/home/buildroot/instance-0/output-1/build/fluent-bit-3.2.10/CMakeFiles/CMakeScratch/TryCompile-u4rLgc'

    Run Build Command(s): /home/buildroot/instance-0/output-1/host/bin/ninja -v cmTC_71bbf
    [1/2] /bin/false    -o CMakeFiles/cmTC_71bbf.dir/testCXXCompiler.cxx.o -c /home/buildroot/instance-0/output-1/build/fluent-bit-3.2.10/CMakeFiles/CMakeScratch/TryCompile-u4rLgc/testCXXCompiler.cxx
    FAILED: CMakeFiles/cmTC_71bbf.dir/testCXXCompiler.cxx.o
    /bin/false    -o CMakeFiles/cmTC_71bbf.dir/testCXXCompiler.cxx.o -c /home/buildroot/instance-0/output-1/build/fluent-bit-3.2.10/CMakeFiles/CMakeScratch/TryCompile-u4rLgc/testCXXCompiler.cxx
    ninja: build stopped: subcommand failed.

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  lib/zstd-1.5.7/build/cmake/CMakeLists.txt:36 (project)
```

The commit [3] included two patches to fix the build error
for configs using toolchains without CXX.

Since the build error was already present on v3.2.10,
those patches actually fix the error for LTS version as well.
This patch pick them from the series to apply them on the LTS
branch.

[1] 8bc18fad29 package/fluent-bit: bump to 3.2.10
[2] https://github.com/fluent/fluent-bit/commit/0ce59cecdc3c3f8053bebe9d5d9ef7b30fc6c4e6
[3] 8181727e23 package/fluent-bit: bump to 4.0.0

Fixes: https://autobuild.buildroot.org/results/4b0/4b0646e8fcc3f023ab0173ea8725f381e5055152/

Signed-off-by: Thomas Perale <thomas.perale@mind.be>
Thomas Perale via buildroot 1 mesiac pred
rodič
commit
430b2c3fb9

+ 34 - 0
package/fluent-bit/0006-lib-zstd-only-enable-CXX-support-if-tests-are-requir.patch

@@ -0,0 +1,34 @@
+From b6d898185d441e00acad867c0c80aadf4d7b0d37 Mon Sep 17 00:00:00 2001
+From: Thomas Devoogdt <thomas@devoogdt.com>
+Date: Tue, 1 Apr 2025 22:43:30 +0200
+Subject: [PATCH] lib: zstd: only enable CXX support if tests are required
+
+Upstream: https://github.com/facebook/zstd/pull/4357/files
+Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
+---
+ lib/zstd-1.5.7/build/cmake/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/zstd-1.5.7/build/cmake/CMakeLists.txt b/lib/zstd-1.5.7/build/cmake/CMakeLists.txt
+index 347d41c0f..70e233df3 100644
+--- a/lib/zstd-1.5.7/build/cmake/CMakeLists.txt
++++ b/lib/zstd-1.5.7/build/cmake/CMakeLists.txt
+@@ -37,7 +37,6 @@ project(zstd
+   VERSION "${ZSTD_FULL_VERSION}"
+   LANGUAGES C   # Main library is in C
+             ASM # And ASM
+-            CXX # Testing contributed code also utilizes CXX
+   )
+ 
+ message(STATUS "ZSTD VERSION: ${zstd_VERSION}")
+@@ -170,6 +169,7 @@ if (ZSTD_BUILD_PROGRAMS)
+ endif ()
+ 
+ if (ZSTD_BUILD_TESTS)
++    enable_language(CXX)
+     enable_testing()
+     if (NOT ZSTD_BUILD_STATIC)
+         message(SEND_ERROR "You need to build static library to build tests")
+-- 
+2.43.0
+

+ 27 - 0
package/fluent-bit/0007-lib-miniz-only-require-a-C-compiler.patch

@@ -0,0 +1,27 @@
+From 3732cea4bb3dd9b79732da7bfbf60258bc418195 Mon Sep 17 00:00:00 2001
+From: Thomas Devoogdt <thomas@devoogdt.com>
+Date: Tue, 1 Apr 2025 23:01:13 +0200
+Subject: [PATCH] lib: miniz: only require a C compiler
+
+Upstream: https://github.com/richgel999/miniz/pull/338
+Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
+---
+ lib/miniz/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/miniz/CMakeLists.txt b/lib/miniz/CMakeLists.txt
+index ce6ade1c0..91012b36a 100644
+--- a/lib/miniz/CMakeLists.txt
++++ b/lib/miniz/CMakeLists.txt
+@@ -7,7 +7,7 @@ if(DEFINED PROJECT_NAME)
+ endif()
+ 
+ if(CMAKE_MINOR_VERSION LESS 12)
+-  project(miniz)
++  project(miniz C)
+   # see issue https://gitlab.kitware.com/cmake/cmake/merge_requests/1799
+ else()
+   project(miniz C)
+-- 
+2.43.0
+