From 80764d3e5a9fc38d14130ca7b8d72e85e9da5ca0 Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Mon, 26 Jul 2021 13:17:22 +0300 Subject: [PATCH] borgbackup: force use distutils instead of packaging Should fix https://github.com/termux/termux-packages/issues/7174 --- packages/borgbackup/build.sh | 1 + packages/borgbackup/use-distutils.patch | 65 +++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 packages/borgbackup/use-distutils.patch diff --git a/packages/borgbackup/build.sh b/packages/borgbackup/build.sh index 29354880f..7e7b39c64 100644 --- a/packages/borgbackup/build.sh +++ b/packages/borgbackup/build.sh @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Deduplicating and compressing backup program" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_MAINTAINER="@termux" 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_SHA256=7ab924fc017b24929bedceba0dcce16d56f9868bf9b5050d2aae2eb080671674 TERMUX_PKG_DEPENDS="libacl, liblz4, openssl, python, zstd" diff --git a/packages/borgbackup/use-distutils.patch b/packages/borgbackup/use-distutils.patch new file mode 100644 index 000000000..06560c689 --- /dev/null +++ b/packages/borgbackup/use-distutils.patch @@ -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(