Date: Mon, 12 Apr 2021 09:29:44 GMT From: Yuri Victorovich <yuri@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: d55fba431adf - main - New port: biology/ncbi-vdb: NCBI's virtualized back-end for accessing Sequence Read Archive Message-ID: <202104120929.13C9TilO095873@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=d55fba431adf6bc61c3553dd91625a4b16115cf6 commit d55fba431adf6bc61c3553dd91625a4b16115cf6 Author: Yuri Victorovich <yuri@FreeBSD.org> AuthorDate: 2021-04-12 09:29:15 +0000 Commit: Yuri Victorovich <yuri@FreeBSD.org> CommitDate: 2021-04-12 09:29:42 +0000 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) --- biology/Makefile | 1 + biology/ncbi-vdb/Makefile | 64 ++++++ biology/ncbi-vdb/distinfo | 5 + biology/ncbi-vdb/files/Makefile.bsd | 72 ++++++ biology/ncbi-vdb/files/patch-build_Makefile.clang | 30 +++ biology/ncbi-vdb/files/patch-build_Makefile.env | 28 +++ biology/ncbi-vdb/files/patch-build_Makefile.gcc | 35 +++ .../ncbi-vdb/files/patch-build_Makefile.install | 11 + biology/ncbi-vdb/files/patch-build_Makefile.shell | 31 +++ biology/ncbi-vdb/files/patch-build_ld.bsd.dlib.sh | 22 ++ biology/ncbi-vdb/files/patch-build_ld.bsd.exe.sh | 22 ++ biology/ncbi-vdb/files/patch-build_ld.sh | 49 ++++ biology/ncbi-vdb/files/patch-libs_Makefile | 12 + biology/ncbi-vdb/files/patch-libs_kfg_config.c | 20 ++ .../ncbi-vdb/files/patch-libs_klib_unix_systime.c | 11 + biology/ncbi-vdb/files/patch-libs_kns_Makefile | 13 ++ .../ncbi-vdb/files/patch-libs_kns_linux_syspoll.c | 11 + .../ncbi-vdb/files/patch-libs_kns_unix_syssock.c | 10 + .../ncbi-vdb/files/patch-libs_ncbi-vdb_Makefile | 40 ++++ biology/ncbi-vdb/files/patch-libs_search_Makefile | 12 + biology/ncbi-vdb/files/patch-setup_konfigure.perl | 253 +++++++++++++++++++++ biology/ncbi-vdb/files/patch-setup_os-arch.prl | 20 ++ biology/ncbi-vdb/files/patch-setup_package.prl | 26 +++ .../ncbi-vdb/files/patch-test_kapp_run-sig-core.sh | 49 ++++ biology/ncbi-vdb/files/patch-test_kfg_kfgtest.cpp | 11 + .../ncbi-vdb/files/patch-test_klib_printf-test.c | 11 + biology/ncbi-vdb/files/patch-test_kns_Makefile | 32 +++ .../files/patch-test_vdb_test-dependencies.cpp | 11 + ...s_redirect-rejected-names-cgi-http-to-https.cpp | 11 + biology/ncbi-vdb/pkg-descr | 7 + biology/ncbi-vdb/pkg-plist | 17 ++ 31 files changed, 947 insertions(+) diff --git a/biology/Makefile b/biology/Makefile index bc59c19d8905..73af8b5788bd 100644 --- a/biology/Makefile +++ b/biology/Makefile @@ -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 diff --git a/biology/ncbi-vdb/Makefile b/biology/ncbi-vdb/Makefile new file mode 100644 index 000000000000..e3ec6af6a55b --- /dev/null +++ b/biology/ncbi-vdb/Makefile @@ -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> diff --git a/biology/ncbi-vdb/distinfo b/biology/ncbi-vdb/distinfo new file mode 100644 index 000000000000..d5c8684089f1 --- /dev/null +++ b/biology/ncbi-vdb/distinfo @@ -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 diff --git a/biology/ncbi-vdb/files/Makefile.bsd b/biology/ncbi-vdb/files/Makefile.bsd new file mode 100644 index 000000000000..7692ec277948 --- /dev/null +++ b/biology/ncbi-vdb/files/Makefile.bsd @@ -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 diff --git a/biology/ncbi-vdb/files/patch-build_Makefile.clang b/biology/ncbi-vdb/files/patch-build_Makefile.clang new file mode 100644 index 000000000000..fb43d0f3964d --- /dev/null +++ b/biology/ncbi-vdb/files/patch-build_Makefile.clang @@ -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) diff --git a/biology/ncbi-vdb/files/patch-build_Makefile.env b/biology/ncbi-vdb/files/patch-build_Makefile.env new file mode 100644 index 000000000000..b6f7158d65d3 --- /dev/null +++ b/biology/ncbi-vdb/files/patch-build_Makefile.env @@ -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) diff --git a/biology/ncbi-vdb/files/patch-build_Makefile.gcc b/biology/ncbi-vdb/files/patch-build_Makefile.gcc new file mode 100644 index 000000000000..b7df82ef7c9f --- /dev/null +++ b/biology/ncbi-vdb/files/patch-build_Makefile.gcc @@ -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) diff --git a/biology/ncbi-vdb/files/patch-build_Makefile.install b/biology/ncbi-vdb/files/patch-build_Makefile.install new file mode 100644 index 000000000000..edd0682cdf14 --- /dev/null +++ b/biology/ncbi-vdb/files/patch-build_Makefile.install @@ -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)) diff --git a/biology/ncbi-vdb/files/patch-build_Makefile.shell b/biology/ncbi-vdb/files/patch-build_Makefile.shell new file mode 100644 index 000000000000..c331ad799a68 --- /dev/null +++ b/biology/ncbi-vdb/files/patch-build_Makefile.shell @@ -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 diff --git a/biology/ncbi-vdb/files/patch-build_ld.bsd.dlib.sh b/biology/ncbi-vdb/files/patch-build_ld.bsd.dlib.sh new file mode 100644 index 000000000000..074f7721b564 --- /dev/null +++ b/biology/ncbi-vdb/files/patch-build_ld.bsd.dlib.sh @@ -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*) diff --git a/biology/ncbi-vdb/files/patch-build_ld.bsd.exe.sh b/biology/ncbi-vdb/files/patch-build_ld.bsd.exe.sh new file mode 100644 index 000000000000..a4ea00c176f1 --- /dev/null +++ b/biology/ncbi-vdb/files/patch-build_ld.bsd.exe.sh @@ -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*) diff --git a/biology/ncbi-vdb/files/patch-build_ld.sh b/biology/ncbi-vdb/files/patch-build_ld.sh new file mode 100644 index 000000000000..900d7e566356 --- /dev/null +++ b/biology/ncbi-vdb/files/patch-build_ld.sh @@ -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 diff --git a/biology/ncbi-vdb/files/patch-libs_Makefile b/biology/ncbi-vdb/files/patch-libs_Makefile new file mode 100644 index 000000000000..f444241b68f9 --- /dev/null +++ b/biology/ncbi-vdb/files/patch-libs_Makefile @@ -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 \ diff --git a/biology/ncbi-vdb/files/patch-libs_kfg_config.c b/biology/ncbi-vdb/files/patch-libs_kfg_config.c new file mode 100644 index 000000000000..d82d3e9143ed --- /dev/null +++ b/biology/ncbi-vdb/files/patch-libs_kfg_config.c @@ -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 diff --git a/biology/ncbi-vdb/files/patch-libs_klib_unix_systime.c b/biology/ncbi-vdb/files/patch-libs_klib_unix_systime.c new file mode 100644 index 000000000000..781fd4b75403 --- /dev/null +++ b/biology/ncbi-vdb/files/patch-libs_klib_unix_systime.c @@ -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; diff --git a/biology/ncbi-vdb/files/patch-libs_kns_Makefile b/biology/ncbi-vdb/files/patch-libs_kns_Makefile new file mode 100644 index 000000000000..6438e3f6bfa6 --- /dev/null +++ b/biology/ncbi-vdb/files/patch-libs_kns_Makefile @@ -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) + + #------------------------------------------------------------------------------- diff --git a/biology/ncbi-vdb/files/patch-libs_kns_linux_syspoll.c b/biology/ncbi-vdb/files/patch-libs_kns_linux_syspoll.c new file mode 100644 index 000000000000..4ed159f5e812 --- /dev/null +++ b/biology/ncbi-vdb/files/patch-libs_kns_linux_syspoll.c @@ -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> + diff --git a/biology/ncbi-vdb/files/patch-libs_kns_unix_syssock.c b/biology/ncbi-vdb/files/patch-libs_kns_unix_syssock.c new file mode 100644 index 000000000000..a188b1c12539 --- /dev/null +++ b/biology/ncbi-vdb/files/patch-libs_kns_unix_syssock.c @@ -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> diff --git a/biology/ncbi-vdb/files/patch-libs_ncbi-vdb_Makefile b/biology/ncbi-vdb/files/patch-libs_ncbi-vdb_Makefile new file mode 100644 index 000000000000..724f06235fcd --- /dev/null +++ b/biology/ncbi-vdb/files/patch-libs_ncbi-vdb_Makefile @@ -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)/* diff --git a/biology/ncbi-vdb/files/patch-libs_search_Makefile b/biology/ncbi-vdb/files/patch-libs_search_Makefile new file mode 100644 index 000000000000..3c01af3268be --- /dev/null +++ b/biology/ncbi-vdb/files/patch-libs_search_Makefile @@ -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 + # diff --git a/biology/ncbi-vdb/files/patch-setup_konfigure.perl b/biology/ncbi-vdb/files/patch-setup_konfigure.perl new file mode 100644 index 000000000000..39a2926d5511 --- /dev/null +++ b/biology/ncbi-vdb/files/patch-setup_konfigure.perl @@ -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; diff --git a/biology/ncbi-vdb/files/patch-setup_os-arch.prl b/biology/ncbi-vdb/files/patch-setup_os-arch.prl new file mode 100644 index 000000000000..28d9b469c744 --- /dev/null +++ b/biology/ncbi-vdb/files/patch-setup_os-arch.prl @@ -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'; diff --git a/biology/ncbi-vdb/files/patch-setup_package.prl b/biology/ncbi-vdb/files/patch-setup_package.prl new file mode 100644 index 000000000000..7f44d3a7e79d --- /dev/null +++ b/biology/ncbi-vdb/files/patch-setup_package.prl @@ -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', + }, *** 199 LINES SKIPPED ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104120929.13C9TilO095873>