kde-frameworks/kcoreaddons: Fix weak random number generator
authorJohannes Huber <johu@gentoo.org>
Wed, 27 Apr 2016 11:50:10 +0000 (13:50 +0200)
committerJohannes Huber <johu@gentoo.org>
Wed, 27 Apr 2016 11:51:08 +0000 (13:51 +0200)
Revision bump adds upstream patch to fix a regression introduced in 5.21.0.
See https://mail.kde.org/pipermail/kde-distro-packagers/2016-April/000157.html.

Gentoo-bug: 581352

Package-Manager: portage-2.2.28

kde-frameworks/kcoreaddons/files/kcoreaddons-5.21.0-random.patch [new file with mode: 0644]
kde-frameworks/kcoreaddons/kcoreaddons-5.21.0-r1.ebuild [new file with mode: 0644]

diff --git a/kde-frameworks/kcoreaddons/files/kcoreaddons-5.21.0-random.patch b/kde-frameworks/kcoreaddons/files/kcoreaddons-5.21.0-random.patch
new file mode 100644 (file)
index 0000000..6aa913a
--- /dev/null
@@ -0,0 +1,25 @@
+commit 78212436643af95779facd9593c82fb149c2213d
+Author: Albert Astals Cid <aacid@kde.org>
+Date:   Tue Apr 26 23:41:27 2016 +0200
+
+    Missing rand() -> qrand
+    
+    Fixes regression introduced in 9ae6d765b37135bbfe3a8b936e5a88b8a435e424
+    
+    Reviewed by Aleix
+    
+    BUGS: 362161
+
+diff --git a/src/lib/randomness/krandom.cpp b/src/lib/randomness/krandom.cpp
+index eef6bf6..eaff71f 100644
+--- a/src/lib/randomness/krandom.cpp
++++ b/src/lib/randomness/krandom.cpp
+@@ -51,7 +51,7 @@ int KRandom::random()
+         }
+         qsrand(seed);
+     }
+-    return rand();
++    return qrand();
+ }
+ 
+ QString KRandom::randomString(int length)
diff --git a/kde-frameworks/kcoreaddons/kcoreaddons-5.21.0-r1.ebuild b/kde-frameworks/kcoreaddons/kcoreaddons-5.21.0-r1.ebuild
new file mode 100644 (file)
index 0000000..fb0cc78
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit kde5
+
+DESCRIPTION="Framework for solving common problems such as caching, randomisation, and more"
+LICENSE="LGPL-2+"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="fam nls"
+
+RDEPEND="
+       $(add_qt_dep qtcore 'icu')
+       fam? ( virtual/fam )
+       !<kde-frameworks/kservice-5.2.0:5
+"
+DEPEND="${RDEPEND}
+       x11-misc/shared-mime-info
+       nls? ( $(add_qt_dep linguist-tools) )
+"
+
+PATCHES=( "${FILESDIR}/${P}-random.patch" )
+
+src_configure() {
+       local mycmakeargs=(
+               -D_KDE4_DEFAULT_HOME_POSTFIX=4
+               $(cmake-utils_use_find_package fam FAM)
+       )
+
+       kde5_src_configure
+}