git: be17d4ad221b - main - devel/creduce: Update to latest commit (20220927) and unbreak

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Mon, 23 Jan 2023 10:02:35 UTC
The branch main has been updated by diizzy:

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

commit be17d4ad221b313ecad86d0f42cea4b1c8b19d74
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2023-01-23 09:58:51 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2023-01-23 09:58:56 +0000

    devel/creduce: Update to latest commit (20220927) and unbreak
    
    Update to latest commit to support LLVM 15
    Convert to CMake and adjust dependencies
    
    PR:             268745
    Reviewed by:    pkubaj, tcberner
    Tested by:      pkubaj, brooks
    Approved by:    portmgr (maintainer timeout, 2+ weeks)
---
 devel/creduce/Makefile                             | 55 +++++++++-------------
 devel/creduce/distinfo                             |  6 +--
 .../creduce/files/builtin_is_constant_evaluated.h  |  1 -
 devel/creduce/files/patch-CMakeLists.txt           | 16 +++++++
 4 files changed, 41 insertions(+), 37 deletions(-)

diff --git a/devel/creduce/Makefile b/devel/creduce/Makefile
index ca535e1bc707..5e798cb40b43 100644
--- a/devel/creduce/Makefile
+++ b/devel/creduce/Makefile
@@ -1,51 +1,40 @@
 PORTNAME=	creduce
-DISTVERSION=	2.10.0
+DISTVERSION=	2.11.0.20220927
 CATEGORIES=	devel
-MASTER_SITES=	http://embed.cs.utah.edu/creduce/
 
 MAINTAINER=	swills@FreeBSD.org
 COMMENT=	Produces small test cases
-WWW=		https://embed.cs.utah.edu/creduce/
+WWW=		https://github.com/csmith-project/creduce
 
-# See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268745
-BROKEN=		Depends on removed LLVM port devel/llvm80
+LICENSE=	NCSA
+LICENSE_FILE=	${WRKSRC}/COPYING
 
-# LLVM_VER=	80
-# BUILD_DEPENDS=	llvm-config${LLVM_VER}:devel/llvm${LLVM_VER}
-# RUN_DEPENDS=	llvm-config${LLVM_VER}:devel/llvm${LLVM_VER} 
-BUILD_DEPENDS=	topformflat:devel/delta \
-		astyle:devel/astyle \
+BROKEN_FreeBSD_12_powerpc64=	fails to configure: cannot compile and link test program with selected LLVM
+
+BUILD_DEPENDS=	${LOCALBASE}/bin/flex:textproc/flex
+LIB_DEPENDS=	libzstd.so:archivers/zstd
+RUN_DEPENDS=	topformflat:devel/delta \
 		p5-Benchmark-Timer>=0:devel/p5-Benchmark-Timer \
 		p5-Exporter-Lite>=0:devel/p5-Exporter-Lite \
 		p5-File-Which>=0:sysutils/p5-File-Which \
 		p5-Regexp-Common>=0:textproc/p5-Regexp-Common \
 		p5-Sys-CPU>=0:devel/p5-Sys-CPU \
-		p5-Getopt-Tabular>=0:devel/p5-Getopt-Tabular
-
-BROKEN_FreeBSD_12_powerpc64=	fails to configure: cannot compile and link test program with selected LLVM
-
-GNU_CONFIGURE=	yes
-CONFIGURE_ENV=	LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${LLVM_VER} \
-		CC=${LOCALBASE}/bin/clang${LLVM_VER} \
-		CXX=${LOCALBASE}/bin/clang++${LLVM_VER} \
-		CPP=${LOCALBASE}/bin/clang-cpp${LLVM_VER}
-
-USES=		autoreconf compiler gmake libtool perl5
-
-CFLAGS_powerpc64=	-mabi=elfv2
+		p5-Getopt-Tabular>=0:devel/p5-Getopt-Tabular \
+		p5-Term-ReadKey>=0:devel/p5-Term-ReadKey
 
-.include <bsd.port.options.mk>
+USES=		cmake gnome compiler:c++14-lang llvm:build,lib,run perl5
 
-.if ${ARCH} == powerpc
-LLD_UNSAFE=	yes
-.endif
+USE_CXXSTD=	c++14
+USE_GITHUB=	yes
+GH_ACCOUNT=	csmith-project
+GH_TAGNAME=	8d56bee
+USE_GNOME=	libxml2
 
-.include <bsd.port.pre.mk>
+# See clang_delta/CMakeLists.txt for more details
+LDFLAGS+=	-lLLVM-${LLVM_VERSION} -L${LLVM_PREFIX}/lib
 
-# Detect base system libc++ >= 14 by checking for COMPILER_VERSION.
-# Not really the ideal way, but it should work.
-.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 140
-CXXFLAGS+=	-include ${FILESDIR}/builtin_is_constant_evaluated.h
-.endif
+CMAKE_OFF=	ENABLE_TRANS_ASSERT
+CMAKE_ARGS=	-DLLVM_DIR=${LLVM_PREFIX}/lib/cmake/llvm \
+		-DClang_DIR=${LLVM_PREFIX}/lib/cmake/clang
 
 .include <bsd.port.mk>
diff --git a/devel/creduce/distinfo b/devel/creduce/distinfo
index 4ca76a867b2d..09311b353ba0 100644
--- a/devel/creduce/distinfo
+++ b/devel/creduce/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1557826720
-SHA256 (creduce-2.10.0.tar.gz) = db1c0f123967f24d620b040cebd53001bf3dcf03e400f78556a2ff2e11fea063
-SIZE (creduce-2.10.0.tar.gz) = 779318
+TIMESTAMP = 1672826549
+SHA256 (csmith-project-creduce-2.11.0.20220927-8d56bee_GH0.tar.gz) = ca22cb970354823de06854c274daa6f19be85cfbf63e73e25dbd5fc744bdcbb7
+SIZE (csmith-project-creduce-2.11.0.20220927-8d56bee_GH0.tar.gz) = 747676
diff --git a/devel/creduce/files/builtin_is_constant_evaluated.h b/devel/creduce/files/builtin_is_constant_evaluated.h
deleted file mode 100644
index 2775e8fa1bf3..000000000000
--- a/devel/creduce/files/builtin_is_constant_evaluated.h
+++ /dev/null
@@ -1 +0,0 @@
-constexpr bool __builtin_is_constant_evaluated() { return false; }
diff --git a/devel/creduce/files/patch-CMakeLists.txt b/devel/creduce/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..60d4c9b41353
--- /dev/null
+++ b/devel/creduce/files/patch-CMakeLists.txt
@@ -0,0 +1,16 @@
+--- CMakeLists.txt.orig	2022-09-27 05:17:27 UTC
++++ CMakeLists.txt
+@@ -116,11 +116,11 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
+     OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+   # XXX figure out how to get "-std=c++11 -fno-rtti" from LLVM.  That's how we
+   # get those options in the Automake path...
+-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-rtti -fno-strict-aliasing -Wall -Wextra -Wno-long-long -Wno-unused-parameter -Wno-missing-field-initializers")
++  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-strict-aliasing -Wall -Wextra -Wno-long-long -Wno-unused-parameter -Wno-missing-field-initializers")
+   if(SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG)
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
+   endif()
+-  set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
++#  set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
+ endif()
+ 
+ ###############################################################################