pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bedtools: Resurrect and update to 2.31.1



Module Name:	pkgsrc-wip
Committed By:	Jason W. Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Wed Nov 8 09:18:20 2023 -0600
Changeset:	a4e7096bf9b24cca766ed00fc5336d32f0baff8b

Added Files:
	bedtools/DESCR
	bedtools/Makefile
	bedtools/PLIST
	bedtools/distinfo
	bedtools/patches/patch-Makefile
	bedtools/patches/patch-src_utils_BamTools_include_SamHeader.hpp
	bedtools/patches/patch-src_utils_htslib_Makefile
	bedtools/patches/patch-test_test.sh

Log Message:
bedtools: Resurrect and update to 2.31.1

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=a4e7096bf9b24cca766ed00fc5336d32f0baff8b

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 bedtools/DESCR                                     | 11 +++++
 bedtools/Makefile                                  | 33 +++++++++++++
 bedtools/PLIST                                     | 39 ++++++++++++++++
 bedtools/distinfo                                  |  9 ++++
 bedtools/patches/patch-Makefile                    | 54 ++++++++++++++++++++++
 .../patch-src_utils_BamTools_include_SamHeader.hpp | 27 +++++++++++
 bedtools/patches/patch-src_utils_htslib_Makefile   | 24 ++++++++++
 bedtools/patches/patch-test_test.sh                | 20 ++++++++
 8 files changed, 217 insertions(+)

