git: c3c2129c94d5 - main - devel/{p4,p4api}: Unbreak build on arm

From: Craig Leres <leres_at_FreeBSD.org>
Date: Sun, 09 Apr 2023 00:55:19 UTC
The branch main has been updated by leres:

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

commit c3c2129c94d55bb857ff2bbb07a81779efc70fd4
Author:     Craig Leres <leres@FreeBSD.org>
AuthorDate: 2023-04-09 00:54:52 +0000
Commit:     Craig Leres <leres@FreeBSD.org>
CommitDate: 2023-04-09 00:54:52 +0000

    devel/{p4,p4api}: Unbreak build on arm
    
    Also change devel/p4api to use devel/p4 files/patches and distinfo.
    
    PR:             270531
    Approved by:    antonfb@hesiod.org (maintainer)
---
 devel/p4/files/patch-Jamrules       |  6 +++---
 devel/p4/files/patch-zlib_deflate.c | 11 +++++++++++
 devel/p4api/Makefile                |  4 ++++
 devel/p4api/distinfo                |  3 ---
 devel/p4api/files/patch-Jamrules    | 28 ----------------------------
 5 files changed, 18 insertions(+), 34 deletions(-)

diff --git a/devel/p4/files/patch-Jamrules b/devel/p4/files/patch-Jamrules
index d89bc59e9d54..c63b4f543364 100644
--- a/devel/p4/files/patch-Jamrules
+++ b/devel/p4/files/patch-Jamrules
@@ -1,6 +1,6 @@
---- Jamrules.orig	2018-02-01 21:40:54 UTC
+--- Jamrules.orig	2023-01-19 09:37:52 UTC
 +++ Jamrules
-@@ -449,12 +449,11 @@
+@@ -673,12 +673,11 @@
  	# P4BIN is set to ../p4-bin (relative to P4)
  
  	SubDir AllP4 p4 ;	# where we are
@@ -14,7 +14,7 @@
  		$(BUILD)
  		$(TYPE:L) ;
  
-@@ -931,11 +930,6 @@
+@@ -1224,11 +1223,6 @@
  		OPTIM += -Wno-parentheses -Wno-switch -fwrapv ;
  
  		_mflags = ;
diff --git a/devel/p4/files/patch-zlib_deflate.c b/devel/p4/files/patch-zlib_deflate.c
new file mode 100644
index 000000000000..b1c8c81fe1de
--- /dev/null
+++ b/devel/p4/files/patch-zlib_deflate.c
@@ -0,0 +1,11 @@
+--- zlib/deflate.c.orig	2023-04-08 02:21:18 UTC
++++ zlib/deflate.c
+@@ -56,7 +56,7 @@
+  * Perforce change. Disable neon speedup (for now)
+  * on Apple M1 builds.
+ */
+-#if ( defined( OS_DARWIN ) || defined( OS_MACOSX ) ) && defined(__aarch64__)
++#if ( defined( OS_DARWIN ) || defined( OS_MACOSX ) || defined( OS_FREEBSD ) ) && defined(__aarch64__)
+ #undef __ARM_NEON__
+ #undef __ARM_NEON
+ #endif
diff --git a/devel/p4api/Makefile b/devel/p4api/Makefile
index 3cb2963f3d19..970e1f63335e 100644
--- a/devel/p4api/Makefile
+++ b/devel/p4api/Makefile
@@ -19,6 +19,10 @@ BUILD_DEPENDS=	${JAM}:devel/jam
 
 USES=		tar:tgz
 
+PATCHDIR=	${.CURDIR}/../p4/files
+
+DISTINFO_FILE=	${.CURDIR}/../p4/distinfo
+
 OPTIONS_DEFINE=	EXAMPLES
 
 WRKSRC=		${WRKDIR}/p4source-${PORTVERSION}
diff --git a/devel/p4api/distinfo b/devel/p4api/distinfo
deleted file mode 100644
index 895f00dbc4d1..000000000000
--- a/devel/p4api/distinfo
+++ /dev/null
@@ -1,3 +0,0 @@
-TIMESTAMP = 1679584778
-SHA256 (p4source-2407422.tgz) = 4355375def3f3d2256d4a92ac1b9960173e7aa97404346c0c74caf23a0905e1b
-SIZE (p4source-2407422.tgz) = 6325949
diff --git a/devel/p4api/files/patch-Jamrules b/devel/p4api/files/patch-Jamrules
deleted file mode 100644
index d89bc59e9d54..000000000000
--- a/devel/p4api/files/patch-Jamrules
+++ /dev/null
@@ -1,28 +0,0 @@
---- Jamrules.orig	2018-02-01 21:40:54 UTC
-+++ Jamrules
-@@ -449,12 +449,11 @@
- 	# P4BIN is set to ../p4-bin (relative to P4)
- 
- 	SubDir AllP4 p4 ;	# where we are
--	SubDir AllP4 p4-bin ;	# where we want to be
-+	SubDir AllP4 p4 p4-bin ;	# where we want to be
- 	SubDir P4BIN ;		# name is that
- 	SubDir AllP4 p4 ;	# back to where we started
- 
- 	EXEC_SUB_TOKENS =
--		$(OS:L)$(OSVER:EL)$(OSPLAT:EL)
- 		$(BUILD)
- 		$(TYPE:L) ;
- 
-@@ -931,11 +930,6 @@
- 		OPTIM += -Wno-parentheses -Wno-switch -fwrapv ;
- 
- 		_mflags = ;
--		switch $(OSPLAT:U)
--		{
--		case X86     : _mflags = -m32 ;
--		case X86_64  : _mflags = -m64 ;
--		}
- 
- 		$(GENFLAGS) += $(_mflags) -pipe ;
- 		LINKFLAGS   += $(_mflags) ;