git: 4b987075629f - main - biology/megahit: Add cmake patch to respect ports build flags

From: Jason W. Bacon <jwb_at_FreeBSD.org>
Date: Thu, 24 Nov 2022 14:11:36 UTC
The branch main has been updated by jwb:

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

commit 4b987075629fc9516f81c5f2b94afe6c5f04f9d3
Author:     Jason W. Bacon <jwb@FreeBSD.org>
AuthorDate: 2022-11-24 14:10:13 +0000
Commit:     Jason W. Bacon <jwb@FreeBSD.org>
CommitDate: 2022-11-24 14:10:13 +0000

    biology/megahit: Add cmake patch to respect ports build flags
    
    Removes agressive optimizations hard-coded upstream
---
 biology/megahit/Makefile                   |  1 +
 biology/megahit/files/patch-CMakeLists.txt | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/biology/megahit/Makefile b/biology/megahit/Makefile
index 30080e9d2564..379440059baa 100644
--- a/biology/megahit/Makefile
+++ b/biology/megahit/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=		megahit
 DISTVERSIONPREFIX=	v
 DISTVERSION=		1.2.9
+PORTREVISION=		1
 CATEGORIES=		biology
 
 MAINTAINER=	jwb@FreeBSD.org
diff --git a/biology/megahit/files/patch-CMakeLists.txt b/biology/megahit/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..d879052c7f02
--- /dev/null
+++ b/biology/megahit/files/patch-CMakeLists.txt
@@ -0,0 +1,17 @@
+--- CMakeLists.txt.orig	2019-10-15 02:51:03 UTC
++++ CMakeLists.txt
+@@ -42,13 +42,12 @@ find_package(OpenMP REQUIRED)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DXXH_INLINE_ALL -ftemplate-depth=3000")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-function")
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprefetch-loop-arrays -funroll-loops")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__XROOT__='\"${CMAKE_SOURCE_DIR}/src\"'")
+ #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__XFILE__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
+ 
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${ZLIB_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
+ 
+-set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
++set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG")
+ set(CMAKE_CXX_FLAGS_DEBUG "-g -ggdb -O1 -D_LIBCPP_DEBUG -D_GLIBCXX_DEBUG")
+ 
+ if (COVERAGE)