git: b9105b7ef1e9 - main - biology/canu: Update to 2.2

From: Jason W. Bacon <jwb_at_FreeBSD.org>
Date: Sun, 19 Dec 2021 21:06:57 UTC
The branch main has been updated by jwb:

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

commit b9105b7ef1e91bce177273f3031a98781ca6faf7
Author:     Jason W. Bacon <jwb@FreeBSD.org>
AuthorDate: 2021-12-19 21:03:36 +0000
Commit:     Jason W. Bacon <jwb@FreeBSD.org>
CommitDate: 2021-12-19 21:06:56 +0000

    biology/canu: Update to 2.2
    
    FreeBSD port: Add support for aarch64 and powerpc64 using simde
    Not yet supported upstream
    
    Several upstream bug fixes and minor enhancements since 2.1
    
    Changes: https://github.com/marbl/canu/tags
---
 biology/canu/Makefile                              | 27 ++++++----
 biology/canu/distinfo                              |  6 +--
 biology/canu/files/cpuid_arm.c                     | 57 ++++++++++++++++++++++
 biology/canu/files/cpuid_ppc.c                     | 57 ++++++++++++++++++++++
 ...boost_boost_smart__ptr_detail_shared__count.hpp | 10 ++++
 .../patch-utility_src_parasail_internal__sse.h     | 12 +++++
 .../files/patch-utility_src_utility_align-ssw.H    | 12 +++++
 .../canu/files/patch-utility_src_utility_files.H   | 11 +++++
 .../canu/files/patch-utility_src_utility_system.H  | 11 +++++
 .../canu/files/patch-utility_src_utility_types.H   | 11 +++++
 biology/canu/pkg-plist                             |  3 +-
 11 files changed, 204 insertions(+), 13 deletions(-)

diff --git a/biology/canu/Makefile b/biology/canu/Makefile
index 56ebc0779e5e..72a628226299 100644
--- a/biology/canu/Makefile
+++ b/biology/canu/Makefile
@@ -1,9 +1,8 @@
 PORTNAME=		canu
-DISTVERSION=		2.1
-PORTREVISION=		1
-CATEGORIES=		biology java perl5
+DISTVERSION=		2.2
+CATEGORIES=		wip biology java perl5
 # Github auto-generated tarballs lack submodules
-MASTER_SITES=		https://github.com/marbl/canu/releases/download/v2.1/
+MASTER_SITES=		https://github.com/marbl/canu/releases/download/v${DISTVERSION}/
 
 MAINTAINER=	jwb@FreeBSD.org
 COMMENT=	Single molecule sequence assembler
@@ -11,14 +10,13 @@ COMMENT=	Single molecule sequence assembler
 LICENSE=	GPLv2
 LICENSE_FILE=	${WRKDIR}/${PORTNAME}-${PORTVERSION}/README.license.GPL
 
-BROKEN_powerpc64=	fails to build: utgcns/libboost/boost/smart_ptr/detail/sp_counted_impl.hpp:81:5: error: 'get_deleter' declared as a 'virtual' field
-NOT_FOR_ARCHS=		armv6 armv7 i386 powerpc
-NOT_FOR_ARCHS_REASON=	__int128 is not supported on this target
+NOT_FOR_ARCHS=		armv6 armv7 i386 mips powerpc powerpcspe
+NOT_FOR_ARCHS_REASON=	Requires 64-bit processor
 
 LIB_DEPENDS=	libboost_regex.so:devel/boost-libs
 RUN_DEPENDS=	gnuplot:math/gnuplot
 
-USES=		compiler:c++11-lang gmake localbase perl5
+USES=		compiler:c++11-lang gmake localbase perl5 tar:xz
 USE_JAVA=	yes
 
 JAVA_RUN=	yes
@@ -29,6 +27,17 @@ WRKSRC_SUBDIR=	src
 # using a separate install target.
 MAKE_ENV=	DESTDIR=${WRKSRC} CANU_BUILD_ENV=ports
 
+.include <bsd.port.pre.mk>
+
+# Parasail should be unbundled, but that would be a project because it's
+# currently woven into the canu code
+post-extract:
+.if ${ARCH} == "aarch64"
+	${CP} ${FILESDIR}/cpuid_arm.c ${WRKSRC}/utility/src/parasail/cpuid.c
+.elif ${ARCH} == "powerpc64" || ${ARCH} == "powerpc64le"
+	${CP} ${FILESDIR}/cpuid_ppc.c ${WRKSRC}/utility/src/parasail/cpuid.c
+.endif
+
 pre-configure:
 	@${REINPLACE_CMD} \
 		-e 's|-O4||g' \
