Author: Michael R. Crusoe <crusoe@debian.org>
Description: Attempt to use the Debian version of vcflib
Forwarded: not-needed
--- vg.orig/Makefile
+++ vg/Makefile
@@ -48,11 +48,11 @@
 # necessary on all platforms and suppresses warnings.
 # Also, pkg-config flags need to be made -isystem if our dependency install
 # directory is, or they might put a system HTSlib before ours.
-INCLUDE_FLAGS :=$(shell pkg-config --cflags libfastahack) $(shell pkg-config --cflags libsmithwaterman) -I$(CWD)/$(INC_DIR) -isystem $(CWD)/$(INC_DIR) -I. -I$(CWD)/$(SRC_DIR) -I$(CWD)/$(UNITTEST_SRC_DIR) -I$(CWD)/$(SUBCOMMAND_SRC_DIR) -I$(CWD)/$(INC_DIR)/dynamic $(shell $(PKG_CONFIG) --cflags $(PKG_CONFIG_DEPS) $(PKG_CONFIG_STATIC_DEPS) | sed 's/ -I/ -isystem /g')
+INCLUDE_FLAGS :=$(shell pkg-config --cflags libfastahack) $(shell pkg-config --cflags libsmithwaterman) $(shell pkg-config --cflags libvcflib) -I$(CWD)/$(INC_DIR) -isystem $(CWD)/$(INC_DIR) -I. -I$(CWD)/$(SRC_DIR) -I$(CWD)/$(UNITTEST_SRC_DIR) -I$(CWD)/$(SUBCOMMAND_SRC_DIR) -I$(CWD)/$(INC_DIR)/dynamic $(shell $(PKG_CONFIG) --cflags $(PKG_CONFIG_DEPS) $(PKG_CONFIG_STATIC_DEPS) | sed 's/ -I/ -isystem /g')
 
 # Define libraries to link against.
 LD_LIB_DIR_FLAGS := -L$(CWD)/$(LIB_DIR)
-LD_LIB_FLAGS := $(CWD)/$(LIB_DIR)/libvgio.a -lz -lvcflib -lgssw -lssw -lsublinearLS -lpthread -lncurses -lgcsa2 -lgbwtgraph -lgbwt -ldivsufsort -ldivsufsort64 -lraptor2 -lpinchesandcacti -l3edgeconnected -lsonlib -lfml -lstructures -lvw -lallreduce -lbdsg -lxg -lsdsl -lhandlegraph $(shell pkg-config --libs libfastahack) $(shell pkg-config --libs libsmithwaterman)
+LD_LIB_FLAGS := $(CWD)/$(LIB_DIR)/libvgio.a -lz -lvcflib -lgssw -lssw -lsublinearLS -lpthread -lncurses -lgcsa2 -lgbwtgraph -lgbwt -ldivsufsort -ldivsufsort64 -lraptor2 -lpinchesandcacti -l3edgeconnected -lsonlib -lfml -lstructures -lvw -lallreduce -lbdsg -lxg -lsdsl -lhandlegraph $(shell pkg-config --libs libfastahack) $(shell pkg-config --libs libsmithwaterman) $(shell pkg-config --libs libvcflib)
 # We omit Boost Program Options for now; we find it in a platform-dependent way.
 # By default it has no suffix
 BOOST_SUFFIX=""
@@ -239,7 +239,6 @@
 GBWT_DIR:=deps/gbwt
 GBWTGRAPH_DIR=deps/gbwtgraph
 PROGRESS_BAR_DIR:=deps/progress_bar
-VCFLIB_DIR:=deps/vcflib
 HTSLIB_DIR:=$(VCFLIB_DIR)/tabixpp/htslib
 GSSW_DIR:=deps/gssw
 SPARSEPP_DIR:=deps/sparsepp
@@ -274,7 +273,6 @@
 LIB_DEPS += $(LIB_DIR)/libgbwt.a
 LIB_DEPS += $(LIB_DIR)/libgbwtgraph.a
 LIB_DEPS += $(LIB_DIR)/libhts.a
-LIB_DEPS += $(LIB_DIR)/libvcflib.a
 LIB_DEPS += $(LIB_DIR)/libgssw.a
 LIB_DEPS += $(LIB_DIR)/libsonlib.a
 LIB_DEPS += $(LIB_DIR)/libpinchesandcacti.a
@@ -348,7 +346,7 @@
 # And we have submodule deps to build
 deps: $(DEPS)
 
-test: $(BIN_DIR)/$(EXE) $(LIB_DIR)/libvg.a test/build_graph $(BIN_DIR)/shuf $(VCFLIB_DIR)/bin/vcf2tsv 
+test: $(BIN_DIR)/$(EXE) $(LIB_DIR)/libvg.a test/build_graph $(BIN_DIR)/shuf
 	. ./source_me.sh && cd test && prove -v t
 	. ./source_me.sh && doc/test-docs.sh
 
