Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/kopeninghours/files/, dev-libs/kopeninghours/
Date: Mon, 09 May 2022 00:34:32
Message-Id: 1652055952.187f24f2693e9b097caa749ea8f019109bf69db9.asturm@gentoo
1 commit: 187f24f2693e9b097caa749ea8f019109bf69db9
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 9 00:22:44 2022 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Mon May 9 00:25:52 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=187f24f2
7
8 dev-libs/kopeninghours: Rebase cmake patch on top of HEAD
9
10 Closes: https://bugs.gentoo.org/840002
11 Package-Manager: Portage-3.0.30, Repoman-3.0.3
12 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
13
14 .../files/kopeninghours-22.04.0-boostpython.patch | 79 ++++++++++++++++++++++
15 .../kopeninghours/kopeninghours-22.04.0.ebuild | 2 +-
16 2 files changed, 80 insertions(+), 1 deletion(-)
17
18 diff --git a/dev-libs/kopeninghours/files/kopeninghours-22.04.0-boostpython.patch b/dev-libs/kopeninghours/files/kopeninghours-22.04.0-boostpython.patch
19 new file mode 100644
20 index 000000000000..d51fb7d45ff8
21 --- /dev/null
22 +++ b/dev-libs/kopeninghours/files/kopeninghours-22.04.0-boostpython.patch
23 @@ -0,0 +1,79 @@
24 +From fd7c2e1f3797c1a67dc6346dfcb192f042cb19e8 Mon Sep 17 00:00:00 2001
25 +From: Andreas Sturmlechner <asturm@g.o>
26 +Date: Sun, 11 Apr 2021 14:33:48 +0200
27 +Subject: [PATCH] Use FindPython3 w/ Python3_SITELIB, add
28 + BOOSTPYTHON_VERSION_MAJOR_MINOR
29 +
30 +- Use BOOSTPYTHON_VERSION_MAJOR_MINOR to inject desired python target
31 +- Drop deprecated PythonLibs
32 +- Use FindPython3 with Python3_SITELIB for correct install location
33 +
34 +Signed-off-by: Andreas Sturmlechner <asturm@g.o>
35 +---
36 + CMakeLists.txt | 16 +++++-----------
37 + PyKOpeningHours/CMakeLists.txt | 10 ++++------
38 + 2 files changed, 9 insertions(+), 17 deletions(-)
39 +
40 +diff --git a/CMakeLists.txt b/CMakeLists.txt
41 +index 7c50b40..a9a9328 100644
42 +--- a/CMakeLists.txt
43 ++++ b/CMakeLists.txt
44 +@@ -1,7 +1,7 @@
45 + # SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@×××.org>
46 + # SPDX-License-Identifier: BSD-3-Clause
47 +
48 +-cmake_minimum_required(VERSION 3.5)
49 ++cmake_minimum_required(VERSION 3.12)
50 +
51 + # KDE Application Version, managed by release script
52 + set (RELEASE_SERVICE_VERSION_MAJOR "22")
53 +@@ -56,22 +56,16 @@ set_package_properties(FLEX PROPERTIES PURPOSE "Lexer generator for parsing open
54 + find_package(BISON REQUIRED)
55 + set_package_properties(BISON PROPERTIES PURPOSE "Grammar generator for parsing opening hours expressions")
56 +
57 +-find_package(PythonLibs 3.6 MODULE)
58 +-if (PythonLibs_FOUND)
59 +- # Extract major/minor python version
60 +- string(REPLACE "." ";" VERSION_LIST ${PYTHONLIBS_VERSION_STRING})
61 +- list(GET VERSION_LIST 0 PYTHONLIBS_VERSION_MAJOR)
62 +- list(GET VERSION_LIST 1 PYTHONLIBS_VERSION_MINOR)
63 +-
64 +- # boost-python requires exact version number
65 +- find_package(Boost COMPONENTS python${PYTHONLIBS_VERSION_MAJOR}${PYTHONLIBS_VERSION_MINOR} MODULE)
66 +-endif()
67 ++set(BOOSTPYTHON_VERSION_MAJOR_MINOR python36 CACHE STRING "Version of BoostPython to feed CMake's FindBoost")
68 ++# boost-python requires exact version number
69 ++find_package(Boost 1.70 COMPONENTS ${BOOSTPYTHON_VERSION_MAJOR_MINOR} MODULE)
70 +
71 + add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00)
72 + add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054400)
73 + add_definitions(-DQT_NO_FOREACH)
74 + add_subdirectory(src)
75 + if (Boost_FOUND)
76 ++ find_package(Python3 3.6 COMPONENTS Development)
77 + add_subdirectory(PyKOpeningHours)
78 + endif()
79 +
80 +diff --git a/PyKOpeningHours/CMakeLists.txt b/PyKOpeningHours/CMakeLists.txt
81 +index 771cedf..e755ea7 100644
82 +--- a/PyKOpeningHours/CMakeLists.txt
83 ++++ b/PyKOpeningHours/CMakeLists.txt
84 +@@ -21,11 +21,9 @@ kde_target_enable_exceptions(PyKOpeningHours PRIVATE)
85 + target_compile_definitions(PyKOpeningHours PRIVATE KOPENINGHOURS_VALIDATOR_ONLY)
86 +
87 + # Set up the libraries and header search paths for this target
88 +-target_link_libraries(PyKOpeningHours PUBLIC ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} KOpeningHours)
89 +-target_include_directories(PyKOpeningHours PRIVATE ${Boost_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS})
90 ++target_link_libraries(PyKOpeningHours PUBLIC Boost::${BOOSTPYTHON_VERSION_MAJOR_MINOR} ${Python3_LIBRARIES} KOpeningHours)
91 ++target_include_directories(PyKOpeningHours PRIVATE ${Boost_INCLUDE_DIR} ${Python3_INCLUDE_DIRS})
92 +
93 +-set(_install_dir lib/python${PYTHONLIBS_VERSION_MAJOR}.${PYTHONLIBS_VERSION_MINOR}/site-packages)
94 +-
95 +-install(TARGETS PyKOpeningHours DESTINATION ${_install_dir}/PyKOpeningHours)
96 +-install(FILES PyKOpeningHours.pyi __init__.py DESTINATION ${_install_dir}/PyKOpeningHours)
97 ++install(TARGETS PyKOpeningHours DESTINATION ${Python3_SITELIB}/PyKOpeningHours)
98 ++install(FILES PyKOpeningHours.pyi __init__.py DESTINATION ${Python3_SITELIB}/PyKOpeningHours)
99 +
100 +--
101 +2.31.1
102 +
103
104 diff --git a/dev-libs/kopeninghours/kopeninghours-22.04.0.ebuild b/dev-libs/kopeninghours/kopeninghours-22.04.0.ebuild
105 index d773a36bdba2..627bb806459e 100644
106 --- a/dev-libs/kopeninghours/kopeninghours-22.04.0.ebuild
107 +++ b/dev-libs/kopeninghours/kopeninghours-22.04.0.ebuild
108 @@ -44,7 +44,7 @@ BDEPEND="
109 sys-devel/flex
110 "
111
112 -PATCHES=( "${FILESDIR}"/${PN}-21.03.90-boostpython.patch )
113 +PATCHES=( "${FILESDIR}"/${P}-boostpython.patch )
114
115 pkg_setup() {
116 ecm_pkg_setup