From af4666896507e86048fd049fe699a4b99c658cbd Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Wed, 11 Mar 2020 10:36:18 -0400 Subject: app-backup/borgbackup: use system msgpack Package-Manager: Portage-2.3.89, Repoman-2.3.20 Signed-off-by: Anthony G. Basile --- app-backup/borgbackup/borgbackup-1.1.11-r1.ebuild | 52 ++++++++++ app-backup/borgbackup/borgbackup-1.1.11.ebuild | 52 ---------- .../files/borgbackup-1.1.11-unbundle-msgpack.patch | 110 +++++++++++++++++++++ 3 files changed, 162 insertions(+), 52 deletions(-) create mode 100644 app-backup/borgbackup/borgbackup-1.1.11-r1.ebuild delete mode 100644 app-backup/borgbackup/borgbackup-1.1.11.ebuild create mode 100644 app-backup/borgbackup/files/borgbackup-1.1.11-unbundle-msgpack.patch (limited to 'app-backup') diff --git a/app-backup/borgbackup/borgbackup-1.1.11-r1.ebuild b/app-backup/borgbackup/borgbackup-1.1.11-r1.ebuild new file mode 100644 index 000000000000..822bb8bafab7 --- /dev/null +++ b/app-backup/borgbackup/borgbackup-1.1.11-r1.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{6,7} ) + +inherit distutils-r1 + +if [[ ${PV} == "9999" ]] ; then + EGIT_REPO_URI="https://github.com/${PN}/borg.git" + inherit git-r3 +else + SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +DESCRIPTION="Deduplicating backup program with compression and authenticated encryption" +HOMEPAGE="https://borgbackup.readthedocs.io/" + +LICENSE="BSD" +SLOT="0" +IUSE="libressl" + +# Unfortunately we have a file conflict with app-office/borg, bug #580402 +RDEPEND=" + !!app-office/borg + app-arch/lz4 + virtual/acl + dev-python/llfuse[${PYTHON_USEDEP}] + ~dev-python/msgpack-0.5.6[${PYTHON_USEDEP}] + dev-python/pyzmq[${PYTHON_USEDEP}] + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) +" + +DEPEND=" + dev-python/setuptools_scm[${PYTHON_USEDEP}] + dev-python/cython[${PYTHON_USEDEP}] + ${RDEPEND} +" + +python_prepare_all() { + rm -rf src/borg/algorithms/msgpack + eapply "${FILESDIR}"/${P}-unbundle-msgpack.patch + distutils-r1_python_prepare_all +} + +src_install() { + distutils-r1_src_install + doman docs/man/* +} diff --git a/app-backup/borgbackup/borgbackup-1.1.11.ebuild b/app-backup/borgbackup/borgbackup-1.1.11.ebuild deleted file mode 100644 index 644e3a093322..000000000000 --- a/app-backup/borgbackup/borgbackup-1.1.11.ebuild +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{6,7} ) - -inherit distutils-r1 - -if [[ ${PV} == "9999" ]] ; then - EGIT_REPO_URI="https://github.com/${PN}/borg.git" - inherit git-r3 -else - SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" - KEYWORDS="~amd64 ~x86" -fi - -DESCRIPTION="Deduplicating backup program with compression and authenticated encryption" -HOMEPAGE="https://borgbackup.readthedocs.io/" - -LICENSE="BSD" -SLOT="0" -IUSE="libressl" - -# Unfortunately we have a file conflict with app-office/borg, bug #580402 -RDEPEND=" - !!app-office/borg - app-arch/lz4 - virtual/acl - dev-python/llfuse[${PYTHON_USEDEP}] - ~dev-python/msgpack-0.5.6[${PYTHON_USEDEP}] - dev-python/pyzmq[${PYTHON_USEDEP}] - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl:0= ) -" - -DEPEND=" - dev-python/setuptools_scm[${PYTHON_USEDEP}] - dev-python/cython[${PYTHON_USEDEP}] - ${RDEPEND} -" - -python_prepare_all() { - # allow use of new (renamed) msgpack - sed -i "s|'msgpack-python.*',||g" setup.py || die - distutils-r1_python_prepare_all -} - -src_install() { - distutils-r1_src_install - doman docs/man/* -} diff --git a/app-backup/borgbackup/files/borgbackup-1.1.11-unbundle-msgpack.patch b/app-backup/borgbackup/files/borgbackup-1.1.11-unbundle-msgpack.patch new file mode 100644 index 000000000000..85b612af2370 --- /dev/null +++ b/app-backup/borgbackup/files/borgbackup-1.1.11-unbundle-msgpack.patch @@ -0,0 +1,110 @@ +diff -Naur borgbackup-1.1.11.orig/setup.cfg borgbackup-1.1.11/setup.cfg +--- borgbackup-1.1.11.orig/setup.cfg 2020-03-07 18:44:15.000000000 -0500 ++++ borgbackup-1.1.11/setup.cfg 2020-03-11 10:28:25.168481822 -0400 +@@ -6,7 +6,7 @@ + F401,F405,F811, + W504 + max-line-length = 255 +-exclude = build,dist,.git,.idea,.cache,.tox,docs/conf.py,src/borg/algorithms/msgpack ++exclude = build,dist,.git,.idea,.cache,.tox,docs/conf.py + + [egg_info] + tag_build = +diff -Naur borgbackup-1.1.11.orig/setup.py borgbackup-1.1.11/setup.py +--- borgbackup-1.1.11.orig/setup.py 2020-03-07 18:32:06.000000000 -0500 ++++ borgbackup-1.1.11/setup.py 2020-03-11 10:28:15.568759338 -0400 +@@ -25,8 +25,6 @@ + # True: use the shared libb2 from the system, False: use the bundled blake2 code + prefer_system_libb2 = True + +-# prefer_system_msgpack is another option, but you need to set it in src/borg/helpers.py. +- + min_python = (3, 4) + my_python = sys.version_info + +@@ -79,8 +77,6 @@ + platform_syncfilerange_source = 'src/borg/platform/syncfilerange.pyx' + platform_darwin_source = 'src/borg/platform/darwin.pyx' + platform_freebsd_source = 'src/borg/platform/freebsd.pyx' +-msgpack_packer_source = 'src/borg/algorithms/msgpack/_packer.pyx' +-msgpack_unpacker_source = 'src/borg/algorithms/msgpack/_unpacker.pyx' + + cython_c_sources = [ + # these .pyx will get compiled to .c +@@ -98,12 +94,6 @@ + platform_darwin_source, + ] + +-cython_cpp_sources = [ +- # these .pyx will get compiled to .cpp +- msgpack_packer_source, +- msgpack_unpacker_source, +-] +- + try: + from Cython.Distutils import build_ext + import Cython.Compiler.Main as cython_compiler +@@ -133,8 +123,6 @@ + 'src/borg/platform/syncfilerange.c', + 'src/borg/platform/freebsd.c', + 'src/borg/platform/darwin.c', +- 'src/borg/algorithms/msgpack/_packer.cpp', +- 'src/borg/algorithms/msgpack/_unpacker.cpp', + ]) + super().make_distribution() + +@@ -155,14 +143,12 @@ + platform_freebsd_source = platform_freebsd_source.replace('.pyx', '.c') + platform_darwin_source = platform_darwin_source.replace('.pyx', '.c') + +- msgpack_packer_source = msgpack_packer_source.replace('.pyx', '.cpp') +- msgpack_unpacker_source = msgpack_unpacker_source.replace('.pyx', '.cpp') + + from distutils.command.build_ext import build_ext + if not on_rtd and not all(os.path.exists(path) for path in [ + compress_source, crypto_ll_source, chunker_source, hashindex_source, item_source, checksums_source, + platform_posix_source, platform_linux_source, platform_syncfilerange_source, platform_freebsd_source, platform_darwin_source, +- msgpack_packer_source, msgpack_unpacker_source]): ++ ]): + raise ImportError('The GIT version of Borg needs Cython. Install Cython or use a released version.') + + +@@ -805,26 +791,7 @@ + system_prefix=libb2_prefix, system=libb2_system, + **crypto_ext_kwargs) + +- msgpack_endian = '__BIG_ENDIAN__' if (sys.byteorder == 'big') else '__LITTLE_ENDIAN__' +- msgpack_macros = [(msgpack_endian, '1')] +- msgpack_packer_ext_kwargs = dict( +- sources=[msgpack_packer_source], +- include_dirs=include_dirs, +- library_dirs=library_dirs, +- define_macros=msgpack_macros, +- language='c++', +- ) +- msgpack_unpacker_ext_kwargs = dict( +- sources=[msgpack_unpacker_source], +- include_dirs=include_dirs, +- library_dirs=library_dirs, +- define_macros=msgpack_macros, +- language='c++', +- ) +- + ext_modules += [ +- Extension('borg.algorithms.msgpack._packer', **msgpack_packer_ext_kwargs), +- Extension('borg.algorithms.msgpack._unpacker', **msgpack_unpacker_ext_kwargs), + Extension('borg.compress', **compress_ext_kwargs), + Extension('borg.crypto.low_level', **crypto_ext_kwargs), + Extension('borg.hashindex', [hashindex_source]), +diff -Naur borgbackup-1.1.11.orig/src/borg/helpers.py borgbackup-1.1.11/src/borg/helpers.py +--- borgbackup-1.1.11.orig/src/borg/helpers.py 2020-03-07 18:32:06.000000000 -0500 ++++ borgbackup-1.1.11/src/borg/helpers.py 2020-03-11 10:28:42.519980213 -0400 +@@ -55,7 +55,7 @@ + # any feedback related to issues caused by this will be ignored. + # - especially, it is known that msgpack 0.6.x does NOT work for borg 1.1.x. + +-prefer_system_msgpack = False ++prefer_system_msgpack = True + + try: + if prefer_system_msgpack: -- cgit v1.2.3-18-g5258