diff --git a/biology/minimap2/Makefile b/biology/minimap2/Makefile index 8f99d646431d..52b9b669654a 100644 --- a/biology/minimap2/Makefile +++ b/biology/minimap2/Makefile @@ -1,24 +1,24 @@ -PORTNAME= minimap2 +PORTNAME= minimap2 DISTVERSIONPREFIX= v -DISTVERSION= 2.22 -CATEGORIES= biology +DISTVERSION= 2.23 +CATEGORIES= biology MAINTAINER= jwb@FreeBSD.org COMMENT= Pairwise aligner for genomic and spliced nucleotide sequences LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE.txt -ONLY_FOR_ARCHS= amd64 i386 -ONLY_FOR_ARCHS_REASON= uses hard-coded SSE instructions +BUILD_DEPENDS= simde>0:devel/simde -USES= gmake +USES= gmake localbase USE_GITHUB= yes GH_ACCOUNT= lh3 -MAKE_ARGS+= CFLAGS+=-Wextra ALL_TARGET= extra INSTALL_TARGET= install-strip +MAKEFILE= Makefile.simde + .include diff --git a/biology/minimap2/distinfo b/biology/minimap2/distinfo index e52728d52312..8488018ac682 100644 --- a/biology/minimap2/distinfo +++ b/biology/minimap2/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1629640993 -SHA256 (lh3-minimap2-v2.22_GH0.tar.gz) = b625a7580d9b5996f2553ee90ffcec84870bd9b88c009c9d71e8c1c648c53ed6 -SIZE (lh3-minimap2-v2.22_GH0.tar.gz) = 251821 +TIMESTAMP = 1638198281 +SHA256 (lh3-minimap2-v2.23_GH0.tar.gz) = 1837465234bfec0fc8acaa3bdd371dfc57cf56137f7e6b8c723dcbed2f03f144 +SIZE (lh3-minimap2-v2.23_GH0.tar.gz) = 252484 diff --git a/biology/minimap2/files/patch-Makefile b/biology/minimap2/files/patch-Makefile deleted file mode 100644 index 79c9c3617b38..000000000000 --- a/biology/minimap2/files/patch-Makefile +++ /dev/null @@ -1,61 +0,0 @@ ---- Makefile.orig 2021-05-27 19:26:04 UTC -+++ Makefile -@@ -1,5 +1,9 @@ --CFLAGS= -g -Wall -O2 -Wc++-compat #-Wextra --CPPFLAGS= -DHAVE_KALLOC -+ -+# Makefile patches rejected by upstream -+ -+CFLAGS?= -g -Wall -O2 -+CFLAGS+= -Wc++-compat #-Wextra -+CPPFLAGS?= -DHAVE_KALLOC - INCLUDES= - OBJS= kthread.o kalloc.o misc.o bseq.o sketch.o sdust.o options.o index.o \ - lchain.o align.o hit.o seed.o map.o format.o pe.o esterr.o splitidx.o \ -@@ -8,6 +12,15 @@ PROG= minimap2 - PROG_EXTRA= sdust minimap2-lite - LIBS= -lm -lz -lpthread - -+PREFIX?= /usr/local -+MAN1DIR?= ${PREFIX}/man/man1 -+DATADIR?= ${PREFIX}/share/minimap2 -+ -+MKDIR?= mkdir -+CP?= cp -+INSTALL?= install -+STRIP?= strip -+ - ifeq ($(arm_neon),) # if arm_neon is not defined - ifeq ($(sse2only),) # if sse2only is not defined - OBJS+=ksw2_extz2_sse41.o ksw2_extd2_sse41.o ksw2_exts2_sse41.o ksw2_extz2_sse2.o ksw2_extd2_sse2.o ksw2_exts2_sse2.o ksw2_dispatch.o -@@ -34,7 +47,7 @@ ifneq ($(tsan),) - LIBS+=-fsanitize=thread - endif - --.PHONY:all extra clean depend -+.PHONY:all extra install clean depend - .SUFFIXES:.c .o - - .c.o: -@@ -96,6 +109,21 @@ ksw2_exts2_neon.o:ksw2_exts2_sse.c ksw2.h kalloc.h - $(CC) -c $(CFLAGS) $(CPPFLAGS) -DKSW_SSE2_ONLY -D__SSE2__ $(INCLUDES) $< -o $@ - - # other non-file targets -+ -+install: all -+ ${MKDIR} -p ${DESTDIR}${PREFIX}/bin -+ ${MKDIR} -p ${DESTDIR}${MAN1DIR} -+ ${MKDIR} -p ${DESTDIR}${DATADIR} -+ ${INSTALL} -c minimap2 ${DESTDIR}${PREFIX}/bin -+ ${INSTALL} -c minimap2-lite ${DESTDIR}${PREFIX}/bin -+ ${INSTALL} -c sdust ${DESTDIR}${PREFIX}/bin -+ ${INSTALL} -c minimap2.1 ${DESTDIR}${MAN1DIR} -+ ${CP} -R test ${DESTDIR}${DATADIR} -+ -+install-strip: install -+ ${STRIP} ${DESTDIR}${PREFIX}/bin/minimap2 -+ ${STRIP} ${DESTDIR}${PREFIX}/bin/minimap2-lite -+ ${STRIP} ${DESTDIR}${PREFIX}/bin/sdust - - clean: - rm -fr gmon.out *.o a.out $(PROG) $(PROG_EXTRA) *~ *.a *.dSYM build dist mappy*.so mappy.c python/mappy.c mappy.egg* diff --git a/biology/minimap2/files/patch-Makefile.simde b/biology/minimap2/files/patch-Makefile.simde new file mode 100644 index 000000000000..8a85b5257ffc --- /dev/null +++ b/biology/minimap2/files/patch-Makefile.simde @@ -0,0 +1,82 @@ +--- Makefile.simde.orig 2021-11-18 22:11:48 UTC ++++ Makefile.simde +@@ -1,13 +1,26 @@ +-CFLAGS= -g -Wall -O2 -Wc++-compat #-Wextra +-CPPFLAGS= -DHAVE_KALLOC -DUSE_SIMDE -DSIMDE_ENABLE_NATIVE_ALIASES +-INCLUDES= -Ilib/simde +-OBJS= kthread.o kalloc.o misc.o bseq.o sketch.o sdust.o options.o index.o lchain.o align.o hit.o map.o format.o pe.o seed.o esterr.o splitidx.o \ +- ksw2_extz2_simde.o ksw2_extd2_simde.o ksw2_exts2_simde.o ksw2_ll_simde.o ++ ++# Makefile patches rejected by upstream ++ ++CFLAGS?= -g -Wall -O2 ++CFLAGS+= -Wc++-compat -DUSE_SIMDE -DSIMDE_ENABLE_NATIVE_ALIASES -D__SSE2__ ++CPPFLAGS?= -DHAVE_KALLOC ++OBJS= kthread.o kalloc.o misc.o bseq.o sketch.o sdust.o options.o \ ++ index.o lchain.o align.o hit.o map.o format.o pe.o seed.o \ ++ esterr.o splitidx.o ksw2_extz2_simde.o ksw2_extd2_simde.o \ ++ ksw2_exts2_simde.o ksw2_ll_simde.o + PROG= minimap2 + PROG_EXTRA= sdust minimap2-lite + LIBS= -lm -lz -lpthread + ++PREFIX?= /usr/local ++MAN1DIR?= ${PREFIX}/man/man1 ++DATADIR?= ${PREFIX}/share/minimap2 + ++MKDIR?= mkdir ++CP?= cp ++INSTALL?= install ++STRIP?= strip ++ + ifneq ($(arm_neon),) # if arm_neon is defined + ifeq ($(aarch64),) #if aarch64 is not defined + CFLAGS+=-D_FILE_OFFSET_BITS=64 -mfpu=neon -fsigned-char +@@ -26,7 +39,7 @@ ifneq ($(tsan),) + LIBS+=-fsanitize=thread + endif + +-.PHONY:all extra clean depend ++.PHONY:all extra install install-strip clean depend + .SUFFIXES:.c .o + + .c.o: +@@ -49,18 +62,34 @@ sdust:sdust.c kalloc.o kalloc.h kdq.h kvec.h kseq.h ke + $(CC) -D_SDUST_MAIN $(CFLAGS) $< kalloc.o -o $@ -lz + + ksw2_ll_simde.o:ksw2_ll_sse.c ksw2.h kalloc.h +- $(CC) -c $(CFLAGS) -msse2 $(CPPFLAGS) $(INCLUDES) $< -o $@ ++ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $< -o $@ + + ksw2_extz2_simde.o:ksw2_extz2_sse.c ksw2.h kalloc.h +- $(CC) -c $(CFLAGS) -msse4.1 $(CPPFLAGS) $(INCLUDES) $< -o $@ ++ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $< -o $@ + + ksw2_extd2_simde.o:ksw2_extd2_sse.c ksw2.h kalloc.h +- $(CC) -c $(CFLAGS) -msse4.1 $(CPPFLAGS) $(INCLUDES) $< -o $@ ++ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $< -o $@ + + ksw2_exts2_simde.o:ksw2_exts2_sse.c ksw2.h kalloc.h +- $(CC) -c $(CFLAGS) -msse4.1 $(CPPFLAGS) $(INCLUDES) $< -o $@ ++ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $< -o $@ + + # other non-file targets ++ ++ ++install: all ++ ${MKDIR} -p ${DESTDIR}${PREFIX}/bin ++ ${MKDIR} -p ${DESTDIR}${MAN1DIR} ++ ${MKDIR} -p ${DESTDIR}${DATADIR} ++ ${INSTALL} -c minimap2 ${DESTDIR}${PREFIX}/bin ++ ${INSTALL} -c minimap2-lite ${DESTDIR}${PREFIX}/bin ++ ${INSTALL} -c sdust ${DESTDIR}${PREFIX}/bin ++ ${INSTALL} -c minimap2.1 ${DESTDIR}${MAN1DIR} ++ ${CP} -R test ${DESTDIR}${DATADIR} ++ ++install-strip: install ++ ${STRIP} ${DESTDIR}${PREFIX}/bin/minimap2 ++ ${STRIP} ${DESTDIR}${PREFIX}/bin/minimap2-lite ++ ${STRIP} ${DESTDIR}${PREFIX}/bin/sdust + + clean: + rm -fr gmon.out *.o a.out $(PROG) $(PROG_EXTRA) *~ *.a *.dSYM build dist mappy*.so mappy.c python/mappy.c mappy.egg* diff --git a/biology/minimap2/files/patch-example.c b/biology/minimap2/files/patch-example.c new file mode 100644 index 000000000000..aaa89ec16f41 --- /dev/null +++ b/biology/minimap2/files/patch-example.c @@ -0,0 +1,11 @@ +--- example.c.orig 2021-11-30 15:26:24 UTC ++++ example.c +@@ -44,7 +44,7 @@ int main(int argc, char *argv[]) + for (j = 0; j < n_reg; ++j) { // traverse hits and print them out + mm_reg1_t *r = ®[j]; + assert(r->p); // with MM_F_CIGAR, this should not be NULL +- printf("%s\t%d\t%d\t%d\t%c\t", ks->name.s, ks->seq.l, r->qs, r->qe, "+-"[r->rev]); ++ printf("%s\t%zu\t%d\t%d\t%c\t", ks->name.s, ks->seq.l, r->qs, r->qe, "+-"[r->rev]); + printf("%s\t%d\t%d\t%d\t%d\t%d\t%d\tcg:Z:", mi->seq[r->rid].name, mi->seq[r->rid].len, r->rs, r->re, r->mlen, r->blen, r->mapq); + for (i = 0; i < r->p->n_cigar; ++i) // IMPORTANT: this gives the CIGAR in the aligned regions. NO soft/hard clippings! + printf("%d%c", r->p->cigar[i]>>4, MM_CIGAR_STR[r->p->cigar[i]&0xf]);