git: bac90e855c13 - main - biology/freebayes: Update to 1.3.9

From: Jason W. Bacon <jwb_at_FreeBSD.org>
Date: Tue, 18 Feb 2025 20:46:26 UTC
The branch main has been updated by jwb:

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

commit bac90e855c137190b1a7ae001e1a9a5e2deb52d4
Author:     Jason W. Bacon <jwb@FreeBSD.org>
AuthorDate: 2025-02-18 20:45:11 +0000
Commit:     Jason W. Bacon <jwb@FreeBSD.org>
CommitDate: 2025-02-18 20:45:11 +0000

    biology/freebayes: Update to 1.3.9
    
    Upstream moved away from git submodules to external deps
    Several fixes since 1.3.6
    Changes: https://github.com/freebayes/freebayes/releases
    
    Reported by:    portscout
---
 biology/freebayes/Makefile                | 42 +++++++---------
 biology/freebayes/distinfo                | 32 ++----------
 biology/freebayes/files/patch-meson.build | 81 +++++++++++++++++++++++++++++++
 3 files changed, 101 insertions(+), 54 deletions(-)

diff --git a/biology/freebayes/Makefile b/biology/freebayes/Makefile
index 5c3c29cd38b5..3490bfcab6b7 100644
--- a/biology/freebayes/Makefile
+++ b/biology/freebayes/Makefile
@@ -1,7 +1,6 @@
 PORTNAME=		freebayes
 DISTVERSIONPREFIX=	v
-DISTVERSION=		1.3.6
-PORTREVISION=		2
+DISTVERSION=		1.3.9
 CATEGORIES=		biology
 
 MAINTAINER=	jwb@FreeBSD.org
@@ -10,36 +9,29 @@ WWW=		https://github.com/ekg/freebayes
 
 LICENSE=	MIT
 
+BUILD_DEPENDS=	fastahack>=1.0.0:biology/fastahack \
+		multichoose>=1.0.3.2:math/multichoose \
+		simde>=0.8.2:devel/simde \
+		vcflib>=1.0.12:biology/vcflib \
+		intervaltree>=0.1.2:devel/intervaltree \
+		smithwaterman>=g20160702:biology/smithwaterman \
+		wfa2-lib>=2.3.5:biology/wfa2-lib \
+		tabixpp>=1.1.2:biology/tabixpp
 LIB_DEPENDS=	libhts.so:biology/htslib
 
-# Submodules use older versions than the ports, so we cannot safely unbundle
-# No shared libs are built by the submodules so there will be no conflicts
-# Yes, there are actually 2 versions of intervaltree required
 USES=		compiler:c++14-lang localbase meson perl5 pkgconfig
 USE_GITHUB=	yes
 GH_ACCOUNT=	ekg
-GH_TUPLE=	ekg:intervaltree:b90527f:intervaltree/vcflib/intervaltree \
-		ekg:vcflib:d4073c3:vcflib/vcflib-temp \
-		ekg:fastahack:bb33265:fastahack/vcflib/fastahack \
-		ekg:filevercmp:1a9b779:filevercmp/vcflib/filevercmp \
-		ekg:fsom:a6ef318:fsom/vcflib/fsom \
-		google:googletest:d225acc:googletest/vcflib/googletest \
-		ekg:intervaltree:17ddd57:intervaltree/vcflib/intervaltree \
-		edawson:libVCFH:615a06b:libVCFH/vcflib/libVCFH \
-		ekg:multichoose:68733cd:multichoose/vcflib/multichoose \
-		ekg:smithwaterman:2610e25:smithwaterman/vcflib/smithwaterman \
-		ekg:tabixpp:b255df1:tabixpp/vcflib/tabixpp \
-		simd-everywhere:simde-no-tests:2931676:simd/vcflib/src/simde \
-		ingydotnet:test-simple-bash:124673f:testsimplebash/test/test-simple-bash \
-		illusori:bash-tap:c38fbfa:bashtap/test/bash-tap
 USE_PERL5=	build
 
-LDFLAGS+=		-lexecinfo
-PLIST_FILES=		bin/bamleftalign bin/freebayes
+LDFLAGS+=	-lexecinfo
+PLIST_FILES=	bin/bamleftalign bin/freebayes
 
