Bug#974108: libkf5eventviews: FTBFS with qrand undefined

2020-11-09 Thread Norbert Preining
On Tue, 10 Nov 2020, Norbert Preining wrote:
> /build/libkf5eventviews-20.08.2/src/prefs.cpp:968:25: error: 'qrand' was not 
> declared in this scope; did you mean 'srand'?
>   968 | QColor col = QColor(qrand() % 256, qrand() % 256, qrand() % 256);
>   | ^
>   | srand

The failing code comes from Debian patch to keep ABI, but there are two bugs:
- first, qglobal.h needs included

--- a/src/prefs.cpp
+++ b/src/prefs.cpp
@@ -33,6 +33,9 @@
 
 #include 
 #include 
+
+#include 
+
 using namespace EventViews;
 
 QSet iconArrayToSet(const QByteArray )



- second, the deprecation need to be adjusted

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,7 +66,7 @@ ecm_setup_version(PROJECT VARIABLE_PREFI
 ### Targets ###
 
 
-add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
+add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050100)
 add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054800)
 
 add_definitions(-DQT_NO_FOREACH)


With that I think it compiles.

Best

Norbert

--
PREINING Norbert  https://www.preining.info
Accelia Inc. + IFMGA ProGuide + TU Wien + JAIST + TeX Live + Debian Dev
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13



Bug#974108: libkf5eventviews: FTBFS with qrand undefined

2020-11-09 Thread Norbert Preining
Source: libkf5eventviews
Version: 4:20.08.2-2
Severity: serious
Tags: ftbfs
Justification: fails to build from source (but built successfully in the past)

Hi

some changes in Qt seem to have triggered FTBFS here, as it fails with
/build/libkf5eventviews-20.08.2/src/prefs.cpp: In member function 'void 
EventViews::Prefs::createNewColor(QColor&, int)':
/build/libkf5eventviews-20.08.2/src/prefs.cpp:968:25: error: 'qrand' was not 
declared in this scope; did you mean 'srand'?
  968 | QColor col = QColor(qrand() % 256, qrand() % 256, qrand() % 256);
  | ^
  | srand

qrand is defined in qglobal.h with

/*
  Reentrant versions of basic rand() functions for random number generation
*/
#if QT_DEPRECATED_SINCE(5, 15)
Q_CORE_EXPORT QT_DEPRECATED_VERSION_X_5_15("use QRandomGenerator instead") void 
qsrand(uint seed);
Q_CORE_EXPORT QT_DEPRECATED_VERSION_X_5_15("use QRandomGenerator instead") int 
qrand();
#endif

so it seems that the deprecation has actually disabled the function.

Best

Norbert



-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.9.6+ (SMP w/8 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)