1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-29 01:13:08 +00:00

New port: biology/ncbi-vdb: NCBI's virtualized back-end for accessing Sequence Read Archive

PR:		223273
Submitted by:	Motomichi Matsuzaki <mzaki@niid.go.jp> (original version)
This commit is contained in:
Yuri Victorovich 2021-04-12 02:29:15 -07:00
parent a396d39f5c
commit d55fba431a
31 changed files with 947 additions and 0 deletions

View File

@ -84,6 +84,7 @@
SUBDIR += ncbi-blast+
SUBDIR += ncbi-cxx-toolkit
SUBDIR += ncbi-toolkit
SUBDIR += ncbi-vdb
SUBDIR += ngs-sdk
SUBDIR += p5-AcePerl
SUBDIR += p5-Bio-ASN1-EntrezGene

64
biology/ncbi-vdb/Makefile Normal file
View File

@ -0,0 +1,64 @@
PORTNAME= ncbi-vdb
DISTVERSION= 2.11.0
CATEGORIES= biology
MAINTAINER= mzaki@niid.go.jp
COMMENT= NCBI's virtualized back-end for accessing Sequence Read Archive
LICENSE= PD
LICENSE_FILE= ${WRKSRC}/LICENSE
ONLY_FOR_ARCHS= amd64 i386
ONLY_FOR_ARCHS_REASON= libs/search/nucstrstr.c requires SSE2 instructions
BUILD_DEPENDS= bash:shells/bash \
libepoll-shim>0:devel/libepoll-shim
LIB_DEPENDS= libxml2.so:textproc/libxml2 \
libhdf5.so:science/hdf5 \
libmbedtls.so:security/mbedtls
USES= compiler:c11 gmake localbase:ldflags perl5 shebangfix
USE_PERL5= build
USE_LDCONFIG= yes
USE_GITHUB= yes
GH_ACCOUNT= ncbi
GH_TUPLE+= ncbi:ngs:${DISTVERSION}:ngs # ported as biology/ngs-sdk
SHEBANG_GLOB= *.sh *.pl
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-xml2-prefix=${LOCALBASE} \
--with-hdf5-prefix=${LOCALBASE} \
--with-mbedtls-prefix=${LOCALBASE} \
CC="${CC}" CXX="${CXX}" TOOLS="${CHOSEN_COMPILER_TYPE}"
MAKE_ARGS+= CCNAME=${CC} CXXNAME=${CXX} PKGCFLAGS="${CFLAGS}"
CFLAGS+= -I${WRKSRC}/lib
MAKE_JOBS_UNSAFE= yes
post-extract:
@${LN} -sf ${WRKSRC_ngs} ${WRKDIR}/ngs
@${LN} -sf ${WRKSRC} ${WRKDIR}/${PORTNAME}
pre-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
@${MKDIR} ${WRKSRC}/interfaces/os/bsd
@${CP} -p ${WRKSRC}/interfaces/os/mac/endian.h ${WRKSRC}/interfaces/os/bsd/
post-patch:
@${GREP} -q '@@PREFIX@@' ${WRKSRC}/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}/libs/kfg/config.c
post-configure:
@${ECHO} ${CHOSEN_COMPILER_TYPE} > ${WRKSRC}/build/COMP
post-install:
# remove static libs built instead of shared libs, see https://github.com/ncbi/ncbi-vdb/issues/36
cd ${STAGEDIR}${PREFIX}/lib && ${RM} libkdf5.a* libncbi-ngs-c++.a* libncbi-ngs.a* libncbi-vdb.a* libncbi-wvdb.a*
.include <bsd.port.mk>

View File

@ -0,0 +1,5 @@
TIMESTAMP = 1618218620
SHA256 (ncbi-ncbi-vdb-2.11.0_GH0.tar.gz) = 9a65e3885b9ae1ebecbec871f04ce3162ac3764fb556ecdc8c1e61993e2164aa
SIZE (ncbi-ncbi-vdb-2.11.0_GH0.tar.gz) = 22277539
SHA256 (ncbi-ngs-2.11.0_GH0.tar.gz) = 5fde50784760c00b403c2cc42ead15a4e9477697ee439f0a16edb4de3f52dfcc
SIZE (ncbi-ngs-2.11.0_GH0.tar.gz) = 1100365

View File

@ -0,0 +1,72 @@
# ===========================================================================
#
# 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.
#
# ===========================================================================
# default compiler
ifeq (,$(COMP))
COMP = clang
endif
# handle attempts to set cross-compilation architecture
# note that if your installation is set up for cross compilation,
# you can try to enable it on your own.
ifeq (i386,$(ARCH))
i386:
@ true
x86_64:
@ echo "FreeBSD builds do not support cross-compilation to this architecture"
endif
ifeq (x86_64,$(ARCH))
i386:
@ echo "FreeBSD builds do not support cross-compilation to this architecture"
x86_64:
@ true
endif
.PHONY: i386 x86_64
# library prefix
LPFX = lib
# file extensions
OBJX = o
LOBX = pic.o
LIBX = a
SHLX = so
# compilation defines
DEFINES := -DBSD -DUNIX -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DPKGNAME=bsd$(BITS)
# FreeBSD is a Unix variant; for most cases, linux sources do well
OS_DAD = linux
OS_GDAD = unix
# flex+bison: on Mac, use source-controlled generated .c/.h files
YACC = @ true
LEX = @ true
# build matrix
COMPILERS = CLANG GCC

