Skip to content

Commit

Permalink
biology/sra-tools: Update to 3.0.6
Browse files Browse the repository at this point in the history
Major code and build system rework since 2.11
Now supports aarch64, unblocking rna-seq and atac-seq metaports
Changes: https://github.com/ncbi/sra-tools/commits/master

Reported by:    portscout
  • Loading branch information
Jason W. Bacon authored and Jason W. Bacon committed Aug 10, 2023
1 parent 5b16ca0 commit 0f2f80c
Show file tree
Hide file tree
Showing 69 changed files with 898 additions and 2,226 deletions.
128 changes: 43 additions & 85 deletions biology/sra-tools/Makefile
@@ -1,109 +1,67 @@
PORTNAME= sra-tools
DISTVERSION= 2.11.0
PORTREVISION= 4
CATEGORIES= biology
DISTVERSION= 3.0.6
CATEGORIES= biology java

MAINTAINER= jwb@FreeBSD.org
COMMENT= NCBI's toolkit for handling data in INSDC Sequence Read Archives
WWW= https://github.com/ncbi/sra-tools/wiki
WWW= https://github.com/ncbi/sra-tools

LICENSE= PD LGPL21+
LICENSE_COMB= multi
LICENSE_FILE_PD= ${WRKSRC}/LICENSE
LICENSE_DISTFILES_LGPL21+ =

ONLY_FOR_ARCHS= amd64
ONLY_FOR_ARCHS_REASON= NCBI-VDB requires SSE2 instructions, no 32-bit support
# Untested on other platforms, aarch64 support was recently added upstream
ONLY_FOR_ARCHS= aarch64 amd64
ONLY_FOR_ARCHS_REASON= Upstream explicitly supports specific platforms

BUILD_DEPENDS= bash:shells/bash \
${LOCALBASE}/lib/libngs-c++.a:biology/ngs-sdk
BUILD_DEPENDS= bash:shells/bash
LIB_DEPENDS= libxml2.so:textproc/libxml2 \
libhdf5.so:science/hdf5 \
libepoll-shim.so:devel/libepoll-shim
libepoll-shim.so:devel/libepoll-shim \
libzstd.so:archivers/zstd

USES= compiler:c11 gmake localbase:ldflags perl5 shebangfix
USE_PERL5= build
USES= bison cmake shebangfix
USE_GITHUB= yes
USE_LDCONFIG= ${PREFIX}/lib64
USE_JAVA= yes

SHEBANG_GLOB= *.sh *.pl
GH_ACCOUNT= ncbi
GH_TUPLE+= ncbi:ngs:${DISTVERSION}:ngs/ngs # ported as biology/ngs-sdk
GH_TUPLE+= ncbi:ncbi-vdb:${DISTVERSION}:vdb/ncbi-vdb

GNU_CONFIGURE= yes
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-freebsd$$(${FREEBSD_RELEASE})
MAKE_ARGS= CCNAME=${CC} CXXNAME=${CXX} PKGCFLAGS="${CFLAGS}" \
INST_ETCDIR=${STAGEDIR}${PREFIX}/etc

NCBI_VDB_WRKSRC= ${WRKSRC}/ncbi-vdb
NCBI_VDB_FILESDIR= ${FILESDIR}
FREEBSD_RELEASE= uname -r | cut -d - -f 1

CFLAGS+= -I${WRKSRC}/interfaces/os/sun
CXXFLAGS+= -I${WRKSRC}/interfaces/os/sun

CONFLICTS_INSTALL= kget
# Builds with earlier versions, but ngs-doc plist differs if jdk17 is present
JAVA_VERSION= 17+

BINARY_ALIAS= gcc=${CC} g++=${CXX}
OPTIONS_DEFINE= EXAMPLES

# 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

# ncbi-vdb build extras
VDB_CONFIGURE_ARGS= \
--with-xml2-prefix=${LOCALBASE} \
--with-hdf5-prefix=${LOCALBASE} \
--prefix=${PREFIX} \
--build=amd64-portbld-freebsd$$(${FREEBSD_RELEASE}) \
CC="${CC}" CXX="${CXX}" TOOLS="${CHOSEN_COMPILER_TYPE}"
VDB_MAKE_ARGS+= -j 1 CCNAME=${CC} CXXNAME=${CXX} PKGCFLAGS="${CFLAGS}"
MAKE_ENV+= CPATH="${LOCALBASE}/include/libepoll-shim"
CFLAGS+= -I${WRKSRC}/lib

