diff --git a/biology/sra-tools/Makefile b/biology/sra-tools/Makefile new file mode 100644 index 000000000000..4cbe2c298357 --- /dev/null +++ b/biology/sra-tools/Makefile @@ -0,0 +1,90 @@ +# $FreeBSD$ + +PORTNAME= sra-tools +DISTVERSION= 2.11.0 +CATEGORIES= biology + +MAINTAINER= mzaki@niid.go.jp +COMMENT= NCBI's toolkit for handling data in INSDC Sequence Read Archives + +LICENSE= PD LGPL21+ +LICENSE_COMB= multi +LICENSE_FILE_PD= ${WRKSRC}/LICENSE +LICENSE_DISTFILES_LGPL21+ = + +BUILD_DEPENDS= bash:shells/bash \ + ${LOCALBASE}/lib/libngs-c++.a:biology/ngs-sdk \ + ${NONEXISTENT}:biology/ncbi-vdb:build +LIB_DEPENDS= libxml2.so:textproc/libxml2 \ + libhdf5.so:science/hdf5 \ + libmbedtls.so:security/mbedtls + +USE_GITHUB= yes +GH_ACCOUNT= ncbi + +USES= gmake perl5 shebangfix +USE_PERL5= build +SHEBANG_GLOB= *.sh *.pl + +GNU_CONFIGURE= yes + +NCBI_VDB_WRKSRC= $$(make -C ${PORTSDIR}/biology/ncbi-vdb -V WRKSRC) +NCBI_VDB_FILESDIR= $$(make -C ${PORTSDIR}/biology/ncbi-vdb -V FILESDIR) + +CONFIGURE_ARGS= --with-ngs-sdk-prefix=${LOCALBASE} \ + --with-ncbi-vdb-sources=${NCBI_VDB_WRKSRC} \ + --with-xml2-prefix=${LOCALBASE} \ + --with-hdf5-prefix=${LOCALBASE} \ + CC="${CC}" CXX="${CXX}" TOOLS="${CHOSEN_COMPILER_TYPE}" \ + --with-ncbi-vdb-build=${NCBI_VDB_WRKSRC}/amd64-portbld-freebsd12.2 +# -d +# --with-mbedtls-prefix=${LOCALBASE} +MAKE_ARGS= CCNAME=${CC} CXXNAME=${CXX} PKGCFLAGS="${CFLAGS}" \ + INST_ETCDIR=${STAGEDIR}${PREFIX}/etc + +ONLY_FOR_ARCHS= amd64 i386 +ONLY_FOR_ARCHS_REASON= NCBI-VDB requires SSE2 instructions +BROKEN_i386= buggy output + +CFLAGS+= -I${WRKSRC}/interfaces/os/sun +CXXFLAGS+= -I${WRKSRC}/interfaces/os/sun +LDFLAGS+= -lz + +BINARY_ALIAS= gcc=${CC} g++=${CXX} + +# for port developers, building with these options may fail +OPTIONS_DEFINE= DEBUG OPTIMIZED_CFLAGS TEST +DEBUG_PREVENTS= OPTIMIZED_CFLAGS +DEBUG_CONFIGURE_WITH= debug +OPTIMIZED_CFLAGS_MAKE_ARGS_OFF= OPT="" +TEST_TEST_TARGET= test +TEST_USES= python + +xpre-patch: + @${CP} ${FILESDIR}/Makefile.bsd ${WRKSRC}/build/ + @for f in ${WRKSRC}/build/ld.linux.*.sh; do ${CP} -p $${f} $${f%linux*}bsd$${f#*linux}; done + @${CP} -p ${WRKSRC}/build/ld.linux.gcc.sh ${WRKSRC}/build/ld.bsd.clang.sh + +pre-configure: + ${CP} ${NCBI_VDB_WRKSRC}/setup/os-arch.prl ${WRKSRC}/setup/os-arch.prl + # same as in biology/ncbi-vdb + @${CP} ${NCBI_VDB_FILESDIR}/Makefile.bsd ${WRKSRC}/build/ + @${CP} ${NCBI_VDB_WRKSRC}/build/ld.bsd.*.sh ${WRKSRC}/build/ + ${MKDIR} ${WRKSRC}/interfaces/override + @${CP} ${NCBI_VDB_WRKSRC}/interfaces/os/sun/atomic32.h ${WRKSRC}/interfaces/override + @${CP} ${NCBI_VDB_WRKSRC}/interfaces/os/sun/byteswap.h ${WRKSRC}/interfaces/override + @for f in ${NCBI_VDB_WRKSRC}/build/ld.linux.*.sh; do ${CP} -p $${f} $${f%linux*}bsd$${f#*linux}; done + @${CP} -p ${NCBI_VDB_WRKSRC}/build/ld.linux.gcc.sh ${WRKSRC}/build/ld.bsd.clang.sh + #@${MKDIR} ${WRKSRC}/interfaces/os/bsd + #@${CP} -p ${WRKSRC}/interfaces/os/mac/endian.h ${WRKSRC}/interfaces/os/bsd/ + ${LN} -s ${NCBI_VDB_WRKSRC}/interfaces ${WRKSRC}/interfaces + +post-patch-TEST-on: + ${REINPLACE_CMD} -e 's#python#${PYTHON_CMD}#' ${WRKSRC}/test/kget/Makefile + +xpost-configure: + @${ECHO} ${CHOSEN_COMPILER_TYPE} > ${WRKSRC}/build/COMP + +post-build-TEST-on: do-test + +.include diff --git a/biology/sra-tools/distinfo b/biology/sra-tools/distinfo new file mode 100644 index 000000000000..98c75c320f18 --- /dev/null +++ b/biology/sra-tools/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1617221199 +SHA256 (ncbi-sra-tools-2.11.0_GH0.tar.gz) = 10ac0a4d1fafc274bc107de811891d3e803d0713a247581dece4448231883810 +SIZE (ncbi-sra-tools-2.11.0_GH0.tar.gz) = 8966605 diff --git a/biology/sra-tools/files/patch-setup_install.perl b/biology/sra-tools/files/patch-setup_install.perl new file mode 100644 index 000000000000..f1600db36d19 --- /dev/null +++ b/biology/sra-tools/files/patch-setup_install.perl @@ -0,0 +1,13 @@ +--- setup/install.perl.orig 2021-03-31 20:29:55 UTC ++++ setup/install.perl +@@ -1283,8 +1283,8 @@ sub prepare { + ' $_{INST_JARDIR } = "$_{PREFIX}/jar"; ' . + ' $_{INST_SHAREDIR} = "$_{PREFIX}/share"; ' . + ' $_{INCDIR } = "$Bin/../include"; ' . +- ' $_{LIBDIR64 } = "$Bin/../lib64"; ' . +- ' $_{LIBDIR32 } = "$Bin/../lib32"; '; ++ ' $_{LIBDIR64 } = "$Bin/../lib"; ' . ++ ' $_{LIBDIR32 } = "$Bin/../lib"; '; + if ($HAVE{TWO_LIBS}) { + $code .= + '$_{INST_NGSLIBDIR} = "' . "$root/usr/local/ngs/ngs-sdk/lib\";" diff --git a/biology/sra-tools/files/patch-setup_konfigure.perl b/biology/sra-tools/files/patch-setup_konfigure.perl new file mode 100644 index 000000000000..aacfe898be6d --- /dev/null +++ b/biology/sra-tools/files/patch-setup_konfigure.perl @@ -0,0 +1,121 @@ +--- setup/konfigure.perl.orig 2021-03-15 18:25:25 UTC ++++ setup/konfigure.perl +@@ -204,7 +204,7 @@ print "checking system type... " unless ($AUTORUN); + my ($OS, $ARCH, $OSTYPE, $MARCH, @ARCHITECTURES) = OsArch(); + println $OSTYPE unless ($AUTORUN); + +-unless ($OSTYPE =~ /linux/i || $OSTYPE =~ /darwin/i || $OSTYPE eq 'win') { ++unless ($OSTYPE =~ /linux/i || $OSTYPE =~ /darwin/i || $OSTYPE eq 'win' || $OSTYPE =~ /freebsd/i) { + println "configure: error: unsupported system '$OSTYPE'"; + exit 1; + } +@@ -225,7 +225,7 @@ if ($OS eq 'linux') { + + print "checking machine architecture... " unless ($AUTORUN); + println $MARCH unless ($AUTORUN); +-unless ($MARCH =~ /x86_64/i || $MARCH =~ /i?86/i || $MARCH =~ /aarch64/) { ++unless ($MARCH =~ /x86_64/i || $MARCH =~ /amd64/i || $MARCH =~ /i?86/i || $MARCH =~ /aarch64/) { + println "configure: error: unsupported architecture '$OSTYPE':'$MARCH'"; + exit 1; + } +@@ -310,7 +310,7 @@ print "checking for supported architecture... " unless + + my $BITS; + +-if ($MARCH =~ /x86_64/i) { ++if ($MARCH =~ /x86_64/i || $MARCH =~ /amd64/i) { + $BITS = 64; + } elsif ($MARCH eq 'fat86') { + $BITS = '32_64'; +@@ -337,6 +337,16 @@ if ($OSTYPE =~ /linux/i) { + $OSINC = 'unix'; + $TOOLS = 'gcc' unless ($TOOLS); + $PYTHON = 'python'; ++} elsif ($OSTYPE =~ /freebsd/i) { ++ $LPFX = 'lib'; ++ $OBJX = 'o'; ++ $LOBX = 'pic.o'; ++ $LIBX = 'a'; ++ $SHLX = 'so'; ++ $EXEX = ''; ++ $OSINC = 'unix'; ++ $TOOLS = 'clang' unless ($TOOLS); ++ $PYTHON = 'python'; + } elsif ($OSTYPE =~ /darwin/i) { + $LPFX = 'lib'; + $OBJX = 'o'; +@@ -512,7 +522,7 @@ foreach my $href (DEPENDS()) { + $I = $t if (-e $t); + } + push ( @L, File::Spec->catdir($OPT{$o}, 'lib') ); +- push ( @L, File::Spec->catdir($OPT{$o}, 'lib64') ); ++ #push ( @L, File::Spec->catdir($OPT{$o}, 'lib64') ); + } + my ($i, $l) = find_lib($_, $I, @L); + if (defined $i || $l) { +@@ -934,7 +944,7 @@ EndText + if ($PKG{LNG} eq 'C') { + if ($TOOLS =~ /clang/i) { + L($F, 'SONAME = -install_name ' . +- '$(INST_LIBDIR)$(BITS)/$(subst $(VERSION),$(MAJVERS),$(@F)) \\'); ++ '$(INST_LIBDIR)/$(subst $(VERSION),$(MAJVERS),$(@F)) \\'); + L($F, ' -compatibility_version $(MAJMIN) -current_version $(VERSION) \\'); + L($F, ' -flat_namespace -undefined suppress'); + } else { +@@ -1043,7 +1053,7 @@ EndText + L($F, '# directory rules'); + if ($PKG{LNG} eq 'C') { + L($F, '$(BINDIR) $(LIBDIR) $(ILIBDIR) ' +- . '$(OBJDIR) $(INST_LIBDIR) $(INST_LIBDIR)$(BITS):'); ++ . '$(OBJDIR) $(INST_LIBDIR) $(INST_LIBDIR):'); + T($F, 'mkdir -p $@'); + } elsif ($PKG{LNG} eq 'JAVA') { + # test if we have jni header path +@@ -1076,7 +1086,7 @@ EndText + if ($OS eq 'linux' || $OS eq 'mac') { + L($F, '# installation rules'); + L($F, +- '$(INST_LIBDIR)$(BITS)/%.$(VERSION_LIBX): $(LIBDIR)/%.$(VERSION_LIBX)'); ++ '$(INST_LIBDIR)/%.$(VERSION_LIBX): $(LIBDIR)/%.$(VERSION_LIBX)'); + T($F, '@ echo -n "installing \'$(@F)\'... "'); + T($F, '@ if cp $^ $@ && chmod 644 $@; \\'); + T($F, ' then \\'); +@@ -1087,7 +1097,7 @@ EndText + T($F, ' ln -s $(patsubst %$(VERSION),%$(MAJVERS),$(@F)) ' + . '$(patsubst %$(VERSION_LIBX),%$(LIBX),$@); \\'); + T($F, ' ln -s $(patsubst %$(VERSION_LIBX),%$(LIBX),$(@F)) ' . +- '$(INST_LIBDIR)$(BITS)/$(patsubst %.$(VERSION_LIBX),%-static.$(LIBX),$(@F));' ++ '$(INST_LIBDIR)/$(patsubst %.$(VERSION_LIBX),%-static.$(LIBX),$(@F));' + . ' \\'); + T($F, ' echo success; \\'); + T($F, ' else \\'); +@@ -1097,7 +1107,7 @@ EndText + L($F); + + L($F, +- '$(INST_LIBDIR)$(BITS)/%.$(VERSION_SHLX): $(LIBDIR)/%.$(VERSION_SHLX)'); ++ '$(INST_LIBDIR)/%.$(VERSION_SHLX): $(LIBDIR)/%.$(VERSION_SHLX)'); + T($F, '@ echo -n "installing \'$(@F)\'... "'); + T($F, '@ if cp $^ $@ && chmod 755 $@; \\'); + T($F, ' then \\'); +@@ -1168,9 +1178,9 @@ EndText + print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n"; + if ($PKG{LNG} ne 'PYTHON') { + print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n"; +- print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n"; ++ print $F " \$_{LIBDIR} = '" . expand($E_LIBDIR ) . "';\n"; + } elsif ($OPT{PYTHON_LIB_PATH}) { +- print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n"; ++ print $F " \$_{LIBDIR} = '$OPT{PYTHON_LIB_PATH}';\n"; + } + print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n"; + print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n"; +@@ -1406,7 +1416,7 @@ sub find_in_dir { + ++$found; + } + if (! $found) { +- my $libdir = File::Spec->catdir($dir, 'lib' . $BITS); ++ my $libdir = File::Spec->catdir($dir, 'lib'); + my $f = File::Spec->catdir($libdir, $lib); + print "\tchecking $f\n\t" if ($OPT{'debug'}); + if (-e $f) { diff --git a/biology/sra-tools/files/patch-tools_driver-tool_cmdline.cpp b/biology/sra-tools/files/patch-tools_driver-tool_cmdline.cpp new file mode 100644 index 000000000000..46747e4840e5 --- /dev/null +++ b/biology/sra-tools/files/patch-tools_driver-tool_cmdline.cpp @@ -0,0 +1,13 @@ +--- tools/driver-tool/cmdline.cpp.orig 2021-04-21 19:42:12 UTC ++++ tools/driver-tool/cmdline.cpp +@@ -50,6 +50,10 @@ + #define environ (*_NSGetEnviron()) + #endif + ++#if defined(__FreeBSD__) ++extern char **environ; ++#endif ++ + #define TRACE( lvl, ... ) /* ignore */ + + namespace ncbi diff --git a/biology/sra-tools/pkg-descr b/biology/sra-tools/pkg-descr new file mode 100644 index 000000000000..2e56f949b113 --- /dev/null +++ b/biology/sra-tools/pkg-descr @@ -0,0 +1,36 @@ +SRA tools is a toolkit for using data in the INSDC Sequence Read Archives. + +SRAs operated by International Nucleotide Sequence Database Collaboration +houses sequence reads and alignments generated by "next-gen" sequencers. +SRA tools allows conversion of .sra files, which INSDC SRAs maintain, +from/to other formats that the 'next-gen' sequenecers generate including: + +* csfasta/csqual (ABI SOLiD) +* fastq (and fasta for writing) +* hdf5 (PacBio, reading only) +* qseq (older Illumina) +* sam (writing only) / bam (reading only) +* sff + +The toolkit uses NCBI-VDB back-end enabling seamless access to remote SRA data +and local SRA files. + +WWW: https://github.com/ncbi/sra-tools/wiki +SRA tools is a toolkit for using data in the INSDC Sequence Read Archives. + +SRAs operated by International Nucleotide Sequence Database Collaboration +houses sequence reads and alignments generated by "next-gen" sequencers. +SRA tools allows conversion of .sra files, which INSDC SRAs maintain, +from/to other formats that the 'next-gen' sequenecers generate including: + +* csfasta/csqual (ABI SOLiD) +* fastq (and fasta for writing) +* hdf5 (PacBio, reading only) +* qseq (older Illumina) +* sam (writing only) / bam (reading only) +* sff + +The toolkit uses NCBI-VDB back-end enabling seamless access to remote SRA data +and local SRA files. + +WWW: https://github.com/ncbi/sra-tools/wiki diff --git a/biology/sra-tools/pkg-plist b/biology/sra-tools/pkg-plist new file mode 100644 index 000000000000..ea8e06df3cf0 --- /dev/null +++ b/biology/sra-tools/pkg-plist @@ -0,0 +1,82 @@ +bin/abi-dump +bin/abi-load +bin/align-info +bin/bam-load +bin/cache-mgr +bin/cg-load +bin/copycat +bin/fastdump +bin/fastq-dump +bin/fastq-load +bin/helicos-load +bin/illumina-dump +bin/illumina-load +bin/kar +bin/kdbmeta +bin/latf-load +bin/pacbio-load +bin/prefetch +bin/rcexplain +bin/sam-dump +bin/sff-dump +bin/sff-load +bin/sra-pileup +bin/sra-sort +bin/sra-stat +bin/srapath +bin/srf-load +bin/test-sra +bin/vdb-config +bin/vdb-copy +bin/vdb-decrypt +bin/vdb-dump +bin/vdb-encrypt +bin/vdb-get +bin/vdb-lock +bin/vdb-passwd +bin/vdb-unlock +bin/vdb-validate +etc/ncbi/certs.kfg +etc/ncbi/default.kfg +etc/ncbi/vdb-copy.kfg +bin/abi-dump +bin/abi-load +bin/align-info +bin/bam-load +bin/cache-mgr +bin/cg-load +bin/copycat +bin/fastdump +bin/fastq-dump +bin/fastq-load +bin/helicos-load +bin/illumina-dump +bin/illumina-load +bin/kar +bin/kdbmeta +bin/latf-load +bin/pacbio-load +bin/prefetch +bin/rcexplain +bin/sam-dump +bin/sff-dump +bin/sff-load +bin/sra-pileup +bin/sra-sort +bin/sra-stat +bin/srapath +bin/srf-load +bin/test-sra +bin/vdb-config +bin/vdb-copy +bin/vdb-decrypt +bin/vdb-dump +bin/vdb-encrypt +bin/vdb-get +bin/vdb-lock +bin/vdb-passwd +bin/vdb-unlock +bin/vdb-validate +etc/ncbi/certs.kfg +etc/ncbi/default.kfg +etc/ncbi/vdb-copy.kfg