-# GH_TUPLEs cannot seem to share a top-level subdirectory, so we work around
-# by dumping the parent in a temp directory and then moving the contents
-post-extract:
-	${CP} -r ${WRKSRC}/vcflib-temp/* ${WRKSRC}/vcflib
+# meson.build is also statically patched, so do this after post-patch.
+# Run make clean patch before updating static patch, to avoid adding
+# up reinplace changes to the static patch.
+pre-configure:
+	@${REINPLACE_CMD} -e "s|/usr/local|${PREFIX}|g" ${WRKSRC}/meson.build
+	@${REINPLACE_CMD} -e "s|1.3.8|${PORTVERSION}|g" ${WRKSRC}/src/version_git.h
 
 .include <bsd.port.mk>
diff --git a/biology/freebayes/distinfo b/biology/freebayes/distinfo
index 22a8193e42eb..bc28d91cd6b1 100644
--- a/biology/freebayes/distinfo
+++ b/biology/freebayes/distinfo
@@ -1,29 +1,3 @@
-TIMESTAMP = 1644155282
-SHA256 (ekg-freebayes-v1.3.6_GH0.tar.gz) = d668c0b433cc0f11498ace10e48d72a7f0f40ca23b391b72e975ffafd1c13044
-SIZE (ekg-freebayes-v1.3.6_GH0.tar.gz) = 2898209
-SHA256 (ekg-intervaltree-17ddd57_GH0.tar.gz) = c2274e2382f893241847f75940ad15bac9d1e122da4416b0d2fc61ebba527ee1
-SIZE (ekg-intervaltree-17ddd57_GH0.tar.gz) = 72488
-SHA256 (ekg-vcflib-d4073c3_GH0.tar.gz) = 27ed96714eeaa871b8036bcb308db5256b8266cadd2689fbd1dbf3771611b879
-SIZE (ekg-vcflib-d4073c3_GH0.tar.gz) = 19215364
-SHA256 (ekg-fastahack-bb33265_GH0.tar.gz) = f671609e1a8d7cacb00065bf307c90c46116af8e5cea939b06edcdbcc6d4bc2a
-SIZE (ekg-fastahack-bb33265_GH0.tar.gz) = 18760
-SHA256 (ekg-filevercmp-1a9b779_GH0.tar.gz) = 34c21d1b58295bca72b92c1cd832a4171b07ec97c19ffc0d4d8ec67e266c6070
-SIZE (ekg-filevercmp-1a9b779_GH0.tar.gz) = 3053
-SHA256 (ekg-fsom-a6ef318_GH0.tar.gz) = 68351c16d5c4b96142409e38c6828b6199eae44eaa7579bde165734d4832565b
-SIZE (ekg-fsom-a6ef318_GH0.tar.gz) = 9686
-SHA256 (google-googletest-d225acc_GH0.tar.gz) = 6880e0d51fa80a508ad5674ce483c1c468315faddac10d580b5505e8e7ef6bfa
-SIZE (google-googletest-d225acc_GH0.tar.gz) = 1279815
-SHA256 (edawson-libVCFH-615a06b_GH0.tar.gz) = 2774c26c55e1d155fe803b492a745a1d2a3659f4fdbe248d3187ce03edf87223
-SIZE (edawson-libVCFH-615a06b_GH0.tar.gz) = 2295
-SHA256 (ekg-multichoose-68733cd_GH0.tar.gz) = 909baf2e462e43e71ba0d015fbe759c0ab95331c36d6c4ec65e4a92a7b9d3297
-SIZE (ekg-multichoose-68733cd_GH0.tar.gz) = 6558
-SHA256 (ekg-smithwaterman-2610e25_GH0.tar.gz) = f907becb50945d0858d3bf7a64959905712244cbe8455b35ef1102ff893173ce
-SIZE (ekg-smithwaterman-2610e25_GH0.tar.gz) = 39160
-SHA256 (ekg-tabixpp-b255df1_GH0.tar.gz) = 96d9aa41f55f74498e267b582e93e986605913fbd830dca6bf4cac5d9f927bb9
-SIZE (ekg-tabixpp-b255df1_GH0.tar.gz) = 3739
-SHA256 (simd-everywhere-simde-no-tests-2931676_GH0.tar.gz) = 3877e64f51a7368f768b40167e4cdff36a93d3047f722416581834f1eaf40f63
-SIZE (simd-everywhere-simde-no-tests-2931676_GH0.tar.gz) = 203996
-SHA256 (ingydotnet-test-simple-bash-124673f_GH0.tar.gz) = 19b5c27402d955909fcbf601ed02bcd7d9f2aa841e2158ecd93b9ff8f7ec1d98
-SIZE (ingydotnet-test-simple-bash-124673f_GH0.tar.gz) = 6609
-SHA256 (illusori-bash-tap-c38fbfa_GH0.tar.gz) = 5e658965f7c8730d7f29642ebb40b0e0beb701f992e391a1273af3b132ff66b8
-SIZE (illusori-bash-tap-c38fbfa_GH0.tar.gz) = 5826
+TIMESTAMP = 1739833701
+SHA256 (ekg-freebayes-v1.3.9_GH0.tar.gz) = 41ed3074c7648375286168a6708e02dac6788eaca4ca6039ff5a7ed91f257b53
+SIZE (ekg-freebayes-v1.3.9_GH0.tar.gz) = 2896143
diff --git a/biology/freebayes/files/patch-meson.build b/biology/freebayes/files/patch-meson.build
new file mode 100644
index 000000000000..c206bd537c7e
--- /dev/null
+++ b/biology/freebayes/files/patch-meson.build
@@ -0,0 +1,81 @@
+--- meson.build.orig	2025-02-16 14:02:36 UTC
++++ meson.build
+@@ -15,7 +15,7 @@ project('freebayes', ['cpp', 'c'],
+ 
+ project('freebayes', ['cpp', 'c'],
+         version : '1.3.9',
+-        default_options : ['warning_level=1', 'cpp_std=c++17', 'optimization=3'])
++        default_options : ['warning_level=1', 'cpp_std=c++14', 'optimization=3'])
+ static_build = get_option('static')
+ 
+ # used by Debian: add_global_arguments('-D_GLIBCXX_ASSERTIONS=1', language : 'cpp')
+@@ -25,10 +25,12 @@ thread_dep = dependency('threads', static: static_buil
+ # fastahack_dep = cc.find_library('libfastahack')
+ lzma_dep = dependency('liblzma', static: static_build)
+ thread_dep = dependency('threads', static: static_build)
+-wfa2lib_dep = cc.find_library('libwfa2') # need to link for vcflib code
++wfa2_inc = include_directories('/usr/local/include/wfa2lib')
++wfa2lib_dep = declare_dependency(include_directories: wfa2_inc)
+ zlib_dep = dependency('zlib', static: static_build)
+ htslib_dep = dependency('htslib', static: static_build, required: false)
+-vcflib_dep = cc.find_library('libvcflib', required: false)
++vcflib_inc = include_directories('/usr/local/include/vcflib')
++vcflib_dep = declare_dependency(link_args: '-lvcflib', include_directories: vcflib_inc)
+ seqlib_dep = dependency('libseqlib', static: static_build, required: false)
+ tabixpp_dep = cc.find_library('tabixpp', required: false, static: static_build)
+ 
+@@ -43,14 +45,12 @@ if get_option('prefer_system_deps') # defaults to true
+ 
+ 
+ if get_option('prefer_system_deps') # defaults to true, otherwise use git modules and local sources
+-  fastahack_dep = cc.find_library('libfastahack', required: true) # also link in for vcflib
+-  smithwaterman_dep = cc.find_library('libsmithwaterman')
+-  if fs.is_dir('/usr/include/fastahack')
+-    message('Using /usr/include/fastahack dir')
+-    fastahack_inc = include_directories('/usr/include/fastahack')
+-  else
+-    fastahack_inc = files()
+-  endif
++  fastahack_inc = include_directories('/usr/local/include/fastahack')
++  fastahack_dep = declare_dependency(include_directories: fastahack_inc)
++  sw_inc = include_directories('/usr/local/include/smithwaterman')
++  smithwaterman_dep = declare_dependency(include_directories: sw_inc)
++  multichoose_inc = include_directories('/usr/local/include/multichoose')
++  multichoose_dep = declare_dependency(include_directories: multichoose_inc)
+ 
+ else
+   # uses the minimal local git submodules or checkout trees in ./contrib/
+@@ -153,14 +153,14 @@ freebayes_lib = static_library(
+     include_directories : [incdir, vcflib_inc, fastahack_inc],
+     cpp_args : extra_cpp_args,
+     dependencies : [zlib_dep, lzma_dep, thread_dep, htslib_dep, tabixpp_dep,
+-                    vcflib_dep, wfa2lib_dep, seqlib_dep],
++                    vcflib_dep, wfa2lib_dep, seqlib_dep, multichoose_dep],
+     install : false,
+     )
+ 
+ if static_build
+-  link_arguments = '-static'
++  link_arguments = '-static -L/usr/local/lib'
+ else
+-  link_arguments = []
++  link_arguments = '-L/usr/local/lib'
+ endif
+ 
+ executable('freebayes',
+@@ -177,6 +177,7 @@ executable('freebayes',
+                           seqlib_dep,
+                           fastahack_dep, # for vcflib
+                           smithwaterman_dep, # for vcflib
++                          multichoose_dep,
+                           wfa2lib_dep],
+            link_with : freebayes_lib,
+            install: true
+@@ -195,6 +196,7 @@ executable('bamleftalign',
+                           seqlib_dep,
+                           fastahack_dep, # for vcflib
+                           smithwaterman_dep, # for vcflib
++                          multichoose_dep,
+                           wfa2lib_dep],
+            link_with : freebayes_lib,
+            install: true