Source: kde-config-systemd
Version: 1.2.1-3
Tags: patch upstream
User: [email protected]
Usertags: rebootstrap
kde-config-systemd fails to cross build from source, because it checks
whether std::chrono works with a try_run check. On Debian systems, we
can safely assume that std::chrono works, so removing that check is an
easy solution. I'm not sure whether that is acceptable upstream, but I
think that the present check does more harm than good: Besides breaking
cross compilation, it also uses equality comparison on floating point
numbers, which can unexpectedly break. Encountering a compiler that
doesn't do std::chrono should be a rare thing as well.
The attached patch thus removes the whole check and fallback to boost.
It makes kde-config-systemd cross build successfully. Can you apply it
or do we need a more elaborate solution?
Helmut
Index: kde-config-systemd-1.2.1/src/CMakeLists.txt
===================================================================
--- kde-config-systemd-1.2.1.orig/src/CMakeLists.txt
+++ kde-config-systemd-1.2.1/src/CMakeLists.txt
@@ -9,18 +9,6 @@
confparms.cpp
fsutil.cpp)
-# Testing for C++0x/C++11 features
-include (CheckCxxFeatures)
-cxx_check_feature ("c++11" "std-chrono" "none" HAVE_CXX11_CHRONO "${ADDITIONAL_DEFINITIONS}")
-
-# Fall back to boost::chrono if std::chrono feature detection failed
-if (NOT HAVE_CXX11_CHRONO)
- message (WARNING "Your C++ compiler does not support std::chrono properly, using boost::chrono instead.")
- find_package(Boost 1.45.0 COMPONENTS chrono system REQUIRED)
-endif ()
-
-configure_file (kcm-systemd-features.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/src/kcm-systemd-features.h)
-
include_directories (${CMAKE_CURRENT_BINARY_DIR}/src)
ki18n_wrap_ui(kcmsystemd_SRCS ../ui/kcmsystemd.ui)
Index: kde-config-systemd-1.2.1/src/confoption.h
===================================================================
--- kde-config-systemd-1.2.1.orig/src/confoption.h
+++ kde-config-systemd-1.2.1/src/confoption.h
@@ -20,21 +20,12 @@
#include <QStringList>
#include <QVariant>
-#include "kcm-systemd-features.h"
-#if defined(HAVE_CXX11_CHRONO)
#include <ratio>
#include <chrono>
namespace ratio = std;
namespace chrono = std::chrono;
-#else
-#include <boost/ratio.hpp>
-#include <boost/chrono.hpp>
-
-namespace ratio = boost;
-namespace chrono = boost::chrono;
-#endif
enum settingType
{
Index: kde-config-systemd-1.2.1/src/kcm-systemd-features.h.cmake
===================================================================
--- kde-config-systemd-1.2.1.orig/src/kcm-systemd-features.h.cmake
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef KCMSYSTEMD_CONFIG_FEATURES_H_
-#define KCMSYSTEMD_CONFIG_FEATURES_H_
-
-#cmakedefine01 HAVE_CXX11_CHRONO
-
-#endif