@@ -469,13 +467,6 @@
 $(LIB_DIR)/libhts%a $(LIB_DIR)/pkgconfig/htslib%pc: $(LIB_DIR)/libdeflate.a $(LIB_DIR)/libdeflate.$(SHARED_SUFFIX) $(HTSLIB_DIR)/*.c $(HTSLIB_DIR)/*.h $(HTSLIB_DIR)/htslib/*.h $(HTSLIB_DIR)/cram/*.c $(HTSLIB_DIR)/cram/*.h
 	+. ./source_me.sh && cd $(HTSLIB_DIR) && rm -Rf $(CWD)/$(INC_DIR)/htslib $(CWD)/$(LIB_DIR)/libhts* && autoheader && autoconf && CFLAGS="-I$(CWD)/$(HTSLIB_DIR) -isystem $(CWD)/$(HTSLIB_DIR) -I$(CWD)/$(INC_DIR) $(CFLAGS)" LDFLAGS="-L$(CWD)/$(LIB_DIR)" ./configure --with-libdeflate --disable-s3 --disable-gcs --disable-libcurl --disable-plugins --prefix=$(CWD) $(FILTER) && $(MAKE) clean && $(MAKE) $(FILTER) && $(MAKE) install && ls $(CWD)/$(INC_DIR)/htslib
 
-# When building vcflib, make sure to force it to use our libdeflate, since we wnt in and configured its htslib to use libdeflate.
-$(LIB_DIR)/libvcflib.a: $(LIB_DIR)/libhts.a $(VCFLIB_DIR)/src/*.cpp $(VCFLIB_DIR)/src/*.hpp $(VCFLIB_DIR)/intervaltree/*.cpp $(VCFLIB_DIR)/intervaltree/*.h $(VCFLIB_DIR)/tabixpp/*.cpp $(VCFLIB_DIR)/tabixpp/*.hpp
-	+. ./source_me.sh && cd $(VCFLIB_DIR) && rm -Rf build && $(MAKE) clean && CMAKE_FLAGS="-DHTSLIB_EXTRA_LIBS=-ldeflate" $(MAKE) $(FILTER) && cp lib/* $(CWD)/$(LIB_DIR)/ && cp include/* $(CWD)/$(INC_DIR)/ && cp intervaltree/*.h $(CWD)/$(INC_DIR)/ && cp src/*.h* $(CWD)/$(INC_DIR)/
-
-# vcflib binaries are all automatically built. We need this one.
-$(VCFLIB_DIR)/bin/vcf2tsv: $(VCFLIB_DIR)/src/*.cpp $(VCFLIB_DIR)/src/*.h $(LIB_DIR)/libvcflib.a
-
 $(LIB_DIR)/libgssw.a: $(GSSW_DIR)/src/gssw.c $(GSSW_DIR)/src/gssw.h
 	+. ./source_me.sh && cd $(GSSW_DIR) && $(MAKE) $(FILTER) && cp lib/* $(CWD)/$(LIB_DIR)/ && cp obj/* $(CWD)/$(OBJ_DIR) && cp src/*.h $(CWD)/$(INC_DIR)
 
@@ -704,7 +695,7 @@
 	$(RM) -r $(OBJ_DIR)/*.o $(OBJ_DIR)/*.d
 	$(RM) -f $(INC_DIR)/vg_system_version.hpp
 
-clean: clean-vcflib
+clean:
 	$(RM) -r $(BIN_DIR)
 	$(RM) -r $(LIB_DIR)
 	$(RM) -r $(UNITTEST_OBJ_DIR)
@@ -720,7 +711,6 @@
 	cd $(DEP_DIR) && cd gssw && $(MAKE) clean
 	cd $(DEP_DIR) && cd progress_bar && $(MAKE) clean
 	cd $(DEP_DIR) && cd sdsl-lite && ./uninstall.sh || true
-	cd $(DEP_DIR) && cd vcflib && $(MAKE) clean
 	cd $(DEP_DIR) && cd gfakluge && $(MAKE) clean
 	cd $(DEP_DIR) && cd sha1 && $(MAKE) clean
 	cd $(DEP_DIR) && cd structures && $(MAKE) clean
@@ -731,6 +721,3 @@
 	# lru_cache is never built because it is header-only
 	# bash-tap is never built either
 
-clean-vcflib:
-	cd $(DEP_DIR) && cd vcflib && $(MAKE) clean
-	cd $(INC_DIR) && rm -f BedReader.h convert.h join.h mt19937ar.h split.h Variant.h vec128int.h veclib_types.h
--- vg.orig/src/srpe.hpp
+++ vg/src/srpe.hpp
@@ -2,10 +2,10 @@
 #define VG_SRPE
 #include <string>
 #include <cstdint>
-#include <Variant.h>
+#include <vcflib/Variant.h>
 #include "filter.hpp"
 #include "path_index.hpp"
-#include "IntervalTree.h"
+#include <intervaltree/IntervalTree.h>
 #include <vg/vg.pb.h>
 #include "fml.h"
 #include "vg.hpp"
--- vg.orig/src/subcommand/srpe_main.cpp
+++ vg/src/subcommand/srpe_main.cpp
@@ -23,9 +23,9 @@
 
 // TODO: Where even are these?
 #include <vg/vg.pb.h>
-#include "Variant.h"
+#include <vcflib/Variant.h>
 #include "Fasta.h"
-#include "IntervalTree.h"
+#include <intervaltree/IntervalTree.h>
 
 using namespace std;
 using namespace vg;
--- vg.orig/test/Makefile
+++ vg/test/Makefile
@@ -3,19 +3,11 @@
 CXX:=g++
 CXXFLAGS:=-O3 -std=c++11 -fopenmp -g
 
-vg:=../bin/vg
-
 all: test clean
 
-test: build_graph $(vg) vcf2tsv
+test: build_graph 
 	prove -v t
 
-vcf2tsv:
-	cd ../deps/vcflib && $(MAKE) bin/vcf2tsv
-
-$(vg):
-	cd .. && $(MAKE) bin/vg
-
 build_graph: build_graph.cpp
 	cd .. && . ./source_me.sh && $(MAKE) test/build_graph
 
--- vg.orig/test/t/02_vg_construct.t
+++ vg/test/t/02_vg_construct.t
@@ -76,7 +76,7 @@
 # check that we produce a full graph
 
 refbp=$(fastahack -r x small/x.fa | tr -d '\n' | wc -c)
-variantbp=$(zcat < small/x.vcf.gz | ../deps/vcflib/bin/vcf2tsv \
+variantbp=$(zcat < small/x.vcf.gz | vcf2tsv \
     | cut -f 5,4 | tail -n+2 \
     | awk '{ x=length($2)-length($1); if (x > 0) { print x; } else if (x == 0) { print length($2); } }' \
         | awk '{ sum += $1 } END { print sum }')
--- vg.orig/src/readfilter.hpp
+++ vg/src/readfilter.hpp
@@ -11,7 +11,7 @@
 
 #include "vg.hpp"
 #include "handle.hpp"
-#include "IntervalTree.h"
+#include <intervaltree/IntervalTree.h>
 #include "annotation.hpp"
 #include "multipath_alignment_emitter.hpp"
 #include <vg/io/alignment_emitter.hpp>
--- vg.orig/src/aligner.hpp
+++ vg/src/aligner.hpp
@@ -12,7 +12,7 @@
 
 #include "gssw.h"
 #include "vg.hpp"
-#include "Variant.h"
+#include <vcflib/Variant.h>
 #include "Fasta.h"
 #include "path.hpp"
 #include "utility.hpp"
--- vg.orig/src/constructor.hpp
+++ vg/src/constructor.hpp
@@ -22,7 +22,7 @@
 #include <vg/vg.pb.h>
 
 // We need vcflib
-#include <Variant.h>
+#include <vcflib/Variant.h>
 // And fastahack
 #include <Fasta.h>
 
--- vg.orig/src/deconstructor.hpp
+++ vg/src/deconstructor.hpp
@@ -5,7 +5,7 @@
 #include <ostream>
 #include <sstream>
 #include "genotypekit.hpp"
-#include "Variant.h"
+#include <vcflib/Variant.h>
 #include "handle.hpp"
 #include "genotypekit.hpp"
 #include "traversal_finder.hpp"
--- vg.orig/src/utility.hpp
+++ vg/src/utility.hpp
@@ -19,7 +19,7 @@
 #include <vg/vg.pb.h>
 #include "types.hpp"
 #include "sha1.hpp"
-#include "Variant.h"
+#include <vcflib/Variant.h>
 
 namespace vg {
 
--- vg.orig/src/vcf_buffer.hpp
+++ vg/src/vcf_buffer.hpp
@@ -10,7 +10,7 @@
 #include <tuple>
 
 // We need vcflib
-#include "Variant.h"
+#include <vcflib/Variant.h>
 
 
 namespace vg {
--- vg.orig/src/vg.hpp
+++ vg/src/vg.hpp
@@ -33,7 +33,7 @@
 #include "progressive.hpp"
 #include "lru_cache.h"
 
-#include "Variant.h"
+#include <vcflib/Variant.h>
 #include "Fasta.h"
 
 #include "swap_remove.hpp"
