git: 5a186662c86e - main - sysutils/mprocs: fix build on powerpc*

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Mon, 14 Nov 2022 00:37:09 UTC
The branch main has been updated by pkubaj:

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

commit 5a186662c86e5a319330c7d673e5dddabb7a3a2a
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2022-11-14 00:32:05 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2022-11-14 00:35:23 +0000

    sysutils/mprocs: fix build on powerpc*
    
    Similarly to misc/xplr, use the luajit from ports, since:
    1. Only openresty fork supports 64-bit PPC.
    2. All the luajit ports need to built with GCC.
---
 sysutils/mprocs/Makefile                         | 14 +++++++++++++-
 sysutils/mprocs/files/extra-patch-src_Cargo.toml | 11 +++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/sysutils/mprocs/Makefile b/sysutils/mprocs/Makefile
index 2dd9e49bc711..37b38b84d896 100644
--- a/sysutils/mprocs/Makefile
+++ b/sysutils/mprocs/Makefile
@@ -18,10 +18,22 @@ CARGO_INSTALL_PATH=	src
 
 PLIST_FILES=	bin/mprocs
 
+.include <bsd.port.pre.mk>
+
+.if ${ARCH:Mpowerpc64*}
+EXTRA_PATCHES=	${FILESDIR}/extra-patch-src_Cargo.toml
+LIB_DEPENDS=	libluajit-5.1.so:lang/luajit-openresty
+.endif
+
+.if ${ARCH} == powerpc
+EXTRA_PATCHES=	${FILESDIR}/extra-patch-src_Cargo.toml
+LIB_DEPENDS=	libluajit-5.1.so:lang/luajit
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -Ee 's/new\("make"\)/new("gmake")/' ${WRKSRC}/cargo-crates/luajit-src-*/src/lib.rs
 
 post-install:
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/mprocs
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/sysutils/mprocs/files/extra-patch-src_Cargo.toml b/sysutils/mprocs/files/extra-patch-src_Cargo.toml
new file mode 100644
index 000000000000..e7fb6605af26
--- /dev/null
+++ b/sysutils/mprocs/files/extra-patch-src_Cargo.toml
@@ -0,0 +1,11 @@
+--- src/Cargo.toml.orig	2022-11-12 22:57:03 UTC
++++ src/Cargo.toml
+@@ -43,7 +43,7 @@ indexmap = { version = "1.8.0", features = ["serde"] }
+ lazy_static = "1.4.0"
+ libc = "0.2.120"
+ log = "0.4.14"
+-mlua = { version = "0.8.3", features = ["luajit52", "vendored", "serialize"] }
++mlua = { version = "0.8.3", features = ["luajit52", "serialize"] }
+ phf = { version = "0.10.1", features = ["macros"] }
+ portable-pty = { package = "mprocs-pty", path = "../vendor/pty", version = "0.1.0" }
+ serde = { version = "1.0.136", features = ["derive"] }