bwa: Test fixes to biology/bwa genome aligner

This commit is contained in:
Jason Bacon 2018-05-03 11:41:59 -05:00
parent cd964df81a
commit 91e32433e1
8 changed files with 121 additions and 0 deletions

View File

@ -295,6 +295,7 @@ SUBDIR+= bugzilla
SUBDIR+= bullet
SUBDIR+= bup-git
SUBDIR+= busybox
SUBDIR+= bwa
SUBDIR+= bwm-ng
SUBDIR+= byzanz
SUBDIR+= c-news

2
bwa/DESCR Normal file
View File

@ -0,0 +1,2 @@
BWA is a software package for mapping low-divergent sequences against a large
reference genome, such as the human genome.

31
bwa/Makefile Normal file
View File

@ -0,0 +1,31 @@
# $NetBSD: Makefile,v 1.6 2017/12/27 23:44:01 he Exp $
DISTNAME= bwa-0.7.17
CATEGORIES= biology
PKGREVISION= 1
GITHUB_TAG= v${PKGVERSION_NOREV}
MASTER_SITES= ${MASTER_SITE_GITHUB:=lh3/}
MAINTAINER= bacon@NetBSD.org
HOMEPAGE= http://bio-bwa.sourceforge.net/
COMMENT= Map low-divergent sequences against a large reference genome
LICENSE= gnu-gpl-v3
USE_TOOLS+= perl:run gmake
REPLACE_PERL= *.pl
INSTALLATION_DIRS= bin ${PKGMANDIR}/man1
# unconditionally uses <emmintrin.h>
ONLY_FOR_PLATFORM= *-*-x86_64 *-*-i386 *-*-ia64
CFLAGS.SunOS+= -Du_int32_t=uint32_t
LDFLAGS.SunOS+= -lsocket -lnsl
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/bwa ${DESTDIR}${PREFIX}/bin
${INSTALL_SCRIPT} ${WRKSRC}/*.pl ${DESTDIR}${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/*.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
.include "../../devel/zlib/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

5
bwa/PLIST Normal file
View File

@ -0,0 +1,5 @@
@comment $NetBSD: PLIST,v 1.1 2015/10/14 17:12:52 leot Exp $
bin/bwa
bin/qualfa2fq.pl
bin/xa2multi.pl
man/man1/bwa.1

9
bwa/distinfo Normal file
View File

@ -0,0 +1,9 @@
$NetBSD: distinfo,v 1.6 2017/12/27 23:44:01 he Exp $
SHA1 (bwa-0.7.17.tar.gz) = 77f9aac723110227ea51cb42011336d291d03723
RMD160 (bwa-0.7.17.tar.gz) = d26a266387dee4fc9fcf6eef4f7ffcc076495c22
SHA512 (bwa-0.7.17.tar.gz) = 114e61b7cc5edcb67172d1eca7be1fa670ea33dd48b5c02c98318e254871363775c0dab327fd7ee7023200a5fedc745fa01cbe0fd9550d783f091d4df6926f48
Size (bwa-0.7.17.tar.gz) = 232593 bytes
SHA1 (patch-Makefile) = 72ac08d92540a88da08bf4d988ca3f6132327a6a
SHA1 (patch-fastmap.c) = e96f972a65ecc68c92eb82816e9e24b057435d1d
SHA1 (patch-kopen.c) = ecc92efa3ebe4da484aa6760e23de9437b000644

View File

@ -0,0 +1,44 @@
$NetBSD: patch-Makefile,v 1.2 2017/12/17 14:30:36 bacon Exp $
Respect env, add librt for NetBSD
--- Makefile.orig 2017-10-23 17:10:17.000000000 +0000
+++ Makefile
@@ -1,6 +1,6 @@
-CC= gcc
+CC?= gcc
#CC= clang --analyze
-CFLAGS= -g -Wall -Wno-unused-function -O2
+CFLAGS?= -g -Wall -Wno-unused-function -O2
WRAP_MALLOC=-DUSE_MALLOC_WRAPPERS
AR= ar
DFLAGS= -DHAVE_PTHREAD $(WRAP_MALLOC)
@@ -12,11 +12,14 @@ AOBJS= bwashm.o bwase.o bwaseqio.o bwtg
bwtsw2_chain.o fastmap.o bwtsw2_pair.o
PROG= bwa
INCLUDES=
-LIBS= -lm -lz -lpthread
+LDFLAGS+= -lm -lz -lpthread
SUBDIRS= .
ifeq ($(shell uname -s),Linux)
- LIBS += -lrt
+ LDFLAGS += -lrt
+endif
+ifeq ($(shell uname -s),NetBSD)
+ LDFLAGS += -lrt
endif
.SUFFIXES:.c .o .cc
@@ -27,10 +30,10 @@ endif
all:$(PROG)
bwa:libbwa.a $(AOBJS) main.o
- $(CC) $(CFLAGS) $(DFLAGS) $(AOBJS) main.o -o $@ -L. -lbwa $(LIBS)
+ $(CC) $(CFLAGS) $(DFLAGS) $(AOBJS) main.o -o $@ -L. -lbwa $(LDFLAGS)
bwamem-lite:libbwa.a example.o
- $(CC) $(CFLAGS) $(DFLAGS) example.o -o $@ -L. -lbwa $(LIBS)
+ $(CC) $(CFLAGS) $(DFLAGS) example.o -o $@ -L. -lbwa $(LDFLAGS)
libbwa.a:$(LOBJS)
$(AR) -csru $@ $(LOBJS)

View File

@ -0,0 +1,14 @@
$NetBSD$
--- fastmap.c.orig 2018-04-19 22:02:10.516983388 +0000
+++ fastmap.c
@@ -130,7 +130,9 @@ int main_mem(int argc, char *argv[])
aux.opt = opt = mem_opt_init();
memset(&opt0, 0, sizeof(mem_opt_t));
+ fprintf(stderr, "argc = %d argv[1] = %s\n", argc, argv[1]);
while ((c = getopt(argc, argv, "51qpaMCSPVYjk:c:v:s:r:t:R:A:B:O:E:U:w:L:d:T:Q:D:m:I:N:o:f:W:x:G:h:y:K:X:H:")) >= 0) {
+ fprintf(stderr, "c = %d %c\n", c, c);
if (c == 'k') opt->min_seed_len = atoi(optarg), opt0.min_seed_len = 1;
else if (c == '1') no_mt_io = 1;
else if (c == 'x') mode = optarg;

15
bwa/patches/patch-kopen.c Normal file
View File

@ -0,0 +1,15 @@
$NetBSD: patch-kopen.c,v 1.3 2017/12/27 23:44:01 he Exp $
Add includes for getting timevals and select prototype into scope.
--- kopen.c.orig 2017-10-23 17:10:17.000000000 +0000
+++ kopen.c
@@ -12,6 +12,8 @@
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/socket.h>
+#include <sys/time.h>
+#include <sys/select.h>
#endif
#ifdef USE_MALLOC_WRAPPERS