View File

@ -0,0 +1,30 @@
--- build/Makefile.clang.orig 2021-03-15 18:16:43 UTC
+++ build/Makefile.clang
@@ -24,23 +24,23 @@
# compilers
-CC = @ $(TOP)/build/cc.sh $(OS) 'clang -c' \
+CC = @ $(TOP)/build/cc.sh $(OS) '$(CCNAME) -c' \
$(CHECKSUM) --objx $(OBJX) --cflags "$(CFLAGS)" -MD
-CP = @ $(TOP)/build/cc.sh $(OS) 'clang++ -c' \
+CP = @ $(TOP)/build/cc.sh $(OS) '$(CXXNAME) -c' \
$(CHECKSUM) --objx $(OBJX) -stdlib=libc++ --cflags "$(CPFLAGS)" -MD
# C preprocessor
PP = gcc -E $(CFLAGS)
# linkers
-LD = @ $(TOP)/build/ld.sh $(OS) $(ARCH) clang \
+LD = @ $(TOP)/build/ld.sh $(OS) $(ARCH) $(CCNAME) \
--build $(BUILD) --ldflags "$(LDFLAGS)" $(STATIC) \
$(STATICSYSLIBS) $(CHECKSUM) --objx $(OBJX) --shlx $(SHLX) --libx $(LIBX) \
-MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
LPFLAGS = $(LDFLAGS)
-LP = @ $(TOP)/build/ld.sh $(OS) $(ARCH) clang++ \
+LP = @ $(TOP)/build/ld.sh $(OS) $(ARCH) $(CXXNAME) \
--build $(BUILD) --ldflags "$(LDFLAGS)" $(STATIC) \
$(STATICSYSLIBS) $(CHECKSUM) --objx $(OBJX) --shlx $(SHLX) --libx $(LIBX) \
-MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)

View File

@ -0,0 +1,28 @@
--- build/Makefile.env.orig 2021-03-15 18:16:43 UTC
+++ build/Makefile.env
@@ -333,6 +333,25 @@ INCDIRS = \
$(addprefix -I,$(XTINC) $(NGSINC)) \
-I.
+# linker paths
+LDPATHS =
+
+ifneq (,$(HDF5_LIBDIR))
+ LDPATHS += -L$(HDF5_LIBDIR)
+endif
+ifneq (,$(XML2_LIBDIR))
+ LDPATHS += -L$(XML2_LIBDIR)
+endif
+ifneq (,$(MAGIC_LIBDIR))
+ LDPATHS += -L$(MAGIC_LIBDIR)
+endif
+ifneq (,$(MBEDTLS_LIBDIR))
+ LDPATHS += -L$(MBEDTLS_LIBDIR)
+endif
+ifneq (,$(FUSE_LIBDIR))
+ LDPATHS += -L$(FUSE_LIBDIR)
+endif
+
# defines that describe os & architecture
DLLX ?= $(SHLX)

View File

@ -0,0 +1,35 @@
--- build/Makefile.gcc.orig 2017-07-14 21:55:36 UTC
+++ build/Makefile.gcc
@@ -22,25 +22,27 @@
#
# ===========================================================================
+CCNAME ?= gcc
+CXXNAME ?= g++
# compilers
-CC = @ $(TOP)/build/cc.sh $(OS) 'gcc -c' \
+CC = @ $(TOP)/build/cc.sh $(OS) '$(CCNAME) -c' \
$(CHECKSUM) --objx $(OBJX) --cflags "$(CFLAGS)" -MD
-CP = @ $(TOP)/build/cc.sh $(OS) 'g++ -c' \
+CP = @ $(TOP)/build/cc.sh $(OS) '$(CXXNAME) -c' \
$(CHECKSUM) --objx $(OBJX) --cflags "$(CPFLAGS)" -MD
# C preprocessor
-PP = gcc -E $(CFLAGS)
+PP = $(CCNAME) -E $(CFLAGS)
# linkers
-LD = @ $(TOP)/build/ld.sh $(OS) $(ARCH) gcc \
+LD = @ $(TOP)/build/ld.sh $(OS) $(ARCH) $(CCNAME) \
--build $(BUILD) --ldflags "$(LDFLAGS)" $(STATIC) \
$(STATICSYSLIBS) $(CHECKSUM) --objx $(OBJX) --shlx $(SHLX) --libx $(LIBX) \
-MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
LPFLAGS = $(LDFLAGS)
-LP = @ $(TOP)/build/ld.sh $(OS) $(ARCH) g++ \
+LP = @ $(TOP)/build/ld.sh $(OS) $(ARCH) $(CXXNAME) \
--build $(BUILD) --ldflags "$(LPFLAGS)" $(STATIC) \
$(STATICSYSLIBS) $(CHECKSUM) --objx $(OBJX) --shlx $(SHLX) --libx $(LIBX) \
-MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)