@@ -54,4 +63,4 @@ do-install:
 	(cd ${WRKSRC}/build && \
 		${COPYTREE_SHARE} "lib share" ${STAGEDIR}${PREFIX})
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/biology/canu/distinfo b/biology/canu/distinfo
index 0ddec4d01a04..eace34089e15 100644
--- a/biology/canu/distinfo
+++ b/biology/canu/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1599584712
-SHA256 (canu-2.1.tar.gz) = 73c70d2d6326bdaf471549f2d1eb7a1bf1e0fbf45cdc4a830bd6ce9fe3f3c231
-SIZE (canu-2.1.tar.gz) = 3313120
+TIMESTAMP = 1639774550
+SHA256 (canu-2.2.tar.xz) = e4d0c7b82149114f442ccd39e18f7fe2061c63b28d53700ad896e022b73b7404
+SIZE (canu-2.2.tar.xz) = 2400192
diff --git a/biology/canu/files/cpuid_arm.c b/biology/canu/files/cpuid_arm.c
new file mode 100644
index 000000000000..3b35be06c087
--- /dev/null
+++ b/biology/canu/files/cpuid_arm.c
@@ -0,0 +1,57 @@
+/**
+ * @file
+ *
+ * @author jeffrey.daily@gmail.com
+ *
+ * Copyright (c) 2015 Battelle Memorial Institute.
+ *
+ * For non-intel platforms, stub out the intel feature tests.
+ */
+#include "config.h"
+
+#include "parasail/cpuid.h"
+
+int parasail_can_use_avx512vbmi()
+{
+    return 0;
+}
+
+int parasail_can_use_avx512bw()
+{
+    return 0;
+}
+
+int parasail_can_use_avx512f()
+{
+    return 0;
+}
+
+int parasail_can_use_avx2()
+{
+    return 0;
+}
+
+int parasail_can_use_sse41()
+{
+    return 0;
+}
+
+int parasail_can_use_sse2()
+{
+    return 0;
+}
+
+int parasail_can_use_altivec()
+{
+    return 0;
+}
+
+int parasail_can_use_neon()
+{
+#if HAVE_NEON
+    return 1;
+#else
+    return 0;
+#endif
+}
+
diff --git a/biology/canu/files/cpuid_ppc.c b/biology/canu/files/cpuid_ppc.c
new file mode 100644
index 000000000000..4a832a90a32c
--- /dev/null
+++ b/biology/canu/files/cpuid_ppc.c
@@ -0,0 +1,57 @@
+/**
+ * @file
+ *
+ * @author jeffrey.daily@gmail.com
+ *
+ * Copyright (c) 2015 Battelle Memorial Institute.
+ *
+ * For non-intel platforms, stub out the intel feature tests.
+ */
+#include "config.h"
+
+#include "parasail/cpuid.h"
+
+int parasail_can_use_avx512vbmi()
+{
+    return 0;
+}
+
+int parasail_can_use_avx512bw()
+{
+    return 0;
+}
+
+int parasail_can_use_avx512f()
+{
+    return 0;
+}
+
+int parasail_can_use_avx2()
+{
+    return 0;
+}
+
+int parasail_can_use_sse41()
+{
+    return 0;
+}
+
+int parasail_can_use_sse2()
+{
+    return 0;
+}
+
+int parasail_can_use_altivec()
+{
+#if HAVE_ALTIVEC
+    return 1;
+#else
+    return 0;
+#endif
+}
+
+int parasail_can_use_neon()
+{
+    return 0;
+}
+
diff --git a/biology/canu/files/patch-utgcns_libboost_boost_smart__ptr_detail_shared__count.hpp b/biology/canu/files/patch-utgcns_libboost_boost_smart__ptr_detail_shared__count.hpp
new file mode 100644
index 000000000000..554c97a04af9
--- /dev/null
+++ b/biology/canu/files/patch-utgcns_libboost_boost_smart__ptr_detail_shared__count.hpp
@@ -0,0 +1,10 @@
+--- utgcns/libboost/boost/smart_ptr/detail/shared_count.hpp.orig	2021-12-18 13:01:24 UTC
++++ utgcns/libboost/boost/smart_ptr/detail/shared_count.hpp
+@@ -25,6 +25,7 @@
+ #include <boost/config.hpp>
+ #include <boost/checked_delete.hpp>
+ #include <boost/throw_exception.hpp>
++#include <boost/detail/sp_typeinfo.hpp>
+ #include <boost/smart_ptr/bad_weak_ptr.hpp>
+ #include <boost/smart_ptr/detail/sp_counted_base.hpp>
+ #include <boost/smart_ptr/detail/sp_counted_impl.hpp>
diff --git a/biology/canu/files/patch-utility_src_parasail_internal__sse.h b/biology/canu/files/patch-utility_src_parasail_internal__sse.h
new file mode 100644
index 000000000000..ea03b5ab917c
--- /dev/null
+++ b/biology/canu/files/patch-utility_src_parasail_internal__sse.h
@@ -0,0 +1,12 @@
+--- utility/src/parasail/internal_sse.h.orig	2021-12-17 22:10:09 UTC
++++ utility/src/parasail/internal_sse.h
+@@ -10,7 +10,8 @@
+ 
+ #include <stdint.h>
+ 
+-#include <emmintrin.h>
++#define SIMDE_ENABLE_NATIVE_ALIASES
++#include <simde.h>
+ 
+ #include "parasail.h"
+ 
diff --git a/biology/canu/files/patch-utility_src_utility_align-ssw.H b/biology/canu/files/patch-utility_src_utility_align-ssw.H
new file mode 100644
index 000000000000..8da82c2d106a
--- /dev/null
+++ b/biology/canu/files/patch-utility_src_utility_align-ssw.H
@@ -0,0 +1,12 @@
+--- utility/src/utility/align-ssw.H.orig	2021-12-17 22:12:23 UTC
++++ utility/src/utility/align-ssw.H
+@@ -33,7 +33,8 @@
+ #include <stdio.h>
+ #include <stdint.h>
+ #include <string.h>
+-#include <emmintrin.h>
++#define SIMDE_ENABLE_NATIVE_ALIASES
++#include <simde.h.h>
+ 
+ 
+ #define MAPSTR "MIDNSHP=X"
diff --git a/biology/canu/files/patch-utility_src_utility_files.H b/biology/canu/files/patch-utility_src_utility_files.H
new file mode 100644
index 000000000000..3e72cbe4942b
--- /dev/null
+++ b/biology/canu/files/patch-utility_src_utility_files.H
@@ -0,0 +1,11 @@
+--- utility/src/utility/files.H.orig	2021-12-17 20:57:15 UTC
++++ utility/src/utility/files.H
+@@ -22,7 +22,7 @@
+ 
+ #include "types.H"
+ #include <vector>
+-
++#include <cmath>
+ 
+ //  Provides a safe and reliable mechanism for reading / writing
+ //  binary data.
diff --git a/biology/canu/files/patch-utility_src_utility_system.H b/biology/canu/files/patch-utility_src_utility_system.H
new file mode 100644
index 000000000000..339c577b992d
--- /dev/null
+++ b/biology/canu/files/patch-utility_src_utility_system.H
@@ -0,0 +1,11 @@
+--- utility/src/utility/system.H.orig	2021-12-17 20:57:47 UTC
++++ utility/src/utility/system.H
+@@ -23,7 +23,7 @@
+ #include "types.H"
+ 
+ #include <signal.h>
+-
++#include <cmath>
+ 
+ 
+ double   getTime(void);
diff --git a/biology/canu/files/patch-utility_src_utility_types.H b/biology/canu/files/patch-utility_src_utility_types.H
new file mode 100644
index 000000000000..e53536e09c8f
--- /dev/null
+++ b/biology/canu/files/patch-utility_src_utility_types.H
@@ -0,0 +1,11 @@
+--- utility/src/utility/types.H.orig	2021-12-17 20:58:13 UTC
++++ utility/src/utility/types.H
+@@ -55,7 +55,7 @@
+ #include <ctype.h>
+ 
+ #include <float.h>
+-#include <math.h>
++#include <cmath>
+ 
+ #include <assert.h>
+ #include <errno.h>
diff --git a/biology/canu/pkg-plist b/biology/canu/pkg-plist
index e3d2f84d51de..d76d4279c35e 100644
--- a/biology/canu/pkg-plist
+++ b/biology/canu/pkg-plist
@@ -1,6 +1,5 @@
 bin/alignGFA
 bin/bogart
-bin/bogus
 bin/canu
 bin/canu-time
 bin/canu.defaults
@@ -32,6 +31,7 @@ bin/ovStoreIndexer
 bin/ovStoreSorter
 bin/ovStoreStats
 bin/overlapAlign
+bin/overlapCheck
 bin/overlapConvert
 bin/overlapImport
 bin/overlapInCore
@@ -59,6 +59,7 @@ lib/libcanu.a
 %%SITE_PERL%%/canu/Grid_Cloud.pm
 %%SITE_PERL%%/canu/Grid_DNANexus.pm
 %%SITE_PERL%%/canu/Grid_LSF.pm
+%%SITE_PERL%%/canu/Grid_Local.pm
 %%SITE_PERL%%/canu/Grid_PBSTorque.pm
 %%SITE_PERL%%/canu/Grid_SGE.pm
 %%SITE_PERL%%/canu/Grid_Slurm.pm