* [gentoo-commits] repo/gentoo:master commit in: net-wireless/soapysdr/files/, net-wireless/soapysdr/
@ 2024-06-02 1:44 Sam James
0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2024-06-02 1:44 UTC (permalink / raw
To: gentoo-commits
commit: b68f6dcca10b8439e9de2c2eea96853cee5f2577
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 2 01:23:09 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jun 2 01:40:35 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b68f6dcc
net-wireless/soapysdr: fix broken Python handling
* Add patch for Python 3.12 distutils
* Switch to python-single-r1 as its only Python reverse dependency in
::gentoo is net-wireless/gnuradio.
Before now, it was completely broken as it'd use whatever Python it
felt like -- at no point was EPYTHON/PYTHON passed into the build system,
and it accumulated args when re-running for each impl (just enabling Python,
not for any specific impl) anyway.
We also only installed once anyway.
Fixes: 915993925dd6ae9f4303278ab00e4feb49c5d12b
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../soapysdr-0.8.1-python3.12-distutils.patch | 74 ++++++++++++++++++++++
...pysdr-0.8.1.ebuild => soapysdr-0.8.1-r1.ebuild} | 48 +++++++-------
net-wireless/soapysdr/soapysdr-9999.ebuild | 43 ++++++-------
3 files changed, 116 insertions(+), 49 deletions(-)
diff --git a/net-wireless/soapysdr/files/soapysdr-0.8.1-python3.12-distutils.patch b/net-wireless/soapysdr/files/soapysdr-0.8.1-python3.12-distutils.patch
new file mode 100644
index 000000000000..877bc9c15ba7
--- /dev/null
+++ b/net-wireless/soapysdr/files/soapysdr-0.8.1-python3.12-distutils.patch
@@ -0,0 +1,74 @@
+https://github.com/pothosware/SoapySDR/commit/1ee5670803f89b21d84a6a84acbb578da051c119
+
+From 1ee5670803f89b21d84a6a84acbb578da051c119 Mon Sep 17 00:00:00 2001
+From: Ryan Volz <ryan.volz@gmail.com>
+Date: Tue, 26 Sep 2023 14:56:59 -0400
+Subject: [PATCH] Remove deprecated use of distutils, fix for Python 3.12+
+
+This switches to using sysconfig from distutils, which is necessary for
+Python 3.12+ since distutils is deprecated and has been removed.
+
+It is necessary to specify the install scheme when a prefix other than
+the Python default is used so that changes to the default scheme made by
+distributions (e.g. Debian, Fedora) do not produce an incorrect Python
+installation directory. For example, Debian patches the default scheme
+to prepend the path with '/local', but if a user specifies a prefix of
+'/usr/local', then the path using the default scheme would be
+'/usr/local/local/...' with a duplicated 'local' directory. Specifying
+an unmodified install scheme fixes that.
+
+Signed-off-by: Ryan Volz <ryan.volz@gmail.com>
+---
+ python/get_python_lib.py | 36 ++++++++++++++++++++++++-----------
+ 1 file changed, 25 insertions(+), 11 deletions(-)
+
+diff --git a/python/get_python_lib.py b/python/get_python_lib.py
+index 0c716529..574f0b60 100644
+--- a/python/get_python_lib.py
++++ b/python/get_python_lib.py
+@@ -1,19 +1,33 @@
+ import os
++import pathlib
+ import sys
+-import site
+-from distutils.sysconfig import get_python_lib
++import sysconfig
+
+ if __name__ == '__main__':
+- prefix = sys.argv[1]
++ prefix = pathlib.Path(sys.argv[1]).resolve()
+
+- #ask distutils where to install the python module
+- install_dir = get_python_lib(plat_specific=True, prefix=prefix)
++ # default install dir for the running Python interpreter
++ default_install_dir = pathlib.Path(sysconfig.get_path('platlib')).resolve()
+
+- #use sites when the prefix is already recognized
++ # if default falls under the desired prefix, we're done
+ try:
+- paths = [p for p in site.getsitepackages() if p.startswith(prefix)]
+- if len(paths) == 1: install_dir = paths[0]
+- except AttributeError: pass
++ relative_install_dir = default_install_dir.relative_to(prefix)
++ except ValueError:
++ # get install dir for the specified prefix
++ # can't use the default scheme because distributions modify it
++ # newer Python versions have 'venv' scheme, use for all OSs.
++ if 'venv' in sysconfig.get_scheme_names():
++ scheme = 'venv'
++ elif os.name == 'nt':
++ scheme = 'nt'
++ else:
++ scheme = 'posix_prefix'
++ prefix_install_dir = pathlib.Path(sysconfig.get_path(
++ 'platlib',
++ scheme=scheme,
++ vars={'base': prefix, 'platbase': prefix},
++ )).resolve()
++ relative_install_dir = prefix_install_dir.relative_to(prefix)
+
+- #strip the prefix to return a relative path
+- print(os.path.relpath(install_dir, prefix))
++ # want a relative path for use in the build system
++ print(relative_install_dir)
+
diff --git a/net-wireless/soapysdr/soapysdr-0.8.1.ebuild b/net-wireless/soapysdr/soapysdr-0.8.1-r1.ebuild
similarity index 58%
rename from net-wireless/soapysdr/soapysdr-0.8.1.ebuild
rename to net-wireless/soapysdr/soapysdr-0.8.1-r1.ebuild
index b82e2be6935d..f4f69287124e 100644
--- a/net-wireless/soapysdr/soapysdr-0.8.1.ebuild
+++ b/net-wireless/soapysdr/soapysdr-0.8.1-r1.ebuild
@@ -4,8 +4,7 @@
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
-
-inherit cmake python-r1
+inherit cmake python-single-r1
DESCRIPTION="vendor and platform neutral SDR support library"
HOMEPAGE="https://github.com/pothosware/SoapySDR"
@@ -22,39 +21,40 @@ fi
LICENSE="Boost-1.0"
SLOT="0/${PV}"
-
IUSE="bladerf hackrf python rtlsdr plutosdr uhd"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
RDEPEND="python? ( ${PYTHON_DEPS} )"
-DEPEND="${RDEPEND}
- python? ( dev-lang/swig:0 )
+DEPEND="${RDEPEND}"
+BDEPEND="python? ( dev-lang/swig:0 )"
+PDEPEND="
+ bladerf? ( net-wireless/soapybladerf )
+ hackrf? ( net-wireless/soapyhackrf )
+ rtlsdr? ( net-wireless/soapyrtlsdr )
+ plutosdr? ( net-wireless/soapyplutosdr )
+ uhd? ( net-wireless/soapyuhd )
"
-PDEPEND="bladerf? ( net-wireless/soapybladerf )
- hackrf? ( net-wireless/soapyhackrf )
- rtlsdr? ( net-wireless/soapyrtlsdr )
- plutosdr? ( net-wireless/soapyplutosdr )
- uhd? ( net-wireless/soapyuhd )"
-src_configure() {
- configuration() {
- mycmakeargs+=(
- -DENABLE_PYTHON=ON
- -DBUILD_PYTHON3=ON
- )
- }
+PATCHES=(
+ "${FILESDIR}"/soapysdr-0.8.1-python3.12-distutils.patch
+)
- if use python; then
- python_foreach_impl configuration
- fi
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DENABLE_PYTHON=$(usex python)
+ -DENABLE_PYTHON3=$(usex python)
+ -DBUILD_PYTHON3=$(usex python)
+ -DUSE_PYTHON_CONFIG=ON
+ )
cmake_src_configure
}
src_install() {
cmake_src_install
-
- if use python; then
- python_foreach_impl python_optimize
- fi
+ use python && python_optimize
}
diff --git a/net-wireless/soapysdr/soapysdr-9999.ebuild b/net-wireless/soapysdr/soapysdr-9999.ebuild
index 04bd0f2876cd..dbc5bebb6a98 100644
--- a/net-wireless/soapysdr/soapysdr-9999.ebuild
+++ b/net-wireless/soapysdr/soapysdr-9999.ebuild
@@ -4,8 +4,7 @@
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
-
-inherit cmake python-r1
+inherit cmake python-single-r1
DESCRIPTION="vendor and platform neutral SDR support library"
HOMEPAGE="https://github.com/pothosware/SoapySDR"
@@ -15,46 +14,40 @@ if [ "${PV}" = "9999" ]; then
EGIT_CLONE_TYPE="shallow"
inherit git-r3
else
- KEYWORDS="~amd64 ~arm ~riscv ~x86"
+ KEYWORDS="amd64 ~arm ~riscv ~x86"
SRC_URI="https://github.com/pothosware/SoapySDR/archive/soapy-sdr-${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}"/SoapySDR-soapy-sdr-"${PV}"
fi
LICENSE="Boost-1.0"
SLOT="0/${PV}"
-
IUSE="bladerf hackrf python rtlsdr plutosdr uhd"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
RDEPEND="python? ( ${PYTHON_DEPS} )"
-DEPEND="${RDEPEND}
- python? ( dev-lang/swig:0 )
+DEPEND="${RDEPEND}"
+BDEPEND="python? ( dev-lang/swig:0 )"
+PDEPEND="
+ bladerf? ( net-wireless/soapybladerf )
+ hackrf? ( net-wireless/soapyhackrf )
+ rtlsdr? ( net-wireless/soapyrtlsdr )
+ plutosdr? ( net-wireless/soapyplutosdr )
+ uhd? ( net-wireless/soapyuhd )
"
-PDEPEND="bladerf? ( net-wireless/soapybladerf )
- hackrf? ( net-wireless/soapyhackrf )
- rtlsdr? ( net-wireless/soapyrtlsdr )
- plutosdr? ( net-wireless/soapyplutosdr )
- uhd? ( net-wireless/soapyuhd )"
-src_configure() {
- configuration() {
- mycmakeargs+=(
- -DENABLE_PYTHON=ON
- -DBUILD_PYTHON3=ON
- )
- }
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
- if use python; then
- python_foreach_impl configuration
- fi
+src_configure() {
+ local mycmakeargs=(
+ -DENABLE_PYTHON3=$(usex python)
+ )
cmake_src_configure
}
src_install() {
cmake_src_install
-
- if use python; then
- python_foreach_impl python_optimize
- fi
+ use python && python_optimize
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-wireless/soapysdr/files/, net-wireless/soapysdr/
@ 2025-04-03 16:43 Thomas Beierlein
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Beierlein @ 2025-04-03 16:43 UTC (permalink / raw
To: gentoo-commits
commit: a654ea378d7756ab35188a11e44d17a68d33d433
Author: Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 3 16:17:34 2025 +0000
Commit: Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
CommitDate: Thu Apr 3 16:42:56 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a654ea37
net-wireless/soapysdr: Fix build with cmake4
Signed-off-by: Thomas Beierlein <tomjbe <AT> gentoo.org>
.../soapysdr/files/soapysdr-0.8.1-cmake4.patch | 39 ++++++++++++++++++++++
...apysdr-9999.ebuild => soapysdr-0.8.1-r2.ebuild} | 10 +++++-
net-wireless/soapysdr/soapysdr-9999.ebuild | 10 +++++-
3 files changed, 57 insertions(+), 2 deletions(-)
diff --git a/net-wireless/soapysdr/files/soapysdr-0.8.1-cmake4.patch b/net-wireless/soapysdr/files/soapysdr-0.8.1-cmake4.patch
new file mode 100644
index 000000000000..a21cdf7da951
--- /dev/null
+++ b/net-wireless/soapysdr/files/soapysdr-0.8.1-cmake4.patch
@@ -0,0 +1,39 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ff15ad0..8fff872 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ ########################################################################
+ # Project setup
+ ########################################################################
+-cmake_minimum_required(VERSION 3.1.0)
++cmake_minimum_required(VERSION 3.10.0)
+ project(SoapySDR)
+ enable_language(CXX)
+ enable_testing()
+diff --git a/ExampleDriver/CMakeLists.txt b/ExampleDriver/CMakeLists.txt
+index 32cb6ca..ada07e9 100644
+--- a/ExampleDriver/CMakeLists.txt
++++ b/ExampleDriver/CMakeLists.txt
+@@ -2,7 +2,7 @@
+ # Project setup -- only needed if device support is a stand-alone build
+ # We recommend that the support module be built in-tree with the driver.
+ ########################################################################
+-cmake_minimum_required(VERSION 2.6)
++cmake_minimum_required(VERSION 3.10.0)
+ project(SoapySDRMyDevice CXX)
+ enable_testing()
+
+diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
+index 8cb1592..a5c09ce 100644
+--- a/python/CMakeLists.txt
++++ b/python/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ ########################################################################
+ # Project setup
+ ########################################################################
+-cmake_minimum_required(VERSION 2.8)
++cmake_minimum_required(VERSION 3.10.0)
+ project(SoapySDRPython CXX)
+ enable_testing()
+
diff --git a/net-wireless/soapysdr/soapysdr-9999.ebuild b/net-wireless/soapysdr/soapysdr-0.8.1-r2.ebuild
similarity index 83%
copy from net-wireless/soapysdr/soapysdr-9999.ebuild
copy to net-wireless/soapysdr/soapysdr-0.8.1-r2.ebuild
index aaa41be56cc9..8f5ef69eb2ef 100644
--- a/net-wireless/soapysdr/soapysdr-9999.ebuild
+++ b/net-wireless/soapysdr/soapysdr-0.8.1-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -35,13 +35,21 @@ PDEPEND="
uhd? ( net-wireless/soapyuhd )
"
+PATCHES=(
+ "${FILESDIR}"/soapysdr-0.8.1-python3.12-distutils.patch
+ "${FILESDIR}"/soapysdr-0.8.1-cmake4.patch
+)
+
pkg_setup() {
use python && python-single-r1_pkg_setup
}
src_configure() {
local mycmakeargs=(
+ -DENABLE_PYTHON=$(usex python)
-DENABLE_PYTHON3=$(usex python)
+ -DBUILD_PYTHON3=$(usex python)
+ -DUSE_PYTHON_CONFIG=ON
)
cmake_src_configure
diff --git a/net-wireless/soapysdr/soapysdr-9999.ebuild b/net-wireless/soapysdr/soapysdr-9999.ebuild
index aaa41be56cc9..8f5ef69eb2ef 100644
--- a/net-wireless/soapysdr/soapysdr-9999.ebuild
+++ b/net-wireless/soapysdr/soapysdr-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -35,13 +35,21 @@ PDEPEND="
uhd? ( net-wireless/soapyuhd )
"
+PATCHES=(
+ "${FILESDIR}"/soapysdr-0.8.1-python3.12-distutils.patch
+ "${FILESDIR}"/soapysdr-0.8.1-cmake4.patch
+)
+
pkg_setup() {
use python && python-single-r1_pkg_setup
}
src_configure() {
local mycmakeargs=(
+ -DENABLE_PYTHON=$(usex python)
-DENABLE_PYTHON3=$(usex python)
+ -DBUILD_PYTHON3=$(usex python)
+ -DUSE_PYTHON_CONFIG=ON
)
cmake_src_configure
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-03 16:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-02 1:44 [gentoo-commits] repo/gentoo:master commit in: net-wireless/soapysdr/files/, net-wireless/soapysdr/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2025-04-03 16:43 Thomas Beierlein
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox