Commit 843ba193 authored by Natanael Copa's avatar Natanael Copa

main/abuild: upgrade to 3.8.0_rc3

parent 048dbb01
From ac3ee42458ebb6204c75135cbeb30201777e4116 Mon Sep 17 00:00:00 2001
From: Leo <thinkabit.ukim@gmail.com>
Date: Thu, 8 Aug 2019 19:01:39 -0300
Subject: [PATCH 1/2] feat(abuild): add support for pyX.Y providers
Now all python packages that install python modules under
/usr/lib/pythonX.Y/site-packages will have a provider that indicates
their MAJOR (X) and MINOR (Y) versions.
pyX maps to the MAJOR version of the package, its objective is to allow
users to quickly install a python module without having to search around
for the correct package, doing `apk add py3.9:foo` will install whatever
packages provides the foo module.
The directories checked only go one level deep, so
'/usr/lib/python3.9/site-packages/date' will generate
py3:date=$pkgver-r$pkgrel.
files ending with .py also count and are added with their .py prefix
stripped away. so '/usr/lib/python3.9/site-packages/six.py' will
generate py3:six=$pkgver-r$pkgrel.
The reason for doing this is the same as creating pc:, so: and cmd:, it
is more reliable and robust to depened on what we known of what the package
provides than to try to guess via the pkgname.
Co-authored-by: Chloe Kudryavtsev <toast@toast.cafe>
---
abuild.in | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/abuild.in b/abuild.in
index 303834c..aad4223 100644
--- a/abuild.in
+++ b/abuild.in
@@ -1225,6 +1225,46 @@ prepare_command_provides() {
done
}
+prepare_py_provides() {
+ local dir="${subpkgdir:-$pkgdir}" py_providers=""
+ options_has "!tracedeps" && return 0
+ cd "$dir" || return 1
+
+ # Find all directories under site-packages, ignore __pycache__ and
+ # .egg-info packages, store the basename with the proper pyX.Y prefix
+ # one per-line
+ py_providers="$(find 'usr/lib/python'*/site-packages \
+ -print0 -mindepth 1 -maxdepth 1 \
+ -type f -iname '*.py' -o -type d \
+ 2>/dev/null | xargs -0 -I '{}' sh -c '
+ d="{}"
+
+ # Check if we were given a directory then check if there
+ # is a file called __init__.py inside, this is required
+ # to import modules, if there is no __init__.py then the
+ # installed directory is not actually a module, this is a
+ # special case for packages that use c-extensions and
+ # install their .c and .h files to $sitelib.
+ if [ -d "$d" ] && [ ! -f "$d"/__init__.py ]; then
+ exit 0
+ fi
+
+ # Find out which version of python we are building for
+ # this will find out by looking at the MAJOR and MINOR
+ # versions in /usr/lib/pythonMAJOR.MINOR
+ pyver="${d##*usr/lib/python}"
+ pyver="${pyver%%/*}"
+
+ # Strip the .py prefix if it exists
+ d="${d%%.py*}"
+
+ echo "py$pyver:${d##*/}"
+ ')"
+ local i; for i in $py_providers; do
+ echo "$i=$pkgver-r$pkgrel" >> "$controldir"/.provides-py
+ done
+}
+
# check if dir has arch specific binaries
dir_has_arch_binaries() {
local dir="$1"
@@ -1294,6 +1334,7 @@ prepare_package() {
&& prepare_symlinks \
&& prepare_pkgconfig_provides \
&& prepare_command_provides \
+ && prepare_py_provides \
|| return 1
archcheck
}
@@ -1447,6 +1488,10 @@ trace_apk_deps() {
sed 's/^/provides = cmd:/' "$dir"/.provides-command | sort -u \
>> "$dir"/.PKGINFO
fi
+ if [ -f "$dir"/.provides-py ]; then
+ sed 's/^/provides = /' "$dir"/.provides-py | sort -u \
+ >> "$dir"/.PKGINFO
+ fi
[ -z "$autodeps" ] && return 0
for i in $autodeps; do
echo "depend = $i"
--
2.31.1
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=abuild
pkgver=3.8.0_rc2
pkgver=3.8.0_rc3
_ver=${pkgver%_git*}
pkgrel=1
pkgrel=0
pkgdesc="Script to build Alpine Packages"
url="https://git.alpinelinux.org/cgit/abuild/"
arch="all"
......@@ -27,7 +27,6 @@ subpackages="
options="suid"
pkggroups="abuild"
source="https://git.alpinelinux.org/abuild/snapshot/abuild-$pkgver.tar.xz
0001-feat-abuild-add-support-for-pyX.Y-providers.patch
"
builddir="$srcdir"/abuild-$pkgver
......@@ -85,6 +84,5 @@ _rootbld() {
}
sha512sums="
8e272666403ffb11a6d565e271754fa7b7ce90f5e746c8f5bd80694ece6786a12d27372d25880fe07e03bef18b3690e89e7a5a761766599a575c8db07e365b65 abuild-3.8.0_rc2.tar.xz
3cb6d4f5ad4f68924115562a20c9ea5cc728f1378a5c884a923b4dcb8260d0b9126c47f69d6b3588abba7cfdb3c45b857d757d4f82437d94ab022be4ed1b0c06 0001-feat-abuild-add-support-for-pyX.Y-providers.patch
57f50f7b037a0e64bf4653b71525b4d4e922438a2a6ad965669b620efdfbfb2855e82a1d59e6c69d59a37e7c61a4998a4686bfc6fa8357551d427e517201236c abuild-3.8.0_rc3.tar.xz
"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment