[frameworks-kcoreaddons] [Bug 397154] Cannot build kcoreadons 5.49 with Python bindings

2018-08-24 Thread Stefan Brüns
https://bugs.kde.org/show_bug.cgi?id=397154

Stefan Brüns  changed:

   What|Removed |Added

 Status|CONFIRMED   |RESOLVED
  Latest Commit||https://commits.kde.org/ext
   ||ra-cmake-modules/1790a6994a
   ||3536a9d6c73901cb7898615eb64
   ||861
 Resolution|--- |FIXED

--- Comment #23 from Stefan Brüns  ---
Git commit 1790a6994a3536a9d6c73901cb7898615eb64861 by Stefan Brüns.
Committed on 25/08/2018 at 02:14.
Pushed by bruns into branch 'master'.

Bindings: Add support for scoped enums

Summary:
Keep the enum intact by emitting the class keyword in case the enum is
scoped.
Use the complete enum scope for parameter values, the enclosing scope is
only correct to use for unscoped enums.
The python Cursor.is_scoped_enum() method has been added with LLVM/Clang
version 5.0.

Test Plan: build kcoreaddons

Reviewers: #frameworks, mpyne

Reviewed By: mpyne

Subscribers: mpyne, kde-frameworks-devel, kde-buildsystem

Tags: #frameworks, #build_system

Differential Revision: https://phabricator.kde.org/D14908

M  +2-8find-modules/FindPythonModuleGeneration.cmake
M  +8-2find-modules/sip_generator.py

https://commits.kde.org/extra-cmake-modules/1790a6994a3536a9d6c73901cb7898615eb64861

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kcoreaddons] [Bug 397154] Cannot build kcoreadons 5.49 with Python bindings

2018-08-22 Thread Pawel
https://bugs.kde.org/show_bug.cgi?id=397154

--- Comment #22 from Pawel  ---
(In reply to Stefan Brüns from comment #20)
> https://phabricator.kde.org/D14908

It looks like kcoreaddons can be build when ECM was built with this patch.

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kcoreaddons] [Bug 397154] Cannot build kcoreadons 5.49 with Python bindings

2018-08-17 Thread Melanie Genz
https://bugs.kde.org/show_bug.cgi?id=397154

--- Comment #21 from Melanie Genz  ---
Thank you. Will look into that and try it out tomorrow.

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kcoreaddons] [Bug 397154] Cannot build kcoreadons 5.49 with Python bindings

2018-08-17 Thread Stefan Brüns
https://bugs.kde.org/show_bug.cgi?id=397154

--- Comment #20 from Stefan Brüns  ---
(In reply to Stefan Brüns from comment #19)
> Ok, its a genuine KDE bug, the SIP generator does not handle enum class
> specifically:
> 
> https://cgit.kde.org/extra-cmake-modules.git/tree/find-modules/sip_generator.
> py#n419

https://phabricator.kde.org/D14908

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kcoreaddons] [Bug 397154] Cannot build kcoreadons 5.49 with Python bindings

2018-08-17 Thread Antonio Rojas
https://bugs.kde.org/show_bug.cgi?id=397154

Antonio Rojas  changed:

   What|Removed |Added

 CC||aro...@archlinux.org

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kcoreaddons] [Bug 397154] Cannot build kcoreadons 5.49 with Python bindings

2018-08-14 Thread Stefan Brüns
https://bugs.kde.org/show_bug.cgi?id=397154

--- Comment #19 from Stefan Brüns  ---
Ok, its a genuine KDE bug, the SIP generator does not handle enum class
specifically:

https://cgit.kde.org/extra-cmake-modules.git/tree/find-modules/sip_generator.py#n419

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kcoreaddons] [Bug 397154] Cannot build kcoreadons 5.49 with Python bindings

2018-08-14 Thread Stefan Brüns
https://bugs.kde.org/show_bug.cgi?id=397154

--- Comment #18 from Stefan Brüns  ---
(In reply to Melanie Genz from comment #13)
> I Managed to build kcoreaddons 5.49.0 with python bindings using this small
> patch.
> 
> diff -Naur kcoreaddons-5.49.0.orig/src/lib/util/kformat.h
> kcoreaddons-5.49.0/src/lib/util/kformat.h
> --- kcoreaddons-5.49.0.orig/src/lib/util/kformat.h2018-08-04
> 12:56:42.0 +0200
> +++ kcoreaddons-5.49.0/src/lib/util/kformat.h 2018-08-14 12:35:57.224626936
> +0200
> @@ -116,7 +116,7 @@
>   * @see formatValue
>   * @since 5.49
>   */
> -enum class Unit {
> +enum Unit {

Thats a BIC, so definitely no solution.

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kcoreaddons] [Bug 397154] Cannot build kcoreadons 5.49 with Python bindings

2018-08-14 Thread Melanie Genz
https://bugs.kde.org/show_bug.cgi?id=397154

--- Comment #17 from Melanie Genz  ---
I've compile the whole kf5 5.49.0 stack now including python bindings and
everything seems to be working without problems.

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kcoreaddons] [Bug 397154] Cannot build kcoreadons 5.49 with Python bindings

2018-08-14 Thread Michael Pyne
https://bugs.kde.org/show_bug.cgi?id=397154

--- Comment #16 from Michael Pyne  ---
Need to clarify my earlier comment. I have sip/PyQt5 on an Ubuntu image but
it's not setup properly so the GeneratePythonModule CMake find-module isn't
trying to generate bindings. So I can't actually confirm that it works
personally.

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kcoreaddons] [Bug 397154] Cannot build kcoreadons 5.49 with Python bindings

