Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-backup/borgbackup/files/, app-backup/borgbackup/
Date: Wed, 11 Mar 2020 14:36:41
Message-Id: 1583937391.af4666896507e86048fd049fe699a4b99c658cbd.blueness@gentoo
1 commit: af4666896507e86048fd049fe699a4b99c658cbd
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 11 14:36:18 2020 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 11 14:36:31 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af466689
7
8 app-backup/borgbackup: use system msgpack
9
10 Package-Manager: Portage-2.3.89, Repoman-2.3.20
11 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
12
13 ...p-1.1.11.ebuild => borgbackup-1.1.11-r1.ebuild} | 4 +-
14 .../files/borgbackup-1.1.11-unbundle-msgpack.patch | 110 +++++++++++++++++++++
15 2 files changed, 112 insertions(+), 2 deletions(-)
16
17 diff --git a/app-backup/borgbackup/borgbackup-1.1.11.ebuild b/app-backup/borgbackup/borgbackup-1.1.11-r1.ebuild
18 similarity index 92%
19 rename from app-backup/borgbackup/borgbackup-1.1.11.ebuild
20 rename to app-backup/borgbackup/borgbackup-1.1.11-r1.ebuild
21 index 644e3a09332..822bb8bafab 100644
22 --- a/app-backup/borgbackup/borgbackup-1.1.11.ebuild
23 +++ b/app-backup/borgbackup/borgbackup-1.1.11-r1.ebuild
24 @@ -41,8 +41,8 @@ DEPEND="
25 "
26
27 python_prepare_all() {
28 - # allow use of new (renamed) msgpack
29 - sed -i "s|'msgpack-python.*',||g" setup.py || die
30 + rm -rf src/borg/algorithms/msgpack
31 + eapply "${FILESDIR}"/${P}-unbundle-msgpack.patch
32 distutils-r1_python_prepare_all
33 }
34
35
36 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
37 new file mode 100644
38 index 00000000000..85b612af237
39 --- /dev/null
40 +++ b/app-backup/borgbackup/files/borgbackup-1.1.11-unbundle-msgpack.patch
41 @@ -0,0 +1,110 @@
42 +diff -Naur borgbackup-1.1.11.orig/setup.cfg borgbackup-1.1.11/setup.cfg
43 +--- borgbackup-1.1.11.orig/setup.cfg 2020-03-07 18:44:15.000000000 -0500
44 ++++ borgbackup-1.1.11/setup.cfg 2020-03-11 10:28:25.168481822 -0400
45 +@@ -6,7 +6,7 @@
46 + F401,F405,F811,
47 + W504
48 + max-line-length = 255
49 +-exclude = build,dist,.git,.idea,.cache,.tox,docs/conf.py,src/borg/algorithms/msgpack
50 ++exclude = build,dist,.git,.idea,.cache,.tox,docs/conf.py
51 +
52 + [egg_info]
53 + tag_build =
54 +diff -Naur borgbackup-1.1.11.orig/setup.py borgbackup-1.1.11/setup.py
55 +--- borgbackup-1.1.11.orig/setup.py 2020-03-07 18:32:06.000000000 -0500
56 ++++ borgbackup-1.1.11/setup.py 2020-03-11 10:28:15.568759338 -0400
57 +@@ -25,8 +25,6 @@
58 + # True: use the shared libb2 from the system, False: use the bundled blake2 code
59 + prefer_system_libb2 = True
60 +
61 +-# prefer_system_msgpack is another option, but you need to set it in src/borg/helpers.py.
62 +-
63 + min_python = (3, 4)
64 + my_python = sys.version_info
65 +
66 +@@ -79,8 +77,6 @@
67 + platform_syncfilerange_source = 'src/borg/platform/syncfilerange.pyx'
68 + platform_darwin_source = 'src/borg/platform/darwin.pyx'
69 + platform_freebsd_source = 'src/borg/platform/freebsd.pyx'
70 +-msgpack_packer_source = 'src/borg/algorithms/msgpack/_packer.pyx'
71 +-msgpack_unpacker_source = 'src/borg/algorithms/msgpack/_unpacker.pyx'
72 +
73 + cython_c_sources = [
74 + # these .pyx will get compiled to .c
75 +@@ -98,12 +94,6 @@
76 + platform_darwin_source,
77 + ]
78 +
79 +-cython_cpp_sources = [
80 +- # these .pyx will get compiled to .cpp
81 +- msgpack_packer_source,
82 +- msgpack_unpacker_source,
83 +-]
84 +-
85 + try:
86 + from Cython.Distutils import build_ext
87 + import Cython.Compiler.Main as cython_compiler
88 +@@ -133,8 +123,6 @@
89 + 'src/borg/platform/syncfilerange.c',
90 + 'src/borg/platform/freebsd.c',
91 + 'src/borg/platform/darwin.c',
92 +- 'src/borg/algorithms/msgpack/_packer.cpp',
93 +- 'src/borg/algorithms/msgpack/_unpacker.cpp',
94 + ])
95 + super().make_distribution()
96 +
97 +@@ -155,14 +143,12 @@
98 + platform_freebsd_source = platform_freebsd_source.replace('.pyx', '.c')
99 + platform_darwin_source = platform_darwin_source.replace('.pyx', '.c')
100 +
101 +- msgpack_packer_source = msgpack_packer_source.replace('.pyx', '.cpp')
102 +- msgpack_unpacker_source = msgpack_unpacker_source.replace('.pyx', '.cpp')
103 +
104 + from distutils.command.build_ext import build_ext
105 + if not on_rtd and not all(os.path.exists(path) for path in [
106 + compress_source, crypto_ll_source, chunker_source, hashindex_source, item_source, checksums_source,
107 + platform_posix_source, platform_linux_source, platform_syncfilerange_source, platform_freebsd_source, platform_darwin_source,
108 +- msgpack_packer_source, msgpack_unpacker_source]):
109 ++ ]):
110 + raise ImportError('The GIT version of Borg needs Cython. Install Cython or use a released version.')
111 +
112 +
113 +@@ -805,26 +791,7 @@
114 + system_prefix=libb2_prefix, system=libb2_system,
115 + **crypto_ext_kwargs)
116 +
117 +- msgpack_endian = '__BIG_ENDIAN__' if (sys.byteorder == 'big') else '__LITTLE_ENDIAN__'
118 +- msgpack_macros = [(msgpack_endian, '1')]
119 +- msgpack_packer_ext_kwargs = dict(
120 +- sources=[msgpack_packer_source],
121 +- include_dirs=include_dirs,
122 +- library_dirs=library_dirs,
123 +- define_macros=msgpack_macros,
124 +- language='c++',
125 +- )
126 +- msgpack_unpacker_ext_kwargs = dict(
127 +- sources=[msgpack_unpacker_source],
128 +- include_dirs=include_dirs,
129 +- library_dirs=library_dirs,
130 +- define_macros=msgpack_macros,
131 +- language='c++',
132 +- )
133 +-
134 + ext_modules += [
135 +- Extension('borg.algorithms.msgpack._packer', **msgpack_packer_ext_kwargs),
136 +- Extension('borg.algorithms.msgpack._unpacker', **msgpack_unpacker_ext_kwargs),
137 + Extension('borg.compress', **compress_ext_kwargs),
138 + Extension('borg.crypto.low_level', **crypto_ext_kwargs),
139 + Extension('borg.hashindex', [hashindex_source]),
140 +diff -Naur borgbackup-1.1.11.orig/src/borg/helpers.py borgbackup-1.1.11/src/borg/helpers.py
141 +--- borgbackup-1.1.11.orig/src/borg/helpers.py 2020-03-07 18:32:06.000000000 -0500
142 ++++ borgbackup-1.1.11/src/borg/helpers.py 2020-03-11 10:28:42.519980213 -0400
143 +@@ -55,7 +55,7 @@
144 + # any feedback related to issues caused by this will be ignored.
145 + # - especially, it is known that msgpack 0.6.x does NOT work for borg 1.1.x.
146 +
147 +-prefer_system_msgpack = False
148 ++prefer_system_msgpack = True
149 +
150 + try:
151 + if prefer_system_msgpack: