public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/3] distutils-r1.eclass: Strip LICENSE* & COPYING* from PEP517 dist-info
@ 2022-01-22 20:57 Michał Górny
  2022-01-22 20:57 ` [gentoo-dev] [PATCH 2/3] distutils-r1.eclass: Fix prefix paths Michał Górny
  2022-01-22 20:57 ` [gentoo-dev] [PATCH 3/3] distutils-r1.eclass: Link to installer +x fix Michał Górny
  0 siblings, 2 replies; 3+ messages in thread
From: Michał Górny @ 2022-01-22 20:57 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

The .dist-info metadata installed by PEP517 packages contains a full
copy of the license.  Strip that following the Gentoo policy.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/distutils-r1.eclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index a9c86ef55124..f2804defb818 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -977,6 +977,11 @@ distutils-r1_python_compile() {
 			chmod +x "${root}"/usr/bin/* || die
 		fi
 
+		# remove installed licenses
+		find "${root}$(python_get_sitedir)" \
+			'(' -path '*.dist-info/COPYING*' -o \
+			-path '*.dist-info/LICENSE*' ')' -delete || die
+
 		# clean the build tree; otherwise we may end up with PyPy3
 		# extensions duplicated into CPython dists
 		if [[ ${DISTUTILS_USE_PEP517:-setuptools} == setuptools ]]; then
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-dev] [PATCH 2/3] distutils-r1.eclass: Fix prefix paths
  2022-01-22 20:57 [gentoo-dev] [PATCH 1/3] distutils-r1.eclass: Strip LICENSE* & COPYING* from PEP517 dist-info Michał Górny
@ 2022-01-22 20:57 ` Michał Górny
  2022-01-22 20:57 ` [gentoo-dev] [PATCH 3/3] distutils-r1.eclass: Link to installer +x fix Michał Górny
  1 sibling, 0 replies; 3+ messages in thread
From: Michał Górny @ 2022-01-22 20:57 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/distutils-r1.eclass | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index f2804defb818..2c75daab14cc 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -973,8 +973,8 @@ distutils-r1_python_compile() {
 
 		# TODO: workaround for a bug in installer; remove once we depend
 		# on a properly fixed version
-		if [[ -d ${root}/usr/bin ]]; then
-			chmod +x "${root}"/usr/bin/* || die
+		if [[ -d ${root}${EPREFIX}/usr/bin ]]; then
+			chmod +x "${root}${EPREFIX}"/usr/bin/* || die
 		fi
 
 		# remove installed licenses
@@ -989,11 +989,11 @@ distutils-r1_python_compile() {
 		fi
 
 		# enable venv magic inside the install tree
-		mkdir -p "${root}"/usr/bin || die
-		ln -s "${PYTHON}" "${root}/usr/bin/${EPYTHON}" || die
-		ln -s "${EPYTHON}" "${root}/usr/bin/python3" || die
-		ln -s "${EPYTHON}" "${root}/usr/bin/python" || die
-		cat > "${root}"/usr/pyvenv.cfg <<-EOF || die
+		mkdir -p "${root}${EPREFIX}"/usr/bin || die
+		ln -s "${PYTHON}" "${root}${EPREFIX}/usr/bin/${EPYTHON}" || die
+		ln -s "${EPYTHON}" "${root}${EPREFIX}/usr/bin/python3" || die
+		ln -s "${EPYTHON}" "${root}${EPREFIX}/usr/bin/python" || die
+		cat > "${root}${EPREFIX}"/usr/pyvenv.cfg <<-EOF || die
 			include-system-site-packages = true
 		EOF
 	fi
@@ -1115,11 +1115,11 @@ distutils-r1_python_install() {
 		[[ -d ${rscriptdir} ]] &&
 			die "${rscriptdir} should not exist!"
 		# remove venv magic
-		rm "${root}"/usr/{pyvenv.cfg,bin/{python,python3,${EPYTHON}}} || die
-		find "${root}"/usr/bin -empty -delete || die
-		if [[ ! ${DISTUTILS_SINGLE_IMPL} && -d ${root}/usr/bin ]]; then
+		rm "${root}${EPREFIX}"/usr/{pyvenv.cfg,bin/{python,python3,${EPYTHON}}} || die
+		find "${root}${EPREFIX}"/usr/bin -empty -delete || die
+		if [[ ! ${DISTUTILS_SINGLE_IMPL} && -d ${root}${EPREFIX}/usr/bin ]]; then
 			mkdir -p "${rscriptdir%/*}" || die
-			mv "${root}/usr/bin" "${rscriptdir}" || die
+			mv "${root}${EPREFIX}/usr/bin" "${rscriptdir}" || die
 		fi
 	else
 		local root=${D%/}/_${EPYTHON}
@@ -1189,8 +1189,8 @@ distutils-r1_python_install() {
 	local shopt_save=$(shopt -p nullglob)
 	shopt -s nullglob
 	local pypy_dirs=(
-		"${root}/usr/$(get_libdir)"/pypy*/share
-		"${root}/usr/lib"/pypy*/share
+		"${root}${EPREFIX}/usr/$(get_libdir)"/pypy*/share
+		"${root}${EPREFIX}/usr/lib"/pypy*/share
 	)
 	${shopt_save}
 
@@ -1249,7 +1249,7 @@ distutils-r1_run_phase() {
 	fi
 
 	if [[ ${DISTUTILS_USE_PEP517} ]]; then
-		local -x PATH=${BUILD_DIR}/install/usr/bin:${PATH}
+		local -x PATH=${BUILD_DIR}/install${EPREFIX}/usr/bin:${PATH}
 	else
 		local -x PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}"
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-dev] [PATCH 3/3] distutils-r1.eclass: Link to installer +x fix
  2022-01-22 20:57 [gentoo-dev] [PATCH 1/3] distutils-r1.eclass: Strip LICENSE* & COPYING* from PEP517 dist-info Michał Górny
  2022-01-22 20:57 ` [gentoo-dev] [PATCH 2/3] distutils-r1.eclass: Fix prefix paths Michał Górny
@ 2022-01-22 20:57 ` Michał Górny
  1 sibling, 0 replies; 3+ messages in thread
From: Michał Górny @ 2022-01-22 20:57 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/distutils-r1.eclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 2c75daab14cc..a91442459346 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -973,6 +973,7 @@ distutils-r1_python_compile() {
 
 		# TODO: workaround for a bug in installer; remove once we depend
 		# on a properly fixed version
+		# https://github.com/pradyunsg/installer/commit/245896289a590bd9be505bd061d4f49372948a16
 		if [[ -d ${root}${EPREFIX}/usr/bin ]]; then
 			chmod +x "${root}${EPREFIX}"/usr/bin/* || die
 		fi
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-22 20:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-22 20:57 [gentoo-dev] [PATCH 1/3] distutils-r1.eclass: Strip LICENSE* & COPYING* from PEP517 dist-info Michał Górny
2022-01-22 20:57 ` [gentoo-dev] [PATCH 2/3] distutils-r1.eclass: Fix prefix paths Michał Górny
2022-01-22 20:57 ` [gentoo-dev] [PATCH 3/3] distutils-r1.eclass: Link to installer +x fix Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox