borgbackup: force use distutils instead of packaging

Should fix https://github.com/termux/termux-packages/issues/7174
This commit is contained in:
Leonid Pliushch 2021-07-26 13:17:22 +03:00
parent 70ab9c5cf4
commit 80764d3e5a
No known key found for this signature in database
GPG Key ID: 45F2964132545795
2 changed files with 66 additions and 0 deletions

View File

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Deduplicating and compressing backup program"
TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_LICENSE="BSD 3-Clause"
TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.1.17 TERMUX_PKG_VERSION=1.1.17
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/borgbackup/borg/releases/download/${TERMUX_PKG_VERSION}/borgbackup-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SRCURL=https://github.com/borgbackup/borg/releases/download/${TERMUX_PKG_VERSION}/borgbackup-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=7ab924fc017b24929bedceba0dcce16d56f9868bf9b5050d2aae2eb080671674 TERMUX_PKG_SHA256=7ab924fc017b24929bedceba0dcce16d56f9868bf9b5050d2aae2eb080671674
TERMUX_PKG_DEPENDS="libacl, liblz4, openssl, python, zstd" TERMUX_PKG_DEPENDS="libacl, liblz4, openssl, python, zstd"

View File

@ -0,0 +1,65 @@
Do not remove this patch unless you know what you are doing!
We don't have module "packaging" packaged and thus cannot use it without
installing through "pip". But for stable packages we cannot use it in
postinst script to add missing dependencies.
So if you decide to drop this patch:
* Add python3-packaging to termux-packages.
* Alternatively: create a postinst deb script (pip3 install packaging)
and move borgbackup to https://github.com/termux/unstable-packages
diff --git a/setup.py b/setup.py
index 7ad8f814..5a642fff 100644
--- a/setup.py
+++ b/setup.py
@@ -11,8 +11,9 @@
multiprocessing = None
from setuptools.command.build_ext import build_ext
-from setuptools import setup, find_packages, Extension, Command
+from setuptools import setup, find_packages, Extension
from setuptools.command.sdist import sdist
+from distutils.command.clean import clean
try:
from Cython.Build import cythonize
@@ -137,16 +138,9 @@ def rm(file):
pass
-class Clean(Command):
- user_options = []
-
- def initialize_options(self):
- pass
-
- def finalize_options(self):
- pass
-
+class Clean(clean):
def run(self):
+ super().run()
for source in cython_sources:
genc = source.replace('.pyx', '.c')
rm(genc)
@@ -160,7 +154,7 @@ def run(self):
'build_usage': setup_docs.build_usage,
'build_man': setup_docs.build_man,
'sdist': Sdist,
- 'clean2': Clean,
+ 'clean': Clean,
}
ext_modules = []
@@ -227,8 +221,8 @@ def members_appended(*ds):
# sometimes there's no need to cythonize
# this breaks chained commands like 'clean sdist'
- cythonizing = len(sys.argv) > 1 and sys.argv[1] not in (
- ('clean', 'clean2', 'egg_info', '--help-commands', '--version')) and '--help' not in sys.argv[1:]
+ cythonizing = len(sys.argv) > 1 and sys.argv[1] not in ('clean', 'egg_info', '--help-commands', '--version') \
+ and '--help' not in sys.argv[1:]
if cythonize and cythonizing:
cython_opts = dict(