View File

@ -0,0 +1,11 @@
--- build/Makefile.install.orig 2021-03-15 18:16:43 UTC
+++ build/Makefile.install
@@ -69,7 +69,7 @@ ifeq (1,$(HAVE_HDF5))
endif
-LIB_TARGET = $(INST_LIBDIR)$(BITS)
+LIB_TARGET = $(INST_LIBDIR)
LIBRARIES_WITH_PREFIX = \
$(addprefix $(LIB_TARGET)/$(LPFX),$(LIBRARIES_TO_INSTALL))

View File

@ -0,0 +1,31 @@
--- build/Makefile.shell.orig 2017-07-14 21:55:36 UTC
+++ build/Makefile.shell
@@ -36,6 +36,9 @@ endif
ifeq (Linux, $(UNAME))
HOST_OS = linux
endif
+ifeq (FreeBSD, $(UNAME))
+ HOST_OS = bsd
+endif
ifeq (SunOS, $(UNAME))
HOST_OS = sun
ARCHITECTURES = x86_64 i386
@@ -83,6 +86,9 @@ else
ifeq (x86_64, $(MARCH))
HOST_ARCH = x86_64
endif
+ ifeq (amd64, $(MARCH))
+ HOST_ARCH = x86_64
+ endif
ifeq (i86pc, $(MARCH))
HOST_ARCH = x86_64
ARCHITECTURES = x86_64 i386
@@ -93,7 +99,7 @@ else
endif
endif
-ARCH = $(HOST_ARCH)
+override ARCH = $(HOST_ARCH)
REMOTE_ARCH = $(ARCH)
# pick up dependencies from object directory

View File

@ -0,0 +1,22 @@
--- build/ld.bsd.dlib.sh.orig 2017-10-27 07:23:08 UTC
+++ build/ld.bsd.dlib.sh
@@ -51,8 +51,8 @@ case "$LD" in
g*)
source "${0%dlib.sh}gcc.sh"
;;
-i*)
- source "${0%dlib.sh}icc.sh"
+c*)
+ source "${0%dlib.sh}clang.sh"
;;
*)
echo "$SELF_NAME: unrecognized ld tool - '$LD'"
@@ -100,7 +100,7 @@ then
# always load libdl as shared library
load-ref-symbols
load-dynamic
- CMD="$CMD -ldl"
+# CMD="$CMD -ldl"
;;
-l*)

View File

@ -0,0 +1,22 @@
--- build/ld.bsd.exe.sh.orig 2017-10-27 07:23:08 UTC
+++ build/ld.bsd.exe.sh
@@ -51,8 +51,8 @@ case "$LD" in
g*)
source "${0%exe.sh}gcc.sh"
;;
-i*)
- source "${0%exe.sh}icc.sh"
+c*)
+ source "${0%exe.sh}clang.sh"
;;
*)
echo "$SELF_NAME: unrecognized ld tool - '$LD'"
@@ -108,7 +108,7 @@ then
# always load libdl as shared library
load-ref-symbols
load-dynamic
- CMD="$CMD -ldl"
+# CMD="$CMD -ldl"
;;
-l*)

View File

@ -0,0 +1,49 @@
--- build/ld.sh.orig 2021-04-12 06:10:01 UTC
+++ build/ld.sh
@@ -68,6 +68,8 @@ HAVE_M=0
NEED_M=1
HAVE_XML=0
NEED_XML=0
+HAVE_MBEDTLS=0
+NEED_MBEDTLS=0
HAVE_KFC=0
HAVE_KAPP=0
HAVE_NCBI_VDB=0
@@ -297,11 +299,12 @@ do
-[lds]ncbi-vdb)
HAVE_NCBI_VDB=1
KPROC=4
- HAVE_GZIP=1
- HAVE_BZIP=1
+ NEED_GZIP=1
+ NEED_BZIP=1
HAVE_KFC=1
NEED_M=1
NEED_XML=1
+ NEED_MBEDTLS=1
LIBS="$LIBS $1"
;;
-[lds]ncbi-ngs-c++)
@@ -310,11 +313,12 @@ do
-[lds]ncbi-wvdb)
HAVE_NCBI_WVDB=1
KPROC=4
- HAVE_GZIP=1
- HAVE_BZIP=1
+ NEED_GZIP=1
+ NEED_BZIP=1
HAVE_KFC=1
NEED_M=16
NEED_XML=1
+ NEED_MBEDTLS=1
LIBS="$LIBS $1"
;;
@@ -505,6 +509,7 @@ fi
# supply missing libraries
[ $HAVE_GZIP -eq 0 ] && [ $NEED_GZIP -ne 0 ] && LIBS="$LIBS -lz"
[ $HAVE_BZIP -eq 0 ] && [ $NEED_BZIP -ne 0 ] && LIBS="$LIBS -lbz2"
+[ $HAVE_MBEDTLS -eq 0 ] && [ $NEED_MBEDTLS -ne 0 ] && LIBS="$LIBS -lmbedtls -lmbedcrypto -lmbedx509"
[ $HAVE_DL -eq 0 ] && [ $NEED_DL -ne 0 ] && LIBS="$LIBS -ldl"
[ $HAVE_M -eq 0 ] && [ $NEED_M -ne 0 ] && HAVE_M=16
[ $HAVE_XML -eq 0 ] && [ $NEED_XML -ne 0 ] && HAVE_XML=32