pre-patch:
@${CP} ${FILESDIR}/Makefile.bsd ${NCBI_VDB_WRKSRC}/build/
@${CP} ${FILESDIR}/ld.bsd.*.sh ${NCBI_VDB_WRKSRC}/build/
@${MKDIR} ${NCBI_VDB_WRKSRC}/interfaces/os/bsd
@${CP} -p ${NCBI_VDB_WRKSRC}/interfaces/os/mac/endian.h \
${NCBI_VDB_WRKSRC}/interfaces/os/bsd/
SHEBANG_GLOB= *.sh
GH_ACCOUNT= ncbi
GH_TUPLE+= ncbi:ncbi-vdb:${DISTVERSION}:vdb/ncbi-vdb

post-patch:
@${GREP} -q '@@PREFIX@@' ${WRKSRC}/ncbi-vdb/libs/kfg/config.c || (echo "@@PREFIX@@ in file/patch-libs_kfg_config.c is overwritten probably due to using 'make makepatch'"; exit 1)
@${REINPLACE_CMD} -e 's#@@PREFIX@@#"${PREFIX}"#' ${WRKSRC}/ncbi-vdb/libs/kfg/config.c
@${LN} -s ${WRKSRC}/ncbi-vdb/interfaces/cc/gcc/x86_64 ${WRKSRC}/ncbi-vdb/interfaces/cc/gcc/amd64
WITH_DEBUG= yes
CMAKE_ARGS+= -DVDB_LIBDIR:STRING=${WRKSRC}/ncbi-vdb/build/lib

