git: 08ef1e8374bb - main - databases/py-dbf: Fix build with setuptools 58.0.0+

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Fri, 25 Mar 2022 13:49:43 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=08ef1e8374bbb05e9b599b2c949455a61e77350c

commit 08ef1e8374bbb05e9b599b2c949455a61e77350c
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-03-25 13:32:05 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-03-25 13:38:05 +0000

    databases/py-dbf: Fix build with setuptools 58.0.0+
    
    With hat:       python
---
 databases/py-dbf/Makefile         |  2 +-
 databases/py-dbf/files/patch-2to3 | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/databases/py-dbf/Makefile b/databases/py-dbf/Makefile
index 787ab8e1fd9c..fa696d6effc7 100644
--- a/databases/py-dbf/Makefile
+++ b/databases/py-dbf/Makefile
@@ -11,7 +11,7 @@ COMMENT=	Pure python package for reading/writing dbf files
 
 LICENSE=	BSD3CLAUSE
 
-USES=		python:3.6+
+USES=		dos2unix python:3.6+
 USE_PYTHON=	autoplist distutils
 NO_ARCH=	yes
 
diff --git a/databases/py-dbf/files/patch-2to3 b/databases/py-dbf/files/patch-2to3
new file mode 100644
index 000000000000..f9ad71a6c72a
--- /dev/null
+++ b/databases/py-dbf/files/patch-2to3
@@ -0,0 +1,13 @@
+--- dbf/_index.py.orig	2022-03-15 19:06:56 UTC
++++ dbf/_index.py
+@@ -9,8 +9,8 @@ class IndexFile(object):
+         filename += '.pdx'
+         if not os.path.exists(filename):
+             self.index_file = open(filename, 'r+b')
+-            self.index_file.write('\xea\xaf\x37\xbf'    # signature
+-                '\x00'*8                                # two non-existant lists
++            self.index_file.write('\xea\xaf\x37\xbf',   # signature
++                '\x00'*8,                               # two non-existant lists
+                 '\x00'*500)                             # and no indices
+             return
+         index_file = self.index_file = open(filename, 'r+b')