commit:     1a17dde6c1b92db8e9b0d6ee440ccbeaaee5255a
Author:     Huang Rui <vowstar <AT> gmail <DOT> com>
AuthorDate: Sun Aug  6 04:37:36 2023 +0000
Commit:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Sun Aug  6 10:05:12 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a17dde6

dev-embedded/urjtag: add 2021.03

Signed-off-by: Huang Rui <vowstar <AT> gmail.com>
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>

 dev-embedded/urjtag/Manifest                       |  1 +
 .../files/urjtag-2021.03-fix-python-setup.patch    | 14 ++++
 dev-embedded/urjtag/urjtag-2021.03.ebuild          | 84 ++++++++++++++++++++++
 3 files changed, 99 insertions(+)

diff --git a/dev-embedded/urjtag/Manifest b/dev-embedded/urjtag/Manifest
index a7184daab17c..d4a4765dafc1 100644
--- a/dev-embedded/urjtag/Manifest
+++ b/dev-embedded/urjtag/Manifest
@@ -1 +1,2 @@
 DIST urjtag-2019.12.tar.xz 1208432 BLAKE2B 
69963cbd39dcbec1abd73778fc6e98d743e36f6d4a17ba673b8691598ac0d4cec97e8b9c79068ad8971e6e07de81553bfd3bf5f684515b4a19303dd95ed477a2
 SHA512 
e149e53410a6591bdadc2c0138c6f81dac0fd6e35601461e19d356decdb820ec8e6bd53d59a1fd9781dfa1fee88d23dcafbd8df9adc0f8e51256c626d2ee0f36
+DIST urjtag-2021.03.tar.xz 1208440 BLAKE2B 
68d0f0ec15c25ef351e0523eea21c18e723871032a046d31c031809a2774b0b8339b0b5d1a6f11a681ab3d3074b7f5f4fcd819fa7de1fdcac5f20ab39c6a40dd
 SHA512 
baf203e556d1d41437539d3f5c018b35fbb496f71391c2bec2786ffa47bff33d38654b3e7d106e38bcf36d075d86fc02b18eaaf634cdb65e2840ff50ca0da8b2

diff --git a/dev-embedded/urjtag/files/urjtag-2021.03-fix-python-setup.patch 
b/dev-embedded/urjtag/files/urjtag-2021.03-fix-python-setup.patch
new file mode 100644
index 000000000000..c6206fefee2e
--- /dev/null
+++ b/dev-embedded/urjtag/files/urjtag-2021.03-fix-python-setup.patch
@@ -0,0 +1,14 @@
+Subject: [PATCH] python: replace distutils with setuptools
+
+distutils is deprecated for sometime and it was removed in python 3.12.
+
+--- a/bindings/python/setup.py.in      2018-03-24 20:27:41.000000000 +0800
++++ b/bindings/python/setup.py.in      2023-08-06 10:31:12.932358441 +0800
+@@ -1,6 +1,6 @@
+ # python extension setup script for urjtag
+ 
+-from distutils.core import setup, Extension
++from setuptools import setup, Extension
+ 
+ libraries = ['urjtag']
+ libraries.extend( w.replace('-l', '') for w in "@LIBFTDI_LIBS@ @FTD2XXLIB@ 
@LIBUSB_LIBS@ @LIBINTL@".split() if w.replace('-l', '') not in libraries )

diff --git a/dev-embedded/urjtag/urjtag-2021.03.ebuild 
b/dev-embedded/urjtag/urjtag-2021.03.ebuild
new file mode 100644
index 000000000000..031c9e8c7232
--- /dev/null
+++ b/dev-embedded/urjtag/urjtag-2021.03.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit python-r1
+
+if [[ ${PV} == "9999" ]] ; then
+       EGIT_REPO_URI="git://git.code.sf.net/p/urjtag/git"
+       inherit git-r3 autotools
+       S="${WORKDIR}/${P}/${PN}"
+else
+       SRC_URI="mirror://sourceforge/urjtag/${P}.tar.xz"
+       KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+fi
+
+DESCRIPTION="Tool for communicating over JTAG with flash chips, CPUs, and many 
more"
+HOMEPAGE="https://urjtag.sourceforge.net/";
+
+LICENSE="GPL-2"
+SLOT="0"
+
+IUSE="ftdi ftd2xx python readline usb"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+DEPEND="ftdi? ( dev-embedded/libftdi:1 )
+       ftd2xx? ( dev-embedded/libftd2xx )
+       python? ( ${PYTHON_DEPS} )
+       readline? ( sys-libs/readline:= )
+       usb? ( virtual/libusb:1 )"
+RDEPEND="${DEPEND}"
+BDEPEND="
+       python? ( dev-python/setuptools[${PYTHON_USEDEP}] )
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-2021.03-fix-python-setup.patch"
+)
+
+src_prepare() {
+       default
+
+       if [[ ${PV} == "9999" ]] ; then
+               mkdir -p m4 || die
+               eautopoint
+               eautoreconf
+       fi
+}
+
+src_configure() {
+       econf \
+               --disable-werror \
+               --disable-python \
+               $(use_with readline) \
+               $(use_with ftdi libftdi) \
+               $(use_with ftd2xx) \
+               $(use_with usb libusb 1.0)
+}
+
+src_compile() {
+       use python && python_copy_sources
+
+       emake
+}
+
+src_install() {
+       default
+
+       if use python; then
+               installation() {
+                       cd bindings/python || die
+                       ln -s "${S}"/src/.libs ../../src/.libs || die
+                       "${EPYTHON}" setup.py install \
+                               --root="${D}" \
+                               --prefix="${EPREFIX}/usr" || die
+               }
+               python_foreach_impl run_in_build_dir installation
+               python_foreach_impl python_optimize
+       fi
+
+       find "${ED}" -name '*.la' -delete || die
+}

Reply via email to