common/hooks: remove pycompile_version, use python_version instead

This commit is contained in:
Piotr Wójcik 2020-04-20 19:22:10 +02:00 committed by Piotr
parent 6c6ab14604
commit 8a09d89eac
30 changed files with 41 additions and 35 deletions

View File

@ -1458,17 +1458,13 @@ by blanks, Example: `pycompile_module="foo blah"`. If a python module installs a
recursively by the target python version. This differs from `pycompile_module` in that any
path may be specified, Example: `pycompile_dirs="usr/share/foo"`.
- `pycompile_version`: this variable expects the python version that is used to
byte-compile the python code (it generates the `.py[co]` files at post-install time).
By default it's set to `2.7` for `python 2.x` packages.
> NOTE: you need to define it *only* for non-Python modules.
- `python_version`: this variable expects the supported Python major version.
By default it's set to `2`. This variable is needed for multi-language
applications (e.g., the application is written in C while the command is
written in Python) or just single Python file ones that live in `/usr/bin`.
> NOTE: you need to define it *only* for non-Python modules.
Also, a set of useful variables are defined to use in the templates:
| Variable | Value |

View File

@ -27,7 +27,7 @@ unset -v font_dirs
unset -v xml_entries sgml_entries xml_catalogs sgml_catalogs
# xbps-triggers: pycompile
unset -v pycompile_version pycompile_dirs pycompile_module
unset -v pycompile_dirs pycompile_module
# xbps-triggers: dkms
unset -v dkms_modules

View File

@ -258,6 +258,7 @@ _EOF
#
# Handle python bytecode archives with pycompile trigger.
#
local pycompile_version
if [ -d ${PKGDESTDIR}/usr/lib/python* ]; then
pycompile_version="$(find ${PKGDESTDIR}/usr/lib/python* -prune -type d | grep -o '[[:digit:]]\.[[:digit:]]$')"
if [ -z "${pycompile_module}" ]; then
@ -265,8 +266,17 @@ _EOF
fi
fi
if [ -n "$python_version" ]; then
pycompile_version=${python_version}
fi
if [ "$pycompile_version" = 3 ]; then
pycompile_version=${py3_ver}
fi
if [ -n "${pycompile_dirs}" -o -n "${pycompile_module}" ]; then
echo "export pycompile_version=\"${pycompile_version:=2.7}\"" >>$tmpf
[ -n "$pycompile_version" ] || msg_error "$pkgver: byte-compilation is required, but python_version is not set\n"
echo "export pycompile_version=\"${pycompile_version}\"" >>$tmpf
if [ -n "${pycompile_dirs}" ]; then
echo "export pycompile_dirs=\"${pycompile_dirs}\"" >>$tmpf
fi

View File

@ -17,7 +17,7 @@ license="GPL-2.0-or-later"
homepage="http://kxstudio.linuxaudio.org/Applications:Carla"
distfiles="https://github.com/falkTX/Carla/archive/v${version}.tar.gz"
checksum=d0c8d8417f8cce9abe807f6359231f187d60db7121ec1dccce3b596a22ef6c41
pycompile_version=$py3_ver
python_version=3
case $XBPS_TARGET_MACHINE in
x86_64* | i686*);;

View File

@ -10,7 +10,7 @@ short_desc="Instant file search"
maintainer="DirectorX <void.directorx@protonmail.com>"
license="GPL-2"
homepage="https://github.com/dotheevo/angrysearch/"
pycompile_version="$py3_ver"
python_version=3
pycompile_dirs="usr/share/angrysearch"
distfiles="http://github.com/dotheevo/${pkgname}/archive/v${version}.tar.gz"
checksum=9a550649c3efafb26660860758f2e75702ce96a0a0c50dc34ced2967b51a843f

View File

