1
0
mirror of https://github.com/termux/termux-packages synced 2024-06-19 16:50:18 +00:00
termux-packages/packages/borgbackup/use-distutils.patch

66 lines
2.0 KiB
Diff
Raw Normal View History

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(