View File

@ -0,0 +1,12 @@
To omit building bundled libraries.
--- libs/Makefile.orig 2021-03-15 18:16:43 UTC
+++ libs/Makefile
@@ -35,7 +35,6 @@ include $(TOP)/build/Makefile.config
# default
#
MAIN_SUBDIRS = \
- ext \
kfc \
klib \
kproc \

View File

@ -0,0 +1,20 @@
--- libs/kfg/config.c.orig 2021-03-15 18:16:43 UTC
+++ libs/kfg/config.c
@@ -2577,7 +2577,7 @@ bool load_from_std_location ( KConfig *self, const KDi
const char * std_locs [] =
{
#if ! WINDOWS
- "/etc/ncbi",
+ @@PREFIX@@ "/etc/ncbi",
#else
"/c/ncbi",
#endif
@@ -2850,6 +2850,8 @@ void add_predefined_nodes ( KConfig * self, const char
#define OS "win"
#elif SUN
#define OS "sun"
+#elif BSD
+ #define OS "bsd"
#else
#error unrecognized OS
#endif

View File

@ -0,0 +1,11 @@
--- libs/klib/unix/systime.c.orig 2017-07-14 21:55:36 UTC
+++ libs/klib/unix/systime.c
@@ -142,7 +142,7 @@ LIB_EXPORT KTime_t CC KTimeMakeTime ( co
t . tm_isdst = self -> dst;
ts = mktime ( &t );
- ts -= timezone;
+ ts += localtime(&ts)->tm_gmtoff;
}
return ts;

View File

@ -0,0 +1,13 @@
--- libs/kns/Makefile.orig 2017-07-14 21:55:36 UTC
+++ libs/kns/Makefile
@@ -39,6 +39,10 @@ OBJFILES = \
include $(TOP)/build/Makefile.env
+ifdef MBEDTLS_INCDIR
+ INCDIRS += $(addprefix -I,$(MBEDTLS_INCDIR))
+endif
+
RWORKDIR = $(TOP)/$(MODULE)
#-------------------------------------------------------------------------------

View File

@ -0,0 +1,11 @@
--- libs/kns/linux/syspoll.c.orig 2021-04-12 05:19:32 UTC
+++ libs/kns/linux/syspoll.c
@@ -43,7 +43,7 @@
#include <unistd.h>
#include <errno.h>
-#include <sys/epoll.h>
+#include <libepoll-shim/sys/epoll.h>
#include <sys/types.h>
#include <sys/socket.h>

View File

@ -0,0 +1,10 @@
--- libs/kns/unix/syssock.c.orig 2017-07-14 21:55:36 UTC
+++ libs/kns/unix/syssock.c
@@ -66,6 +66,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
+#include <netinet/in.h>
#include <netinet/tcp.h>
#include <poll.h>
#include <unistd.h>

View File

@ -0,0 +1,40 @@
--- libs/ncbi-vdb/Makefile.orig 2021-03-15 18:16:43 UTC
+++ libs/ncbi-vdb/Makefile
@@ -121,15 +121,16 @@ LDFLAGS += -L$(XML2_LIBDIR)
endif
endif
+ifneq (,$(MBEDTLS_LIBDIR))
+LDFLAGS += -L$(MBEDTLS_LIBDIR)
+endif
+
VDB_LIB_CMN = \
align-access \
ncbi-bam \
vfs \
cloud \
$(LIBKXML) \
- mbedx509 \
- mbedtls \
- mbedcrypto \
kns \
kfg \
krypto \
@@ -138,9 +139,7 @@ VDB_LIB_CMN = \
klib \
kproc \
$(LIBKQ) \
- kfc \
- bz2 \
- z \
+ kfc
VDB_LIB_RD = \
align-reader \
@@ -198,4 +197,4 @@ fuzz:
$(TOP)/build/ld.sh linux x86_64 gcc --build dbg --ldflags "-g -m64" --objx o --shlx so --libx a --srcdir $(SRCDIR) --bindir $(BINDIR) --slib -o $(FLIBDIR)/libncbi-vdb.$(LIBX) -L$(FLIBDIR) $(VDB_LIB) $(VDB_NGS_LIB)
cleanfuzz:
- rm -rf $(FLIBDIR)/*
\ No newline at end of file
+ rm -rf $(FLIBDIR)/*

View File

@ -0,0 +1,12 @@
--- libs/search/Makefile.orig 2017-07-14 21:55:36 UTC
+++ libs/search/Makefile
@@ -39,6 +39,9 @@ OBJFILES = \
include $(TOP)/build/Makefile.env
+CARCH += -msse2
+# nucstrstr.c requires SSE2
+
#-------------------------------------------------------------------------------
# outer targets
#

View File

@ -0,0 +1,253 @@
--- setup/konfigure.perl.orig 2021-03-15 18:16:43 UTC
+++ setup/konfigure.perl
@@ -192,7 +192,7 @@ if ($OPT{'help'}) {
foreach (@ARGV) {
@_ = split('=');
next if ($#_ != 1);
- $OPT{$_[0]} = $_[1] if ($_[0] eq 'CXX' || $_[0] eq 'LDFLAGS');
+ $OPT{$_[0]} = $_[1] if ($_[0] eq 'CC' || $_[0] eq 'CXX' || $_[0] eq 'LDFLAGS' || $_[0] eq 'TOOLS');
}
println "Configuring $PACKAGE_NAME package";
@@ -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 =~ /freebsd/i || $OSTYPE =~ /darwin/i || $OSTYPE eq 'win') {
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_|amd)64/i) {
$BITS = 64;
} elsif ($MARCH eq 'fat86') {
$BITS = '32_64';
@@ -337,6 +337,19 @@ 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';
+ unless ($TOOLS) {
+ $TOOLS = 'clang';
+ $TOOLS = $OPT{TOOLS} if ($OPT{TOOLS});
+ }
+ $PYTHON = $ENV{FREEBSD_PYTHON_CMD};
} elsif ($OSTYPE =~ /darwin/i) {
$LPFX = 'lib';
$OBJX = 'o';
@@ -362,17 +375,19 @@ my ($ARCH_FL, $DBG, $OPT, $PIC, $INC, $MD, $LDFLAGS) =
print "checking for supported tool chain... " unless ($AUTORUN);
+$CC = $OPT{CC } if ($OPT{CC });
$CPP = $OPT{CXX } if ($OPT{CXX });
$LDFLAGS = $OPT{LDFLAGS} if ($OPT{LDFLAGS});
if ($TOOLS =~ /gcc$/) {
$CPP = 'g++' unless ($CPP);
- $CC = "$TOOLS -c";
+ $CC = 'gcc' unless ($CC);
+ $LD = $CC;
+ $CC = "$CC -c";
$CP = "$CPP -c";
$AR = 'ar rc';
$ARX = 'ar x';
$ARLS = 'ar t';
- $LD = $TOOLS;
$LP = $CPP;
$DBG = '-g -DDEBUG';
@@ -382,21 +397,24 @@ if ($TOOLS =~ /gcc$/) {
$MD = '-MD';
} elsif ($TOOLS eq 'clang') {
$CPP = 'clang++' unless ($CPP);
- $CC = 'clang -c';
- my $versionMin = '-mmacosx-version-min=10.10';
+ $CC = 'clang' unless ($CC);
+ $LD = $CC;
+ $CC = "$CC -c";
+ my $versionMin = '';
+ $versionMin = '-mmacosx-version-min=10.6' if ($OSTYPE =~ /darwin/i);
$CP = "$CPP -c $versionMin";
if ($BITS ne '32_64') {
$ARCH_FL = '-arch i386' if ($BITS == 32);
$OPT = '-O3';
$AR = 'ar rc';
- $LD = "clang $ARCH_FL";
+ $LD = "$LD $ARCH_FL";
$LP = "$CPP $versionMin $ARCH_FL";
} else {
$MAKE_MANIFEST = '( echo "$^" > $@/manifest )';
$ARCH_FL = '-arch i386 -arch x86_64';
$OPT = '-O3';
$AR = 'libtool -static -o';
- $LD = "clang -Wl,-arch_multiple $ARCH_FL -Wl,-all_load";
+ $LD = "$LD -Wl,-arch_multiple $ARCH_FL -Wl,-all_load";
$LP = "$CPP $versionMin -Wl,-arch_multiple $ARCH_FL -Wl,-all_load";
}
$ARX = 'ar x';
@@ -826,13 +844,13 @@ OS_ARCH = \$(shell perl \$(TOP)/setup/os-arch.perl)
# install paths
EndText
- L($F, "INST_BINDIR = $OPT{'bindir'}" ) if ($OPT{'bindir'});
- L($F, "INST_LIBDIR = $OPT{'libdir'}" ) if ($OPT{'libdir'});
- L($F, "INST_INCDIR = $OPT{'includedir'}" ) if ($OPT{'includedir'});
- L($F, "INST_SCHEMADIR = $OPT{'shemadir'}" ) if ($OPT{'shemadir'});
- L($F, "INST_SHAREDIR = $OPT{'sharedir'}" ) if ($OPT{'sharedir'});
- L($F, "INST_JARDIR = $OPT{'javadir'}" ) if ($OPT{'javadir'});
- L($F, "INST_PYTHONDIR = $OPT{'pythondir'}") if ($OPT{'pythondir'});
+ L($F, "INST_BINDIR = \$(DESTDIR)$OPT{'bindir'}" ) if ($OPT{'bindir'});
+ L($F, "INST_LIBDIR = \$(DESTDIR)$OPT{'libdir'}" ) if ($OPT{'libdir'});
+ L($F, "INST_INCDIR = \$(DESTDIR)$OPT{'includedir'}" ) if ($OPT{'includedir'});
+ L($F, "INST_SCHEMADIR = \$(DESTDIR)$OPT{'shemadir'}" ) if ($OPT{'shemadir'});
+ L($F, "INST_SHAREDIR = \$(DESTDIR)$OPT{'sharedir'}" ) if ($OPT{'sharedir'});
+ L($F, "INST_JARDIR = \$(DESTDIR)$OPT{'javadir'}" ) if ($OPT{'javadir'});
+ L($F, "INST_PYTHONDIR = \$(DESTDIR)$OPT{'pythondir'}") if ($OPT{'pythondir'});
my ($E_VERSION_SHLX, $VERSION_SHLX,
$E_MAJVERS_SHLX , $MAJMIN_SHLX, $MAJVERS_SHLX);
@@ -896,7 +914,7 @@ MAJMIN_EXEX = \$(EXEX).\$(MAJMIN)
MAJVERS_EXEX = \$(EXEX).\$(MAJVERS)
# system architecture and wordsize
-ARCH = $ARCH
+override ARCH = $ARCH
EndText
L($F, "# ARCH = $ARCH ( $MARCH )") if ($ARCH ne $MARCH);
@@ -932,7 +950,7 @@ EndText
}
L($F, "PIC = $PIC") if ($PIC);
if ($PKG{LNG} eq 'C') {
- if ($TOOLS =~ /clang/i) {
+ if ($OSTYPE =~ /darwin/i) {
L($F, 'SONAME = -install_name ' .
'$(INST_LIBDIR)$(BITS)/$(subst $(VERSION),$(MAJVERS),$(@F)) \\');
L($F, ' -compatibility_version $(MAJMIN) -current_version $(VERSION) \\');
@@ -1043,7 +1061,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):');
T($F, 'mkdir -p $@');
} elsif ($PKG{LNG} eq 'JAVA') {
# test if we have jni header path
@@ -1073,12 +1091,12 @@ EndText
L($F, 'export CONFIGURE_FOUND_XML2');
L($F);
- if ($OS eq 'linux' || $OS eq 'mac') {
+ if ($OS eq 'linux' || $OS eq 'bsd' || $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, '@ if $(BSD_INSTALL_DATA) $^ $@; \\');
T($F, ' then \\');
T($F, ' rm -f $(patsubst %$(VERSION),%$(MAJVERS),$@) '
. '$(patsubst %$(VERSION_LIBX),%$(LIBX),$@) '
@@ -1087,7 +1105,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,15 +1115,15 @@ 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, '@ if $(BSD_INSTALL_LIB) $^ $@; \\');
T($F, ' then \\');
if ($OS ne 'mac') {
T($F, ' rm -f $(patsubst %$(VERSION),%$(MAJVERS),$@) '
. '$(patsubst %$(VERSION_SHLX),%$(SHLX),$@); \\');
}
- if ($OS eq 'linux') {
+ if ($OS eq 'linux' || $OS eq 'bsd') {
T($F, ' ln -s $(@F) $(patsubst %$(VERSION),%$(MAJVERS),$@); \\');
} elsif ($OS eq 'mac') {
T($F, ' ln -sf $(@F) '
@@ -1124,7 +1142,7 @@ EndText
L($F, '$(INST_BINDIR)/%$(VERSION_EXEX): $(BINDIR)/%$(VERSION_EXEX)');
T($F, '@ echo -n "installing \'$(@F)\'... "');
- T($F, '@ if cp $^ $@ && chmod 755 $@; \\');
+ T($F, '@ if $(BSD_INSTALL_PROGRAM) $^ $@; \\');
T($F, ' then \\');
T($F, ' rm -f $(patsubst %$(VERSION),%$(MAJVERS),$@) '
. '$(patsubst %$(VERSION_EXEX),%$(EXEX),$@); \\');
@@ -1406,7 +1424,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) {
@@ -1628,12 +1646,12 @@ sub find_lib {
sub check_compiler {
my ($t, $n, $I, @l) = @_;
- my $tool = $TOOLS;
+ my $tool = $CC;
if ($t eq 'L') {
print "checking for $n library... ";
} elsif ($t eq 'O') {
- if ($tool && ($tool =~ /gcc$/ || $tool =~ /g\+\+$/)) {
+ if ($tool && ($tool =~ /gcc/ || $tool =~ /g\+\+/)) {
print "checking whether $tool accepts $n... ";
} else {
return;
@@ -1663,6 +1681,9 @@ sub check_compiler {
} elsif ($n eq 'magic') {
$library = '-lmagic';
$log = '#include <magic.h> \n int main() { magic_open (0); }\n'
+ } elsif ($n eq 'mbedtls') {
+ $library = '-lmbedtls';
+ $log = '#include <mbedtls/version.h> \n int main() { mbedtls_version_get_string(0); }\n'
} elsif ($n eq 'xml2') {
$library = '-lxml2';
$library .= ' -liconv' if ($OS eq 'mac');
@@ -1706,7 +1727,7 @@ sub check_compiler {
}
}
my $gcc = "| $tool -xc $flags " . ($I ? "-I$I " : ' ')
- . ($l ? "-L$l " : ' ') . "- $library";
+ . ($l ? "-L$l " : ' ') . "-o a.out - $library";
$gcc .= ' 2> /dev/null' unless ($OPT{'debug'});
open GCC, $gcc or last;

View File

@ -0,0 +1,20 @@
--- setup/os-arch.prl.orig 2021-03-15 18:16:43 UTC
+++ setup/os-arch.prl
@@ -11,6 +11,8 @@ sub OsArch {
chomp $UNAME;
if ($UNAME =~ /Darwin/) {
$HOST_OS = 'mac';
+ } elsif ($UNAME =~ /.*BSD/) {
+ $HOST_OS = 'bsd';
} elsif ($UNAME =~ /Linux/) {
$HOST_OS = 'linux';
} elsif ($UNAME =~ /SunOS/) {
@@ -48,6 +50,8 @@ sub OsArch {
$HOST_ARCH = 'i386';
}
} elsif ($MARCH =~ /x86_64/) {
+ $HOST_ARCH = 'x86_64';
+ } elsif ($MARCH =~ /amd64/) {
$HOST_ARCH = 'x86_64';
} elsif ($MARCH =~ /i86pc/) {
$HOST_ARCH = 'x86_64';

View File

@ -0,0 +1,26 @@
--- setup/package.prl.orig 2021-03-15 18:16:43 UTC
+++ setup/package.prl
@@ -12,6 +12,7 @@ sub PKG { ( LNG => 'C',
sub DEPENDS { ( { name => 'fuse' , Include => '/usr/include' , },
{ name => 'hdf5' , Include => '/usr/include' , },
{ name => 'magic', Include => '/usr/include' , },
+ { name => 'mbedtls', Include => '/usr/include' , },
{ name => 'xml2' , Include => '/usr/include/libxml2', } ) }
sub REQ { ( { name => 'ngs-sdk',
aname => 'NGS',
@@ -54,6 +55,15 @@ sub REQ { ( { name => 'ngs-sdk',
usrpath => '$HOME',
include => 'magic.h',
lib => 'libmagic.so',
+ },
+ { name => 'mbedtls',
+ option => 'with-mbedtls-prefix',
+ origin => 'E',
+ type => 'LIO',
+ pkgpath => '/usr',
+ usrpath => '$HOME',
+ include => 'mbedtls/config.h',
+ lib => 'libmbedtls.so',
},
{ name => 'xml2',
option => 'with-xml2-prefix',

View File

@ -0,0 +1,49 @@
--- test/kapp/run-sig-core.sh.orig 2017-10-27 07:23:08 UTC
+++ test/kapp/run-sig-core.sh
@@ -29,12 +29,12 @@ BUILD_TYPE="$3"
SIGQUIT=3
-function killFromBackground ()
+killFromBackground ()
{
PARENT_PID=$1
for I in 1 2 3 4 5
do
- COMMAND="ps -ef|awk '\$3==${PARENT_PID} && \$8==\"${BINARY_PATH}\" {print \$2}'"
+ COMMAND="ps awwo pid,ppid,command|awk '\$2==${PARENT_PID} && \$3==\"${BINARY_PATH}\" {print \$1}'"
eval PID=\`${COMMAND}\`
if [ "$PID" = "" ]; then
sleep 1
@@ -44,7 +44,7 @@ function killFromBackground ()
done
if [ "$PID" != "" ]; then
- kill -s $SIGQUIT $PID
+ kill -s QUIT $PID
fi
echo $PID > killed.pid
@@ -63,6 +63,13 @@ if [ "$HOST_OS" = "mac" ]; then
fi
CORE_FOLDER="/core/"
+elif [ "$HOST_OS" = "bsd" ]; then
+ if [ "`ulimit -c`" = "0" ] || [ "`/sbin/sysctl -n kern.coredump`" != "1" ]; then
+ echo "Core files are disabled. Skipping core file tests"
+ exit 0
+ fi
+
+ CORE_FOLDER="./"
elif [ "$HOST_OS" = "linux" ]; then
if [ "`ulimit -c`" = "0" ]; then
echo "Core files are disabled. Skipping core file tests"
@@ -92,7 +99,7 @@ wait
BINARY_PID=`cat killed.pid`
rm killed.pid
-CORE_FILE="${CORE_FOLDER}core.${BINARY_PID}"
+CORE_FILE="${CORE_FOLDER}${BINARY_PATH##*/}.core"
if [ "$BUILD_TYPE" = "dbg" ]; then
if [ -f $CORE_FILE ]; then

View File

@ -0,0 +1,11 @@
--- test/kfg/kfgtest.cpp.orig 2019-08-20 18:27:10 UTC
+++ test/kfg/kfgtest.cpp
@@ -280,6 +280,8 @@ FIXTURE_TEST_CASE(predef_OS, KfgFixture)
CreateAndLoad(GetName(), "var=$(OS)\n");
#if LINUX
#define OS "linux"
+ #elif BSD
+ #define OS "bsd"
#elif SUN
#define OS "sun"
#elif MAC

View File

@ -0,0 +1,11 @@
--- test/klib/printf-test.c.orig 2019-08-20 18:27:10 UTC
+++ test/klib/printf-test.c
@@ -503,7 +503,7 @@ rc_t run ( const char *progname )
if ( rc == 0 )
{
rc = make_initial_test ( field_width, precision, " ", "s", "Kurt is having a fit" );
-#if !defined(__SunOS) && !defined(__sun__)
+#if !defined(__SunOS) && !defined(__sun__) && !defined(__FreeBSD__)
/* Solaris printf doesn't cope with NULLs */
rc = make_initial_test ( field_width, precision, " ", "s", NULL );
#endif

View File

@ -0,0 +1,32 @@
run-test-proxy-with-scheme requires a web proxy server.
--- test/kns/Makefile.orig 2019-08-20 18:27:10 UTC
+++ test/kns/Makefile
@@ -25,7 +25,7 @@
default: runtests
-runtests: run-tests run-test-proxy-with-scheme
+runtests:
TOP ?= $(abspath ../..)
MODULE = test/kns
@@ -45,6 +45,10 @@ TEST_TOOLS = \
include $(TOP)/build/Makefile.env
+ifdef MBEDTLS_INCDIR
+ INCDIRS += $(addprefix -I,$(MBEDTLS_INCDIR))
+endif
+
EXT_TOOLS = \
test-proxy \
test-proxy-with-env \
@@ -131,6 +135,7 @@ $(TEST_BINDIR)/test-kns: $(KNSTEST_OBJ)
$(LP) --exe -o $@ $^ $(KNSTEST_LIB)
kns: test-kns
+ if [ ! -d $(HOME)/.ncbi ]; then mkdir $(HOME)/.ncbi; fi
$(TEST_BINDIR)/test-kns #-l=all
#----------------------------------------------------------------

View File

@ -0,0 +1,11 @@
--- test/vdb/test-dependencies.cpp.orig 2019-08-20 18:27:10 UTC
+++ test/vdb/test-dependencies.cpp
@@ -115,7 +115,7 @@ class EmptyFixture : public DepFixture { (public)
class RefseqFixture : public DepFixture {
- #if LINUX
+ #if LINUX || BSD
#define PATH "kfg/linux"
#elif MAC
#define PATH "kfg/mac"

View File

@ -0,0 +1,11 @@
--- test/vfs/redirect-rejected-names-cgi-http-to-https.cpp.orig 2017-07-14 21:55:36 UTC
+++ test/vfs/redirect-rejected-names-cgi-http-to-https.cpp
@@ -148,7 +148,7 @@ struct Test : protected ncbi :: NK :: Sh
TEST_CASE(TEST) {
-#define RESOLVER_CGI_HEAD "test.ncbi.nlm.nih."
+#define RESOLVER_CGI_HEAD "www.ncbi.nlm.nih."
#ifdef VDB_3162
#else

View File

@ -0,0 +1,7 @@
NCBI-VDB is a virtualized back-end engine library for Sequencing Read Archives.
The 'front-end' API are provided by biology/ngs-sdk port.
Although the GitHub repository also contains Java and Python codes,
this port currently builds only C- and C++-based libraries.
WWW: https://github.com/ncbi/ncbi-vdb/wiki

View File

@ -0,0 +1,17 @@
include/ncbi-vdb/NGS.hpp
lib/libkdf5-static.a
lib/libkdf5.so
lib/libkdf5.so.2
lib/libkdf5.so.2.11.0
lib/libncbi-ngs-c++-static.a
lib/libncbi-ngs-static.a
lib/libncbi-vdb-static.a
lib/libncbi-vdb.so
lib/libncbi-vdb.so.2
lib/libncbi-vdb.so.2.11.0
lib/libncbi-wvdb-static.a
lib/libncbi-wvdb.so
lib/libncbi-wvdb.so.2
lib/libncbi-wvdb.so.2.11.0
lib/ncbi/certs.kfg
lib/ncbi/default.kfg