post-patch-TEST-on:
@${REINPLACE_CMD} -e 's|python|${PYTHON_CMD}|' ${WRKSRC}/test/kget/Makefile
post-extract:
@${MKDIR} ${WRKSRC}/ncbi-vdb/interfaces/os/bsd
@${CP} ${FILESDIR}/*.h ${WRKSRC}/ncbi-vdb/interfaces/os/bsd
# cd ${WRKDIR} && ${LN} -s ${WRKSRC}/ncbi-vdb .

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} ${FILESDIR}/byteswap.h ${WRKSRC}/interfaces/override
@cd ${WRKSRC}/ncbi-vdb && ./configure ${VDB_CONFIGURE_ARGS}
@${ECHO} ${CHOSEN_COMPILER_TYPE} > ${WRKSRC}/ncbi-vdb/build/COMP
@cd ${WRKSRC}/ncbi-vdb && ${DO_MAKE_BUILD} ${VDB_MAKE_ARGS}

post-build-TEST-on: do-test

do-install:
cd ${WRKSRC}/amd64-portbld-freebsd*/sra-tools/bsd/clang/*/rel/bin && \
for f in `ls *.${PORTVERSION}`; do \
${INSTALL_PROGRAM} $${f} \
${STAGEDIR}${PREFIX}/bin/`basename $${f%%.${PORTVERSION}}`; \
done
# This follows a static patch. Run "make clean patch" before
# updating the patch.
${REINPLACE_CMD} -e 's|/usr/local/etc/ncbi|${PREFIX}/etc/ncbi|g' \
${WRKSRC}/ncbi-vdb/libs/kfg/config.c
${REINPLACE_CMD} -e 's|/usr/local/bin|${PREFIX}/bin|g' \
${WRKSRC}/tools/external/driver-tool/file-path.posix.cpp
cd ${WRKSRC}/ncbi-vdb/build && cmake .. && make

post-stage:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/*.${DISTVERSION}
${MV} ${STAGEDIR}${PREFIX}/share/examples ${STAGEDIR}${PREFIX}/share/examples-sratools
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
${MV} ${STAGEDIR}${PREFIX}/share/examples-sratools/* ${STAGEDIR}${EXAMPLESDIR}
${RMDIR} ${STAGEDIR}${PREFIX}/share/examples-sratools
${MV} ${STAGEDIR}${PREFIX}/share/examples-java ${STAGEDIR}${EXAMPLESDIR}/java
${MV} ${STAGEDIR}${PREFIX}/share/examples-python ${STAGEDIR}${EXAMPLESDIR}/python

post-stage-EXAMPLES-off:
${RM} -r ${STAGEDIR}${EXAMPLESDIR}

.include <bsd.port.mk>
12 changes: 5 additions & 7 deletions biology/sra-tools/distinfo
@@ -1,7 +1,5 @@
TIMESTAMP = 1624382289
SHA256 (ncbi-sra-tools-2.11.0_GH0.tar.gz) = 10ac0a4d1fafc274bc107de811891d3e803d0713a247581dece4448231883810
SIZE (ncbi-sra-tools-2.11.0_GH0.tar.gz) = 8966605
SHA256 (ncbi-ngs-2.11.0_GH0.tar.gz) = 5fde50784760c00b403c2cc42ead15a4e9477697ee439f0a16edb4de3f52dfcc
SIZE (ncbi-ngs-2.11.0_GH0.tar.gz) = 1100365
SHA256 (ncbi-ncbi-vdb-2.11.0_GH0.tar.gz) = 9a65e3885b9ae1ebecbec871f04ce3162ac3764fb556ecdc8c1e61993e2164aa
SIZE (ncbi-ncbi-vdb-2.11.0_GH0.tar.gz) = 22277539
TIMESTAMP = 1691599515
SHA256 (ncbi-sra-tools-3.0.6_GH0.tar.gz) = 9fecfd819ee9beaf8a1d3e4b76a5d49e747bc064525b40416e0730a168986348
SIZE (ncbi-sra-tools-3.0.6_GH0.tar.gz) = 44957431
SHA256 (ncbi-ncbi-vdb-3.0.6_GH0.tar.gz) = 4b6f93336bf8664fdcc151d41ea0793f0b0f88cfcb7c2aa049f162a72f905223
SIZE (ncbi-ncbi-vdb-3.0.6_GH0.tar.gz) = 18972238
72 changes: 0 additions & 72 deletions biology/sra-tools/files/Makefile.bsd

This file was deleted.

37 changes: 6 additions & 31 deletions biology/sra-tools/files/byteswap.h
@@ -1,40 +1,15 @@
/*===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for Biotechnology Information
*
* This software/database is a "United States Government Work" under the
* terms of the United States Copyright Act. It was written as part of
* the author's official duties as a United States Government employee and
* thus cannot be copyrighted. This software/database is freely available
* to the public for use. The National Library of Medicine and the U.S.
* Government have not placed any restriction on its use or reproduction.
*
* Although all reasonable efforts have been taken to ensure the accuracy
* and reliability of the software and data, the NLM and the U.S.
* Government do not and cannot warrant the performance or results that
* may be obtained by using this software or data. The NLM and the U.S.
* Government disclaim all warranties, express or implied, including
* warranties of performance, merchantability or fitness for any particular
* purpose.
*
* Please cite the author in any work or product based on this material.
*
* ===========================================================================
*
*/

#ifndef _h_byteswap_
#define _h_byteswap_
#ifndef _freebsd_byteswap_h_
#define _freebsd_byteswap_h_

#include <stdint.h>
#include <sys/endian.h>

/* N.B. Sun's BSWAP seems to be macro-based,
meaning that (x) will be evaluated multiple times */
#define __BYTE_ORDER _BYTE_ORDER
#define __BIG_ENDIAN _BIG_ENDIAN
#define __LITTLE_ENDIAN _LITTLE_ENDIAN

#define bswap_16(x) bswap16 (x)
#define bswap_32(x) bswap32 (x)
#define bswap_64(x) bswap64 (x)

#endif /* _h_byteswap_ */
#endif
2 changes: 2 additions & 0 deletions biology/sra-tools/files/endian.h
@@ -0,0 +1,2 @@

#include <sys/endian.h>
47 changes: 0 additions & 47 deletions biology/sra-tools/files/ld.bsd.clang.sh

This file was deleted.

0 comments on commit 0f2f80c

Please sign in to comment.