diffs:
diff --git a/bedtools/DESCR b/bedtools/DESCR
new file mode 100644
index 0000000000..468f8242a1
--- /dev/null
+++ b/bedtools/DESCR
@@ -0,0 +1,11 @@
+The bedtools utilities are a suite of tools for performing a wide
+range of genomics analysis tasks.  The most widely-used of these
+tools enable genome arithmetic, i.e., set theory on the genome.
+For example, with bedtools one can intersect, merge, count,
+complement, and shuffle genomic intervals from multiple files in
+common genomic formats such as BAM, BED, GFF/GTF, and VCF.
+
+Although each individual utility is designed to do a relatively
+simple task, e.g., intersect two interval files, more sophisticated
+analyses can be conducted by stringing together multiple bedtools
+operations on the command line or in shell scripts.
diff --git a/bedtools/Makefile b/bedtools/Makefile
new file mode 100644
index 0000000000..bd4ada3094
--- /dev/null
+++ b/bedtools/Makefile
@@ -0,0 +1,33 @@
+# $NetBSD$
+
+DISTNAME=	bedtools-2.31.1
+CATEGORIES=	biology
+MASTER_SITES=	${MASTER_SITE_GITHUB:=arq5x/}
+GITHUB_PROJECT=	bedtools2
+GITHUB_TAG=	v${PKGVERSION_NOREV}
+
+OWNER=		bacon%NetBSD.org@localhost
+HOMEPAGE=	https://bedtools.readthedocs.io/en/latest/
+COMMENT=	Swiss army knife for genome arithmetic
+LICENSE=	mit
+
+USE_LANGUAGES=	c c++
+USE_TOOLS+=	bash:test gmake
+REPLACE_SH+=	scripts/vcfsort.sh
+REPLACE_PYTHON=	scripts/makeBashScripts.py
+
+SUBST_CLASSES+=		pybin
+SUBST_STAGE.pybin=	pre-configure
+SUBST_SED.pybin=	-e 's|python|${PYTHONBIN}|g'
+SUBST_FILES.pybin=	Makefile
+
+LDFLAGS.SunOS+=		-lsocket
+
+do-test:
+	cd ${WRKSRC}/test && bash test.sh
+
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../archivers/bzip2/buildlink3.mk"
+.include "../../archivers/xz/buildlink3.mk"
+.include "../../lang/python/application.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/bedtools/PLIST b/bedtools/PLIST
new file mode 100644
index 0000000000..4e84b3d976
--- /dev/null
+++ b/bedtools/PLIST
@@ -0,0 +1,39 @@
+@comment $NetBSD: PLIST,v 1.2 2021/02/08 01:49:25 bacon Exp $
+bin/annotateBed
+bin/bamToBed
+bin/bamToFastq
+bin/bed12ToBed6
+bin/bedToBam
+bin/bedToIgv
+bin/bedpeToBam
+bin/bedtools
+bin/closestBed
+bin/clusterBed
+bin/complementBed
+bin/coverageBed
+bin/expandCols
+bin/fastaFromBed
+bin/flankBed
+bin/genomeCoverageBed
+bin/getOverlap
+bin/groupBy
+bin/intersectBed
+bin/linksBed
+bin/mapBed
+bin/maskFastaFromBed
+bin/mergeBed
+bin/multiBamCov
+bin/multiIntersectBed
+bin/nucBed
+bin/pairToBed
+bin/pairToPair
+bin/randomBed
+bin/shiftBed
+bin/shuffleBed
+bin/slopBed
+bin/sortBed
+bin/subtractBed
+bin/tagBam
+bin/unionBedGraphs
+bin/windowBed
+bin/windowMaker
diff --git a/bedtools/distinfo b/bedtools/distinfo
new file mode 100644
index 0000000000..14e932625a
--- /dev/null
+++ b/bedtools/distinfo
@@ -0,0 +1,9 @@
+$NetBSD$
+
+BLAKE2s (bedtools-2.31.1.tar.gz) = e5b3faf919f7aaf12251b29fa248e85248ec30dadab45c3fd23523d7ddc78c05
+SHA512 (bedtools-2.31.1.tar.gz) = b62feeb6ef211314a86e022b6104cc2291086b940913cff5878759c37a8be0ac50c174020d8555d71dbc29e6be56ea40fc3c6543b5ef444bc7535124814688d6
+Size (bedtools-2.31.1.tar.gz) = 21085970 bytes
+SHA1 (patch-Makefile) = f38634cad79026c0dd0cad6a6a70db933f002d5f
+SHA1 (patch-src_utils_BamTools_include_SamHeader.hpp) = 7ab168b247b5edf7f3eccd9ef7329a5e1605c787
+SHA1 (patch-src_utils_htslib_Makefile) = 8785ff3110f8df26e0cc5b2fdf1e2e02d6cdc836
+SHA1 (patch-test_test.sh) = e3a17815d6a30c17db7134613d25f08c6be3494e
diff --git a/bedtools/patches/patch-Makefile b/bedtools/patches/patch-Makefile
new file mode 100644
index 0000000000..9fde33a2de
--- /dev/null
+++ b/bedtools/patches/patch-Makefile
@@ -0,0 +1,54 @@
+$NetBSD$
+
+# Portability, respect env
+
+--- Makefile.orig	2023-11-08 15:05:30.454330622 +0000
++++ Makefile
+@@ -4,7 +4,7 @@
+ # (c) 2009 Aaron Quinlan
+ # ==========================
+ 
+-SHELL := /bin/bash -e
++SHELL := /bin/sh -e
+ 
+ VERSION_FILE=./src/utils/version/version_git.h
+ RELEASED_VERSION_FILE=./src/utils/version/version_release.txt
+@@ -21,7 +21,7 @@ OBJ_DIR	= obj
+ BIN_DIR	= bin
+ SRC_DIR	= src
+ 
+-CXX     = g++
++CXX     ?= g++
+ 
+ PYTHON ?= $(shell python --version >/dev/null 2>&1 && echo "python" || echo python3)
+ 
+@@ -43,7 +43,7 @@ endif
+ BT_LDFLAGS =
+ BT_LIBS    = -lz -lm -lbz2 -llzma -lpthread
+ 
+-prefix ?= /usr/local
++PREFIX ?= /usr/local
+ 
+ SUBDIRS = $(SRC_DIR)/annotateBed \
+ 		  $(SRC_DIR)/bamToBed \
+@@ -158,7 +158,7 @@ $(CCPREFIX) $(CC_WRAPPER) $(CXX) $(ALL_C
+ @mv -f $*.Td $*.d
+ endef
+ 
+-$(OBJ_DIR)/%.d: ;
++$(OBJ_DIR)/%.d: $(OBJ_DIR);
+ .PRECIOUS: $(OBJ_DIR)/%.d
+ 
+ -include $(patsubst %.o,%.d,$(BUILT_OBJECTS))
+@@ -200,9 +200,9 @@ $(BIN_DIR)/intersectBed: | $(BIN_DIR)
+ .PHONY: all
+ 
+ install: all
+-	mkdir -p $(DESTDIR)$(prefix)/bin
++	mkdir -p $(DESTDIR)$(PREFIX)/bin
+ 	for file in bin/* ; do \
+-		cp -f $$file $(DESTDIR)$(prefix)/bin; \
++		cp -f $$file $(DESTDIR)$(PREFIX)/bin; \
+ 	done
+ 
+ print_banner:
diff --git a/bedtools/patches/patch-src_utils_BamTools_include_SamHeader.hpp b/bedtools/patches/patch-src_utils_BamTools_include_SamHeader.hpp
new file mode 100644
index 0000000000..e0e88b2db0
--- /dev/null
+++ b/bedtools/patches/patch-src_utils_BamTools_include_SamHeader.hpp
@@ -0,0 +1,27 @@
+$NetBSD: patch-src_utils_BamTools_include_SamHeader.hpp,v 1.1 2021/02/08 01:49:25 bacon Exp $
+
+# Silence compiler warnings
+
+--- src/utils/BamTools/include/SamHeader.hpp.orig	2021-01-24 16:15:06 UTC
++++ src/utils/BamTools/include/SamHeader.hpp
+@@ -7,6 +7,7 @@
+ #include <string.h>
+ #include <api/BamAux.h>
+ #include <stdlib.h>
++#include <sysexits.h>
+ 
+ 
+ #ifdef WITH_HTS_CB_API
+@@ -29,7 +30,11 @@ namespace htslib_future {
+ 		ops.cb_data = buffer;
+ 		samFile* fp = hts_open_callback(NULL, &ops, "w");
+ 
+-		sam_hdr_write(fp, hdr);
++		if ( sam_hdr_write(fp, hdr) != 0 )
++		{
++			fputs("sam_hdr_rebuild: Error: sam_hdr_write() failed.\n", stderr);
++			exit(EX_IOERR);
++		}
+ 
+ 		hts_close(fp);
+ 
diff --git a/bedtools/patches/patch-src_utils_htslib_Makefile b/bedtools/patches/patch-src_utils_htslib_Makefile
new file mode 100644
index 0000000000..88df304e64
--- /dev/null
+++ b/bedtools/patches/patch-src_utils_htslib_Makefile
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_utils_htslib_Makefile,v 1.2 2021/02/08 01:49:25 bacon Exp $
+
+# Respect pkgsrc env
+
+--- src/utils/htslib/Makefile.orig	2021-01-23 19:33:26.000000000 +0000
++++ src/utils/htslib/Makefile
+@@ -22,7 +22,7 @@
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ # DEALINGS IN THE SOFTWARE.
+ 
+-CC     = gcc
++CC     ?= gcc
+ AR     = ar
+ RANLIB = ranlib
+ 
+@@ -33,7 +33,7 @@ CPPFLAGS =
+ # TODO: probably update cram code to make it compile cleanly with -Wc++-compat
+ # For testing strict C99 support add -std=c99 -D_XOPEN_SOURCE=600
+ #CFLAGS   = -g -Wall -O2 -pedantic -std=c99 -D_XOPEN_SOURCE=600 -D__FUNCTION__=__func__
+-CFLAGS   = -g -Wall -O2
++CFLAGS   ?= -g -Wall -O2
+ EXTRA_CFLAGS_PIC = -fpic
+ LDFLAGS  =
+ LIBS     = $(htslib_default_libs)
diff --git a/bedtools/patches/patch-test_test.sh b/bedtools/patches/patch-test_test.sh
new file mode 100644
index 0000000000..1aea22bc9d
--- /dev/null
+++ b/bedtools/patches/patch-test_test.sh
@@ -0,0 +1,20 @@
+$NetBSD: patch-test_test.sh,v 1.1 2021/02/08 01:49:25 bacon Exp $
+
+# Warning for impending failed tests
+
+--- test/test.sh.orig	2021-02-07 19:54:21.793084552 +0000
++++ test/test.sh
+@@ -1,5 +1,13 @@
+ set -e; # Alert user to any uncaught error
+ 
++if [ $(uname) = FreeBSD ] || [ $(uname) = NetBSD ]; then
++    if ! df | fgrep -q fdesc; then
++        echo "fdesc FS must be mounted in order to run $0."
++        echo "It uses bash process substitutions, e.g. <(ls)."
++        exit 1
++    fi
++fi
++
+ ulimit -c unlimited
+ 
+ STARTWD=$(pwd);


Home | Main Index | Thread Index | Old Index