git: ca6b3bd6d2c4 - main - sysutils/incron: Fix build with llvm15
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 10 Jun 2023 17:14:20 UTC
The branch main has been updated by bofh:
URL: https://cgit.FreeBSD.org/ports/commit/?id=ca6b3bd6d2c4cb4cc5c31f1ccfa4adce51cf51b8
commit ca6b3bd6d2c4cb4cc5c31f1ccfa4adce51cf51b8
Author: Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2023-06-10 14:22:43 +0000
Commit: Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-06-10 17:14:07 +0000
sysutils/incron: Fix build with llvm15
- Remove legacy codes related to gcc42
- Pet portclippy
- Utilize USES=localbase
Approved by: portmgr (blanket)
---
sysutils/incron/Makefile | 18 ++++++++++--------
sysutils/incron/files/extra-patch-FreeBSD_14 | 20 ++++++++++++++++++++
2 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/sysutils/incron/Makefile b/sysutils/incron/Makefile
index 3e804faea4e8..4aec6aca618b 100644
--- a/sysutils/incron/Makefile
+++ b/sysutils/incron/Makefile
@@ -15,27 +15,29 @@ LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-X11
LIB_DEPENDS= libinotify.so:devel/libinotify
-USES= compiler
+USES= compiler localbase:ldflags
USE_GITHUB= yes
GH_ACCOUNT= ar-
GH_TAGNAME= 81421d3a8bde0989d7e167d8a814d5232896c930
-CPPFLAGS+= -I${LOCALBASE}/include -D__NR_inotify_init
-LDFLAGS+= -L${LOCALBASE}/lib -linotify
+USE_RC_SUBR= ${PORTNAME}
+
MAKE_ARGS= PREFIX="${PREFIX}" USER=${UID} \
DOCDIR="${PREFIX}/etc" \
MANPATH=${MANPREFIX}/man
-USE_RC_SUBR= ${PORTNAME}
+
+CPPFLAGS+= -D__NR_inotify_init
+LDFLAGS+= -linotify
.include <bsd.port.pre.mk>
+.if ${OPSYS} == FreeBSD && ( ${OSVERSION} >= 1400079 || ( ${OSVERSION} >= 1302505 && ${OSVERSION} < 1400000 ))
+EXTRA_PATCHES= ${FILESDIR}/extra-patch-FreeBSD_14
+.endif
+
post-patch:
${REINPLACE_CMD} -e 's,/etc/incron,${PREFIX}/etc/incron,' \
${WRKSRC}/*conf* ${WRKSRC}/Makefile ${WRKSRC}/*.[158h] \
${WRKSRC}/*.cpp
${REINPLACE_CMD} -e '/INITDIR/d' ${WRKSRC}/Makefile
-.if ${CHOSEN_COMPILER_TYPE} == gcc && ${COMPILER_VERSION} <= 42
- ${REINPLACE_CMD} -e '/pragma/d' ${WRKSRC}/inotify-cxx.cpp \
- ${WRKSRC}/usertable.cpp
-.endif
.include <bsd.port.post.mk>
diff --git a/sysutils/incron/files/extra-patch-FreeBSD_14 b/sysutils/incron/files/extra-patch-FreeBSD_14
new file mode 100644
index 000000000000..9d2606f8e8a7
--- /dev/null
+++ b/sysutils/incron/files/extra-patch-FreeBSD_14
@@ -0,0 +1,20 @@
+--- usertable.cpp.orig 2023-06-10 14:06:49 UTC
++++ usertable.cpp
+@@ -571,17 +571,6 @@ bool UserTable::MayAccess(const std::string& rPath, bo
+ return false; // no access right found
+ }
+
+-#ifndef __linux__
+-static int
+-clearenv(void)
+-{
+- extern char **environ;
+-
+- environ[0] = NULL;
+- return 0;
+-}
+-#endif
+-
+ void UserTable::RunAsUser(std::string cmd) const
+ {
+ struct passwd* pwd = getpwnam(m_user.c_str());