-r10: migrated to setuptools via patch

as initial preparation to python3.12

Signed-off-by: Denis Reva <denis7774@gmail.com>
This commit is contained in:
Denis Reva
2023-02-25 17:05:31 +05:00
parent ff9426214d
commit 0a8718f32b
4 changed files with 85 additions and 26 deletions

View File

@@ -1,22 +0,0 @@
From 79d40e9e564772973f7f085ed5c48e3fc625e0f5 Mon Sep 17 00:00:00 2001
From: Erfan Abdi <erfangplus@gmail.com>
Date: Mon, 6 Sep 2021 13:57:22 +0430
Subject: [PATCH] setup: Drop None from keywords
---
setup.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/setup.py b/setup.py
index cf3a42e..ed2b1ed 100644
--- a/setup.py
+++ b/setup.py
@@ -19,6 +19,8 @@ def pkgconfig(package, kw):
extension_kwargs = { 'sources': ["gbinder" + file_ext] }
extension_kwargs = pkgconfig('libgbinder', extension_kwargs)
+if None in extension_kwargs:
+ del extension_kwargs[None]
extensions = [Extension('gbinder', **extension_kwargs)]
if USE_CYTHON:

View File

@@ -0,0 +1,37 @@
From 32cfbabe5ed37815358cc3515ce6551b6b7b87ae Mon Sep 17 00:00:00 2001
From: Herrie <Github.com@herrie.org>
Date: Sat, 23 Jul 2022 20:38:22 +0200
Subject: [PATCH] setup.py: Migrate away from deprecated distutils.core to
setuptools
distutils will be removed in Python 3.12, but already gives issues with 3.10 as well.
/mnt/5ba5d474-0b2d-49d6-a5a6-9de20c3ac967/kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/python3-gbinder/1.0.0+gitAUTOINC+da16278f0d-r0/git/setup.py:2: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
from distutils.core import setup, Extension
Compiling gbinder.pyx because it changed.
[1/1] Cythonizing gbinder.pyx
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_wheel'
ERROR: 'python3 setup.py bdist_wheel sdist --cython' execution failed.
WARNING: exit code 1 from a shell command.
Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
---
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index ed2b1ed..6060f84 100644
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,5 @@
import sys, subprocess
-from distutils.core import setup, Extension
+from setuptools import setup, Extension
def pkgconfig(package, kw):

View File

@@ -0,0 +1,44 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9..11} )
DISTUTILS_USE_PEP517="setuptools"
inherit distutils-r1
if [[ ${PV} != *9999* ]]; then
MY_PN="${PN}-python"
MY_P="${MY_PN}-${PV}"
S="${WORKDIR}/${MY_P}"
SRC_URI="https://github.com/erfanoabdi/gbinder-python/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
else
inherit git-r3
EGIT_REPO_URI="https://github.com/erfanoabdi/gbinder-python.git"
fi
DESCRIPTION="Python bindings for libgbinder"
HOMEPAGE="https://github.com/erfanoabdi/gbinder-python"
LICENSE="GPL-3"
SLOT="0"
PATCHES=(
"${FILESDIR}"/gbinder-1.1.1-setuptools.patch
)
DEPEND="dev-libs/gbinder
dev-libs/libglibutil"
RDEPEND="${DEPEND}"
BDEPEND="
virtual/pkgconfig
dev-python/cython[${PYTHON_USEDEP}]
${DISTUTILS_DEPS}
"
python_configure_all () {
DISTUTILS_ARGS=( --cython )
}

View File

@@ -3,7 +3,7 @@
EAPI=8
PYTHON_COMPAT=( python3_{9..10} )
PYTHON_COMPAT=( python3_{9..11} )
inherit distutils-r1
@@ -12,8 +12,7 @@ if [[ ${PV} != *9999* ]]; then
MY_P="${MY_PN}-${PV}"
S="${WORKDIR}/${MY_P}"
SRC_URI="https://github.com/erfanoabdi/gbinder-python/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64"
PATCHES=( "${FILESDIR}/${P}-setuppy-extensions.patch" )
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
else
inherit git-r3
EGIT_REPO_URI="https://github.com/erfanoabdi/gbinder-python.git"
@@ -24,7 +23,8 @@ HOMEPAGE="https://github.com/erfanoabdi/gbinder-python"
LICENSE="GPL-3"
SLOT="0"
DEPEND="dev-libs/gbinder"
DEPEND="dev-libs/gbinder
dev-libs/libglibutil"
RDEPEND="${DEPEND}"
BDEPEND="
virtual/pkgconfig