git: e1e1e6f6c1a2 - main - devel/py-donut-shellcode: Fix build on i386

From: Jose Alonso Cardenas Marquez <acm_at_FreeBSD.org>
Date: Tue, 16 May 2023 05:09:11 UTC
The branch main has been updated by acm:

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

commit e1e1e6f6c1a215dc3af4544a1eb042d8efc47838
Author:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
AuthorDate: 2023-05-16 05:07:46 +0000
Commit:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
CommitDate: 2023-05-16 05:07:46 +0000

    devel/py-donut-shellcode: Fix build on i386
    
    Reported by:    pkg-fallout
---
 devel/py-donut-shellcode/Makefile             |  5 ++++-
 devel/py-donut-shellcode/files/patch-setup.py | 22 ++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/devel/py-donut-shellcode/Makefile b/devel/py-donut-shellcode/Makefile
index 8b086bcf069f..e7023195ae72 100644
--- a/devel/py-donut-shellcode/Makefile
+++ b/devel/py-donut-shellcode/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	donut-shellcode
 DISTVERSION=	1.0.2
+PORTREVISION=	1
 CATEGORIES=	devel python
 MASTER_SITES=	PYPI
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -10,7 +11,9 @@ WWW=		https://github.com/TheWover/donut
 
 LICENSE=	BSD3CLAUSE
 
-USES=		python:3.6+
+USES=		dos2unix python:3.6+
 USE_PYTHON=	distutils autoplist
 
+DOS2UNIX_GLOB=	*.py
+
 .include <bsd.port.mk>
diff --git a/devel/py-donut-shellcode/files/patch-setup.py b/devel/py-donut-shellcode/files/patch-setup.py
new file mode 100644
index 000000000000..ac211d79f3e1
--- /dev/null
+++ b/devel/py-donut-shellcode/files/patch-setup.py
@@ -0,0 +1,22 @@
+--- setup.py.orig	2023-05-16 05:00:53 UTC
++++ setup.py
+@@ -1,10 +1,18 @@
+ from setuptools import Extension, setup
+ import sys
++import platform
+ 
+ with open("README.md", "r") as fh:
+     long_description = fh.read()
+ 
+-static_libraries   = ['aplib64']
++if platform.system() == 'FreeBSD':
++    if platform.machine() == 'i386':
++        static_libraries   = ['aplib32']
++    elif platform.machine() == 'amd64':
++        static_libraries   = ['aplib64']
++else:
++    static_libraries   = ['aplib64']
++
+ static_lib_dir     = 'lib'
+ libraries          = []
+ library_dirs       = ['lib']