Commit cee63932 authored by Andreas Tille's avatar Andreas Tille
Browse files

Refresh and restructure patches

parent 2b3546c9
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
Author: Andreas Tille <tille@debian.org>
Last-Update: Wed, 22 Jun 2016 14:36:13 +0200
Description: vcflib needs to be packaged separately

--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-all: vcflib/Makefile log
+all: 
 	cd src && $(MAKE)
 
 wbamtools: vcflib/Makefile log
+0 −85
Original line number Diff line number Diff line
Author: Fabian Klötzl <fabian@kloetzl.info>
Date: Mon, 4 Sep 2017 12:27:38 +0200
Acked-by: Andreas Tille <tille@debian.org>
Description: Fix a "json" name clash
 htslib exports an enum value called `json`. That clashes with the
 definition of a friend function. For simplicity we resolve this by
 renaming the local function and ask htslib to prefix their symbols in
 the future.

---
 src/Allele.cpp | 10 +++++-----
 src/Allele.h   | 10 +++++-----
 src/Sample.cpp |  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/Allele.cpp b/src/Allele.cpp
index 2c58c79..8645704 100644
--- a/src/Allele.cpp
+++ b/src/Allele.cpp
@@ -332,19 +332,19 @@ string stringForAlleles(vector<Allele> &alleles) {
     return out.str();
 }
 
