From 1f253042a8653e56b1cc6ae0df2d896d38cd7ecb Mon Sep 17 00:00:00 2001 From: Alfred Persson Forsberg Date: Tue, 21 Jun 2022 22:50:33 +0000 Subject: kde-apps/filelight: fix build and running on musl Filelight has two issues with musl. One is a SIGSEGV regarding the sincos implementation and the other is S_BLKSIZE not being defined. *1: The SIGSEGV is resolved upstream and with this patch musl will just use the native sincos. *2: DEV_BSIZE is the exact same thing as S_BLKSIZE, so use that instead. The DEV_BSIZE issue is PR:ed upstreamed but there are issues with it since Windows does not have sys/param.h. https://invent.kde.org/utilities/filelight/-/merge_requests/42/ https://invent.kde.org/utilities/filelight/-/merge_requests/39/ Signed-off-by: Alfred Persson Forsberg squash Closes: https://github.com/gentoo/gentoo/pull/26029 Signed-off-by: Andreas Sturmlechner --- .../files/filelight-22.04.3-fix_sincos_impl.patch | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 kde-apps/filelight/files/filelight-22.04.3-fix_sincos_impl.patch (limited to 'kde-apps/filelight/files/filelight-22.04.3-fix_sincos_impl.patch') diff --git a/kde-apps/filelight/files/filelight-22.04.3-fix_sincos_impl.patch b/kde-apps/filelight/files/filelight-22.04.3-fix_sincos_impl.patch new file mode 100644 index 000000000000..1c33e0d2e234 --- /dev/null +++ b/kde-apps/filelight/files/filelight-22.04.3-fix_sincos_impl.patch @@ -0,0 +1,75 @@ +https://invent.kde.org/utilities/filelight/-/merge_requests/42 +https://invent.kde.org/utilities/filelight/-/commit/861afa5fb0d2a839d7e83f7df644952219b84a3c + +Instead of hardcoding knowledege about glibc versions, check for the +presence of sincos with CMake. + +Commit 93577e2a4927cf1640e8ac7153cd22ff54180bba wrongly added a +SINCOS_H_IMPLEMENTATION macro instead of making it a static inline +function or similar, so remove that as well. +--- + src/CMakeLists.txt | 6 ++++++ + src/radialMap/map.cpp | 1 - + src/radialMap/sincos.h | 10 ++-------- + 3 files changed, 8 insertions(+), 9 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 5634ff9..7007297 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -9,6 +9,12 @@ ecm_setup_version(${PROJECT_VERSION} + VARIABLE_PREFIX FILELIGHT + VERSION_HEADER version.h) + ++include(CheckCXXSymbolExists) ++check_cxx_symbol_exists(sincos "math.h" HAVE_SINCOS) ++if (HAVE_SINCOS) ++ add_definitions(-DHAVE_SINCOS) ++endif() ++ + add_library(filelightInternal STATIC fileTree.cpp directoryIterator.cpp) + if (WIN32) + target_sources(filelightInternal PRIVATE windowsWalker.cpp) +diff --git a/src/radialMap/map.cpp b/src/radialMap/map.cpp +index b60d1da..b6bb55b 100644 +--- a/src/radialMap/map.cpp ++++ b/src/radialMap/map.cpp +@@ -20,7 +20,6 @@ + #include "radialMap.h" // defines + + #include "Config.h" +-#define SINCOS_H_IMPLEMENTATION (1) + #include "sincos.h" + #include "widget.h" + +diff --git a/src/radialMap/sincos.h b/src/radialMap/sincos.h +index 142504b..986a899 100644 +--- a/src/radialMap/sincos.h ++++ b/src/radialMap/sincos.h +@@ -10,21 +10,15 @@ + + #include + +-#if !defined(__GLIBC__) || (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1) ++#ifndef HAVE_SINCOS + + #include + +-void +-sincos(double angleRadians, double *Sin, double *Cos); +- +-#ifdef SINCOS_H_IMPLEMENTATION +-void +-sincos(double angleRadians, double *Sin, double *Cos) ++static inline void sincos(double angleRadians, double *Sin, double *Cos) + { + *Sin = qSin(angleRadians); + *Cos = qCos(angleRadians); + } +-#endif + + #endif + +-- +2.35.1 + -- cgit v1.2.3-18-g5258