@ -16,7 +16,7 @@ changelog="https://apps.ankiweb.net/docs/changes.html"
distfiles="https://apps.ankiweb.net/downloads/current/anki-${version}-source.tgz"
checksum=5a53760164c77d619f55107a13099cffe620566a7f610b61b6c4b52487f3bb89
pycompile_version="$py3_ver"
python_version=3
post_install() {
vlicense LICENSE

View File

@ -16,4 +16,4 @@ license="GPL-2.0-only"
homepage="https://github.com/bit-team/backintime"
distfiles="https://github.com/bit-team/backintime/releases/download/v${version}/backintime-${version}.tar.gz"
checksum=eef2aa4f43ac23fb0d45239a4bb2f7e5025afdca2ae4e6d6d9d6e722e8b17644
pycompile_version="$py3_ver"
python_version=3

View File

@ -15,4 +15,4 @@ license="GPL-2.0-only"
homepage="https://github.com/bit-team/backintime"
distfiles="https://github.com/bit-team/backintime/releases/download/v${version}/backintime-${version}.tar.gz"
checksum=eef2aa4f43ac23fb0d45239a4bb2f7e5025afdca2ae4e6d6d9d6e722e8b17644
pycompile_version="$py3_ver"
python_version=3

View File

@ -19,7 +19,7 @@ distfiles="http://download.blender.org/source/${pkgname}-${version}.tar.xz"
checksum=002adf2c51fc58a8941c87fc8e180bb1aacb73a0c223714f36d3d84da345fc65
patch_args="-Np1"
pycompile_version="$py3_ver"
python_version=3
pycompile_dirs="/usr/share/blender/$version/scripts"
archs="x86_64* i686* ppc64*"

View File

@ -4,7 +4,7 @@ version=0.9.1
revision=1
wrksrc="Cadence-${version}"
build_style=gnu-makefile
pycompile_version="$py3_ver"
python_version=3
pycompile_dirs="usr/share/cadence/src"
hostmakedepends="pkg-config qt5-host-tools python3-PyQt5-devel-tools"
makedepends="jack-devel ladish-devel pulseaudio-devel qt5-devel"

View File

@ -19,7 +19,7 @@ homepage="https://developer.linuxmint.com/projects/cinnamon-projects.html/"
distfiles="https://github.com/linuxmint/${pkgname}/archive/${version}.tar.gz"
checksum=6ae265ebea2adb2b488cbbfbc8647021bc0cabffc01e46c7cfaf8ca1a91b349a
pycompile_version="$py3_ver"
python_version=3
pycompile_dirs="/usr/share/cinnamon-screensaver"
do_check() {

View File

@ -29,7 +29,7 @@ changelog="https://raw.githubusercontent.com/linuxmint/Cinnamon/${version}/debia
distfiles="https://github.com/linuxmint/${pkgname}/archive/${version}.tar.gz"
checksum=5bc7db4e519aed8b3b76d6b68abc02be966633005a92579071a77d23d33c8af4
pycompile_version="$py3_ver"
python_version=3
pycompile_dirs="
usr/share/cinnamon/applets
usr/share/cinnamon/cinnamon-desktop-editor

View File

@ -11,7 +11,7 @@ homepage="https://gitlab.com/jeancf/etcetera"
pycompile_dirs="usr/lib/etcetera"
distfiles="https://gitlab.com/jeancf/etcetera/-/archive/${version}/etcetera-${version}.tar.gz"
checksum=3e4b7ff9095f6d311b12e30d745cc5d6b5c777f5daca7d01f7f1c46d273760c1
pycompile_version="$py3_ver"
python_version=3
conf_files="/etc/etcetera.conf"
do_install() {

View File

@ -30,7 +30,7 @@ esac
# FreeCAD help: qt5/assistant with datas in SQLite format
depends="python3-matplotlib python3-pyside2 qt5-plugin-sqlite python3-pivy"
pycompile_version="$py3_ver"
python_version=3
pycompile_dirs="usr/lib/${pkgname}/Mod usr/lib/${pkgname}/data/Mod"
short_desc="General purpose 3D CAD modeler"

View File

@ -15,4 +15,4 @@ license="GPL-2.0-or-later"
homepage="https://wiki.gnome.org/action/show/Apps/Gedit/PluginsLists"
distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
checksum=1151b955393f75b5ee59b51154fda4f1928f498fe986a5584d3cd440876a6af6
pycompile_version="$py3_ver"
python_version=3

View File

@ -19,7 +19,7 @@ homepage="https://wiki.gnome.org/Apps/Gedit"
distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
checksum=6dc38eda227d1c368e039e9bff485d0bee9a49d5f9560c387ee08f5818a4e387
shlib_provides="libgedit-3.36.so"
pycompile_version=$py3_ver
python_version=3
build_options="gir vala"
build_options_default="gir vala"

View File

@ -38,7 +38,7 @@ libglib-devel_package() {
glib-devel_package() {
depends="python3 libglib-devel>=${version}_${revision}"
short_desc+=" - development files"
pycompile_version="$py3_ver"
python_version=3
pycompile_dirs="usr/share/glib-2.0/codegen usr/share/glib-2.0/gdb"
pkg_install() {
vmove usr/bin/glib-compile-resources

View File

@ -14,7 +14,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
checksum=80beae6728c134521926affff9b2e97125749b38d38744dc901f4010ee3e7fa7
pycompile_version="$py3_ver"
python_version=3
patch_args="-Np1"
if [ "$CROSS_BUILD" ]; then

View File

@ -14,4 +14,4 @@ license="GPL-2.0-or-later, GFDL-1.1-or-later"
homepage="http://www.gtk.org/gtk-doc/"
distfiles="${GNOME_SITE}/${pkgname}/${version}/${pkgname}-${version}.tar.xz"
checksum=de0ef034fb17cb21ab0c635ec730d19746bce52984a6706e7bbec6fb5e0b907c
pycompile_version="$py3_ver"
python_version=3

View File

@ -16,7 +16,7 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
homepage="https://www.kdevelop.org/"
distfiles="${KDE_SITE}/kdevelop/${version}/src/kdev-python-${version}.tar.xz"
checksum=a87cdc7600545866f5e2cec282fcc5543e35d04bc963efada63f392c96e035ef
pycompile_version="$py3_ver"
python_version=3
post_install() {
# don't install this python2 script: generates documentation_files, useless at runtime

View File

@ -15,7 +15,7 @@ changelog="https://sw.kovidgoyal.net/kitty/changelog.html"
distfiles="https://github.com/kovidgoyal/kitty/releases/download/v${version}/kitty-${version}.tar.xz"
checksum=cd8e9f5c9932155f9d5e7f5cc72dea64bc8a509f6ff0b5fb7a72b4c79e153f8e
patch_args="-Np1"
pycompile_version="$py3_ver"
python_version=3
LDFLAGS+=" -Wl,-z,stack-size=2097152"
# TIOCSWINSZ on ppc overflows signed int, used in ioctl()

View File

@ -5,7 +5,7 @@ revision=2
archs=noarch
build_style=waf3
wrksrc="${pkgname}-v${version}"
pycompile_version="$py3_ver"
python_version=3
pycompile_dirs="usr/share/kupfer/kupfer"
configure_args="--no-update-mime --no-update-icon-cache"
hostmakedepends="intltool python3-docutils"

View File

@ -12,7 +12,7 @@ license="GPL-3.0-or-later"
homepage="http://www.theologeek.ch/manuskript"
distfiles="https://github.com/olivierkes/manuskript/archive/${version}.tar.gz"
checksum=bed0114c5d7787df07b420aa4909a7ae216e1581147058e03fda4c07deef8ef8
pycompile_version="$py3_ver"
python_version=3
do_install() {
vmkdir usr/share/manuskript

View File

@ -20,7 +20,7 @@ homepage="http://www.rhythmbox.org"
distfiles="${GNOME_SITE}/${pkgname}/${version::3}/${pkgname}-${version}.tar.xz"
checksum=ee0eb0d7d7bdf696ac9471b19ff3bea3240d63b6cb8a134bf632054af8665d90
pycompile_version="$py3_ver"
python_version=3
pycompile_dirs="/usr/lib/rhythmbox/plugins /usr/lib/rhythmbox/sample-plugins"

View File

@ -11,7 +11,7 @@ license="GPL-2.0-or-later"
homepage="http://sqlmap.org"
distfiles="https://github.com/sqlmapproject/sqlmap/archive/${version}.tar.gz"
checksum=3c3e89163c7506b4c09e8c0ee9227db007a4708f3a69a838e8a6b751379ffc49
pycompile_version="$py3_ver"
python_version=3
do_install() {
vmkdir usr/share/${pkgname}

View File

@ -13,7 +13,7 @@ license="Apache-2.0"
homepage="https://syncplay.pl/"
distfiles="https://github.com/syncplay/syncplay/archive/v${version}.tar.gz"
checksum=a9acc53a3549af89dba9a603622429095e018f8c7c2054637fecbab87b8e15e2
pycompile_version="$py3_ver"
python_version=3
post_install() {
for res in 16x16 24x24 32x32 48x48 64x64 96x96 128x128 256x256; do

View File

@ -10,7 +10,7 @@ hostmakedepends="pkg-config intltool python3-devel xmlto desktop-file-utils"
makedepends="libglib-devel cups-devel eudev-libudev-devel libusb-devel"
depends="python3-cupshelpers python3-smbc python3-gobject gir-freedesktop
libnotify gtk+3 dconf desktop-file-utils libsecret"
pycompile_version="$py3_ver"
python_version=3
pycompile_dirs="usr/share/system-config-printer"
short_desc="CUPS printer configuration tool and status applet"
maintainer="Orphaned <orphan@voidlinux.org>"

View File

@ -13,7 +13,7 @@ license="GPL-2.0-or-later"
homepage="http://treeline.bellz.org/"
distfiles="https://github.com/doug-101/TreeLine/archive/v${version}.tar.gz"
checksum=04501aeebaa1cc9eb0805fc3b7ca8305d682bbf67dd28a51b627f064c9f88a06
pycompile_version="$py3_ver"
python_version=3
do_install() {
python3 install.py -x -p /usr -b "${DESTDIR}"

View File

@ -27,7 +27,7 @@ virt-manager-tools_package() {
short_desc="Programs to create and clone virtual machines"
depends="libosinfo python3-gobject libvirt-python3 python3-urllib3 libxml2-python3 python3-requests"
pycompile_dirs="/usr/share/${sourcepkg}"
pycompile_version="$py3_ver"
python_version=3
pkg_install() {
vmove usr/bin/virt-clone
vmove usr/bin/virt-convert

View File

@ -40,7 +40,7 @@ post_install() {
znc-python3_package() {
depends="znc>=${version}_${revision}"
pycompile_version="$py3_ver"
python_version=3
pycompile_dirs="/usr/lib/znc/modpython"
short_desc+=" - python3 plugin"
pkg_install() {