-string json(vector<Allele*> &alleles) {
+string to_json(vector<Allele*> &alleles) {
     stringstream out;
     vector<Allele*>::iterator a = alleles.begin();
-    out << "[" << (*a)->json(); ++a;
+    out << "[" << (*a)->to_json(); ++a;
     for (; a != alleles.end(); ++a)
-        out << "," << (*a)->json();
+        out << "," << (*a)->to_json();
     out << "]";
     return out.str();
 }
 
-string json(Allele*& allele) { return allele->json(); }
+string to_json(Allele*& allele) { return allele->to_json(); }
 
-string Allele::json(void) {
+string Allele::to_json(void) {
     stringstream out;
     if (!genotypeAllele) {
         out << "{\"id\":\"" << readID << "\""
diff --git a/src/Allele.h b/src/Allele.h
index 3f0125f..ff41c10 100644
--- a/src/Allele.h
+++ b/src/Allele.h
@@ -96,10 +96,10 @@ class Allele {
     friend ostream &operator<<(ostream &out, Allele &a);
     friend ostream &operator<<(ostream &out, Allele* &a);
 
-    friend string json(vector<Allele*> &alleles, long int &position);
-    friend string json(vector<Allele*> &alleles);
-    friend string json(Allele &allele, long int &position);
-    friend string json(Allele* &allele);
+    friend string to_json(vector<Allele*> &alleles, long int &position);
+    friend string to_json(vector<Allele*> &alleles);
+    friend string to_json(Allele &allele, long int &position);
+    friend string to_json(Allele* &allele);
 
 public:
 
@@ -262,7 +262,7 @@ public:
                                     //  this is used to update cached data in the allele prior to presenting the allele for analysis
                                     //  for the current base, just use allele.currentBase
 
-    string json(void);
+    string to_json(void);
     unsigned int getLengthOnReference(void);
     int referenceLengthFromCigar(void);
 
diff --git a/src/Sample.cpp b/src/Sample.cpp
index 06207cd..a6e3886 100644
--- a/src/Sample.cpp
+++ b/src/Sample.cpp
@@ -264,7 +264,7 @@ string Sample::json(void) {
         vector<Allele*>& alleles = g->second;
         for (vector<Allele*>::iterator a = alleles.begin(); a != alleles.end(); ++a) {
             if (!first) { out << ","; } else { first = false; }
-            out << (*a)->json();
+            out << (*a)->to_json();
         }
     }
     out << "]";
+2 −5
Original line number Diff line number Diff line
use_debian_packaged_bamtools.patch
use_debian_packaged_vcflib.patch
use_debian_packaged_seqlib.patch
use_debian_packaged_libjsoncpp.patch
use_debian_libs.patch
fix_all_target.patch
fix_test.patch
vcffirstheader.patch
use_cpp11.patch
fix_json_name_clash.patch
+2 −4
Original line number Diff line number Diff line
@@ -6,14 +6,12 @@ Description: Compile as C++11
 src/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Makefile b/src/Makefile
index 15a6da6..7b3b35a 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -9,7 +9,7 @@ CXX=g++
 C=gcc
@@ -17,7 +17,7 @@ export LIBFLAGS
 
 # Compiler flags
 
-CFLAGS=-O3 -D_FILE_OFFSET_BITS=64 -g
+CFLAGS=-O3 -D_FILE_OFFSET_BITS=64 -g -std=gnu++11
 #CFLAGS=-O3 -static -D VERBOSE_DEBUG  # enables verbose debugging via --debug2
+116 −0
Original line number Diff line number Diff line
Author: Andreas Tille <tille@debian.org>
Last-Update: Wed, 28 May 2014 21:23:38 +0200
Description: Use Debian packaged htslib and seqlib
 carries another copy of htslib - we replace both
Description: Use Debian packaged bamtools

--- a/src/Makefile
+++ b/src/Makefile
@@ -12,10 +12,8 @@ C=gcc
@@ -20,14 +20,8 @@ export LIBFLAGS
 CFLAGS=-O3 -D_FILE_OFFSET_BITS=64 -g
 #CFLAGS=-O3 -static -D VERBOSE_DEBUG  # enables verbose debugging via --debug2
 
-SEQLIB_ROOT=../SeqLib
-VCFLIB_ROOT=../vcflib
-TABIX_ROOT=$(VCFLIB_ROOT)/tabixpp
-HTSLIB_ROOT=$(SEQLIB_ROOT)/htslib
-
-LIBS = -lbamtools -ltabixpp -lz -lm -lpthread `pkg-config --libs libvcflib`
-INCLUDE = -I../ttmath  -I/usr/include/bamtools `pkg-config --cflags libvcflib` -I$(SEQLIB_ROOT) -I$(SEQLIB_ROOT)/htslib
+LIBS = -lbamtools -ltabixpp -lz -lm -lpthread `pkg-config --libs libvcflib` `pkg-config --libs htslib` `pkg-config --libs libseqlib`
+INCLUDE = -I../ttmath  -I/usr/include/bamtools `pkg-config --cflags libvcflib` `pkg-config --cflags libseqlib` `pkg-config --cflags htslib`
-LIBS = -lz -llzma -lbz2 -lm -lpthread
-INCLUDE = -I../src -I../ttmath -I$(VCFLIB_ROOT)/src/ -I$(VCFLIB_ROOT)/smithwaterman/ -I$(VCFLIB_ROOT)/multichoose/ -I$(VCFLIB_ROOT)/filevercmp/ -I$(VCFLIB_ROOT)/fastahack/ -I$(HTSLIB_ROOT) -I$(SEQLIB_ROOT) 
-#INCLUDE = -I../ttmath -I$(BAMTOOLS_ROOT)/src/ -I$(VCFLIB_ROOT)/src/ -I$(TABIX_ROOT)/ -I$(VCFLIB_ROOT)/smithwaterman/ -I$(VCFLIB_ROOT)/multichoose/ -I$(VCFLIB_ROOT)/filevercmp/ -I$(VCFLIB_ROOT)/fastahack/ -I$(HTSLIB_ROOT) -I$(SEQLIB_ROOT) -I$(SEQLIB_ROOT)/htslib
+LIBS = -lbamtools -ltabixpp -lz -lm -lpthread `pkg-config --libs libvcflib` `pkg-config --libs htslib` `pkg-config --libs libseqlib` `pkg-config --libs jsoncpp`
+INCLUDE = -I../ttmath  -I/usr/include/bamtools `pkg-config --cflags libvcflib` `pkg-config --cflags libseqlib` `pkg-config --cflags htslib` `pkg-config --cflags jsoncpp`
 
 all: autoversion ../bin/freebayes ../bin/bamleftalign
 
@@ -33,12 +31,6 @@ gprof:
@@ -45,12 +39,6 @@ gprof:
 
 .PHONY: all static debug profiling gprof
 
@@ -31,57 +34,83 @@ Description: Use Debian packaged htslib and seqlib
 OBJECTS=BedReader.o \
 		CNV.o \
 		fastlz.o \
@@ -62,11 +54,7 @@ OBJECTS=BedReader.o \
 		Bias.o \
@@ -75,17 +63,7 @@ OBJECTS=BedReader.o \
 		Contamination.o \
 		NonCall.o \
-		SegfaultHandler.o \
 		SegfaultHandler.o \
-		../vcflib/tabixpp/tabix.o \
-		../vcflib/smithwaterman/SmithWatermanGotoh.o \
-		../vcflib/smithwaterman/disorder.cpp \
-		../vcflib/smithwaterman/LeftAlign.o \
-		../vcflib/smithwaterman/Repeats.o \
-		../vcflib/smithwaterman/IndelAllele.o \
-		Variant.o \
-		$(SEQLIB_ROOT)/src/libseqlib.a	\
-		$(SEQLIB_ROOT)/bwa/libbwa.a	\
-		$(SEQLIB_ROOT)/fermi-lite/libfml.a	\
-		$(SEQLIB_ROOT)/htslib/libhts.a
+		SegfaultHandler.o
+		Variant.o
 
 HEADERS=multichoose.h version_git.h
 
@@ -81,10 +69,10 @@ alleles ../bin/alleles: alleles.o $(OBJE
 dummy ../bin/dummy: dummy.o $(OBJECTS) $(HEADERS)
 	$(CXX) $(CFLAGS) $(INCLUDE) dummy.o $(OBJECTS) -o ../bin/dummy $(LIBS)
@@ -100,10 +78,10 @@ alleles ../bin/alleles: alleles.o $(OBJE
 dummy ../bin/dummy: dummy.o $(OBJECTS) $(HEADERS) $(seqlib)
 	$(CXX) $(CXXFLAGS) $(INCLUDE) dummy.o $(OBJECTS) -o ../bin/dummy $(LIBS)
 
-bamleftalign ../bin/bamleftalign: $(SEQLIB_ROOT)/src/libseqlib.a $(SEQLIB_ROOT)/htslib/libhts.a bamleftalign.o Fasta.o LeftAlign.o IndelAllele.o split.o
-	$(CXX) $(CFLAGS) $(INCLUDE) bamleftalign.o Fasta.o Utility.o LeftAlign.o IndelAllele.o split.o $(SEQLIB_ROOT)/src/libseqlib.a $(SEQLIB_ROOT)/htslib/libhts.a -o ../bin/bamleftalign $(LIBS)
-bamleftalign ../bin/bamleftalign: $(SEQLIB_ROOT)/src/libseqlib.a $(HTSLIB_ROOT)/libhts.a bamleftalign.o Fasta.o LeftAlign.o IndelAllele.o split.o
+bamleftalign ../bin/bamleftalign: bamleftalign.o Fasta.o LeftAlign.o IndelAllele.o split.o
+	$(CXX) $(CFLAGS) $(INCLUDE) bamleftalign.o Fasta.o Utility.o LeftAlign.o IndelAllele.o split.o -o ../bin/bamleftalign $(LIBS)
 	$(CXX) $(CXXFLAGS) $(INCLUDE) bamleftalign.o $(OBJECTS) -o ../bin/bamleftalign $(LIBS)
 
-bamfiltertech ../bin/bamfiltertech: $(SEQLIB_ROOT)/src/libseqlib.a $(SEQLIB_ROOT)/htslib/libhts.a bamfiltertech.o $(OBJECTS) $(HEADERS)
-bamfiltertech ../bin/bamfiltertech: $(SEQLIB_ROOT)/src/libseqlib.a $(HTSLIB_ROOT)/libhts.a bamfiltertech.o $(OBJECTS) $(HEADERS)
+bamfiltertech ../bin/bamfiltertech: bamfiltertech.o $(OBJECTS) $(HEADERS)
 	$(CXX) $(CFLAGS) $(INCLUDE) bamfiltertech.o $(OBJECTS) -o ../bin/bamfiltertech $(LIBS)
 	$(CXX) $(CXXFLAGS) $(INCLUDE) bamfiltertech.o $(OBJECTS) -o ../bin/bamfiltertech $(LIBS)
 
 
@@ -99,7 +87,7 @@ alleles.o: alleles.cpp AlleleParser.o Al
@@ -118,7 +96,7 @@ alleles.o: alleles.cpp AlleleParser.o Al
 dummy.o: dummy.cpp AlleleParser.o Allele.o
 	$(CXX) $(CFLAGS) $(INCLUDE) -c dummy.cpp
 	$(CXX) $(CXXFLAGS) $(INCLUDE) -c dummy.cpp
 
-freebayes.o: freebayes.cpp TryCatch.h $(HTSLIB_ROOT)/libhts.a
-freebayes.o: freebayes.cpp TryCatch.h $(HTSLIB_ROOT)/libhts.a ../vcflib/tabixpp/tabix.o
+freebayes.o: freebayes.cpp TryCatch.h
 	$(CXX) $(CFLAGS) $(INCLUDE) -c freebayes.cpp
 	$(CXX) $(CXXFLAGS) $(INCLUDE) -c freebayes.cpp
 
 fastlz.o: fastlz.c fastlz.h
@@ -120,7 +108,7 @@ Genotype.o: Genotype.cpp Genotype.h Alle
@@ -139,7 +117,7 @@ Genotype.o: Genotype.cpp Genotype.h Alle
 Ewens.o: Ewens.cpp Ewens.h
 	$(CXX) $(CFLAGS) $(INCLUDE) -c Ewens.cpp
 	$(CXX) $(CXXFLAGS) $(INCLUDE) -c Ewens.cpp
 
-AlleleParser.o: AlleleParser.cpp AlleleParser.h multichoose.h Parameters.h $(HTSLIB_ROOT)/libhts.a
+AlleleParser.o: AlleleParser.cpp AlleleParser.h multichoose.h Parameters.h
 	$(CXX) $(CFLAGS) $(INCLUDE) -c AlleleParser.cpp
 	$(CXX) $(CXXFLAGS) $(INCLUDE) -c AlleleParser.cpp
 
 Utility.o: Utility.cpp Utility.h Sum.h Product.h
@@ -168,7 +156,7 @@ bamleftalign.o: bamleftalign.cpp LeftAli
@@ -187,22 +165,12 @@ bamleftalign.o: bamleftalign.cpp LeftAli
 bamfiltertech.o: bamfiltertech.cpp
 	$(CXX) $(CFLAGS) $(INCLUDE) -c bamfiltertech.cpp
 	$(CXX) $(CXXFLAGS) $(INCLUDE) -c bamfiltertech.cpp
 
-LeftAlign.o: LeftAlign.h LeftAlign.cpp $(HTSLIB_ROOT)/libhts.a
+LeftAlign.o: LeftAlign.h LeftAlign.cpp
 	$(CXX) $(CFLAGS) $(INCLUDE) -c LeftAlign.cpp
 	$(CXX) $(CXXFLAGS) $(INCLUDE) -c LeftAlign.cpp
 
 IndelAllele.o: IndelAllele.cpp IndelAllele.h
 	$(CXX) $(CXXFLAGS) $(INCLUDE) -c IndelAllele.cpp
 
-Variant.o: $(VCFLIB_ROOT)/src/Variant.h $(VCFLIB_ROOT)/src/Variant.cpp
-	$(CXX) $(CXXFLAGS) $(INCLUDE) -c $(VCFLIB_ROOT)/src/Variant.cpp
-#	$(CXX) -std=c++11 $(CFLAGS) $(INCLUDE) -c $(VCFLIB_ROOT)/src/Variant.cpp
-
-../vcflib/tabixpp/tabix.o:
-	cd $(TABIX_ROOT)/ && $(MAKE) && cp tabix.hpp ../../src/
-
-../vcflib/smithwaterman/SmithWatermanGotoh.o: ../vcflib/smithwaterman/SmithWatermanGotoh.h ../vcflib/smithwaterman/SmithWatermanGotoh.cpp
-	cd ../vcflib/smithwaterman && $(MAKE)
-
 
 VERSION_FILE=./version_git.h
 RELEASED_VERSION_FILE=./version_release.txt
@@ -277,5 +245,3 @@ autoversion:
 
 clean:
 	rm -rf *.o *.cgh *~ freebayes alleles ../bin/freebayes ../bin/alleles ../vcflib/*.o ../vcflib/tabixpp/*.{o,a} tabix.hpp
-	if [ -d $(BAMTOOLS_ROOT)/build ]; then make -C $(BAMTOOLS_ROOT)/build clean; fi
-	make -C $(VCFLIB_ROOT)/smithwaterman clean
Loading