2018-08-14 Thread Michael Pyne
https://bugs.kde.org/show_bug.cgi?id=397154

Michael Pyne  changed:

   What|Removed |Added

 Status|UNCONFIRMED |CONFIRMED
 Ever confirmed|0   |1

--- Comment #15 from Michael Pyne  ---
Marking as confirmed based on multiple confirmation reports.

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kcoreaddons] [Bug 397154] Cannot build kcoreadons 5.49 with Python bindings

2018-08-14 Thread Michael Pyne
https://bugs.kde.org/show_bug.cgi?id=397154

--- Comment #14 from Michael Pyne  ---
I'm not a fan of changing the enum classes if we can avoid it, since that may
have impact on C++-using code.

I have an Ubuntu-based container where the build also completes successfully so
I don't think is a matter of impossibility with latest sip/PyQt5.

Regardless I've come up with a patch to make the bindings optional for now, and
maybe that's the least-worst solution to at least getting things to build for
those who don't need the bindings.

You'd need to pass the -DGENERATE_PYTHON_MODULES=OFF option when running cmake
since the option defaults to being set.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5bd07ed..b860afd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,6 +27,9 @@ include(KDECMakeSettings)
 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt
Assistant, Qt Creator & KDevelop)" OFF)
 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g.
Qt Assistant, Qt Creator & KDevelop)")

+option(GENERATE_PYTHON_MODULES "Build Python bindings for KCoreAddons
libraries, if needed dependencies are available" ON)
+add_feature_info(PYTHON_BINDING ${GENERATE_PYTHON_MODULES} "Generates Python
bindings for KCoreAddons libraries, if needed dependencies are available")
+
 set(REQUIRED_QT_VERSION 5.8.0)
 find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core)

diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index 573d6e3..8f0ff3a 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -205,7 +205,9 @@ ecm_generate_headers(KCoreAddons_HEADERS
 REQUIRED_HEADERS KCoreAddons_HEADERS
 )

-find_package(PythonModuleGeneration)
+if (GENERATE_PYTHON_MODULES)
+find_package(PythonModuleGeneration)
+endif ()

 if (PythonModuleGeneration_FOUND)
   ecm_generate_python_binding(

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kcoreaddons] [Bug 397154] Cannot build kcoreadons 5.49 with Python bindings

2018-08-14 Thread Melanie Genz
https://bugs.kde.org/show_bug.cgi?id=397154

--- Comment #13 from Melanie Genz  ---
I Managed to build kcoreaddons 5.49.0 with python bindings using this small
patch.

diff -Naur kcoreaddons-5.49.0.orig/src/lib/util/kformat.h
kcoreaddons-5.49.0/src/lib/util/kformat.h
--- kcoreaddons-5.49.0.orig/src/lib/util/kformat.h  2018-08-04
12:56:42.0 +0200
+++ kcoreaddons-5.49.0/src/lib/util/kformat.h   2018-08-14 12:35:57.224626936
+0200
@@ -116,7 +116,7 @@
  * @see formatValue
  * @since 5.49
  */
-enum class Unit {
+enum Unit {
 Other,
 Bit,   ///< "bit"
 Byte,  ///< "B"
@@ -135,7 +135,7 @@
  * @see formatValue
  * @since 5.49
  */
-enum class UnitPrefix {
+enum UnitPrefix {
 /// Auto-choose a unit such that the result is in the range [0, 1000
or 1024)
 AutoAdjust = -128,

--

Seems like sip doesn't detects that enum class in that code is at least c++11
standard.

I must admit that idon't know if it is a good idea to change enum classes to
standard enums.

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kcoreaddons] [Bug 397154] Cannot build kcoreadons 5.49 with Python bindings

2018-08-14 Thread Pawel
https://bugs.kde.org/show_bug.cgi?id=397154

Pawel  changed:

   What|Removed |Added

Summary|Cannot build kcoreadons |Cannot build kcoreadons
   |5.49rc1 |5.49 with Python bindings

-- 
You are receiving this mail because:
You are watching all bug changes.