summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Krause2015-06-13 11:56:57 +0200
committerChristian Krause2015-06-13 11:56:57 +0200
commitc80418d7478821cd4e286784fd9d5667e0240b3d (patch)
treea660287793f686f169267a31dcffa081df08b8e5
downloadaur-c80418d7478821cd4e286784fd9d5667e0240b3d.tar.gz
Initial import
-rw-r--r--.SRCINFO20
-rw-r--r--PKGBUILD57
-rw-r--r--makefile-system-htslib.patch96
3 files changed, 173 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..497a5cc2d9c
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = samtools
+ pkgdesc = tools for manipulating next-generation sequencing data
+ pkgver = 1.2
+ pkgrel = 1
+ url = http://www.htslib.org/
+ arch = i686
+ arch = x86_64
+ license = custom
+ depends = perl
+ depends = htslib
+ optdepends = luajit: needed for r2plot.lua vcfutils.lua
+ optdepends = python2: needed for varfilter.py
+ options = staticlibs
+ source = samtools-1.2.tar.gz::https://github.com/samtools/samtools/archive/1.2.tar.gz
+ source = makefile-system-htslib.patch
+ md5sums = 2748356ef392c0694ca1142de37cf2aa
+ md5sums = 05b136769fff4ab6c0962877390e96d8
+
+pkgname = samtools
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..ed6d64fab56
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,57 @@
+# Maintainer: Christian Krause ("wookietreiber") <kizkizzbangbang@googlemail.com>
+# Contributor: Markus Heuser <markus.heuser@web.de>
+
+pkgname=samtools
+pkgver=1.2
+pkgrel=1
+pkgdesc="tools for manipulating next-generation sequencing data"
+arch=('i686' 'x86_64')
+url="http://www.htslib.org/"
+license=('custom')
+depends=('perl' 'htslib')
+optdepends=('luajit: needed for r2plot.lua vcfutils.lua'
+ 'python2: needed for varfilter.py')
+options=('staticlibs')
+source=($pkgname-$pkgver.tar.gz::https://github.com/samtools/samtools/archive/$pkgver.tar.gz
+ makefile-system-htslib.patch)
+md5sums=('2748356ef392c0694ca1142de37cf2aa'
+ '05b136769fff4ab6c0962877390e96d8')
+
+prepare() {
+ cd $srcdir/$pkgname-$pkgver
+
+ # patch Makefile to make it work with a system-provided htslib
+ patch -Np1 -i $srcdir/makefile-system-htslib.patch
+
+ sed -e 's|#!/usr/bin/env python|#!/usr/bin/env python2|' \
+ -i misc/varfilter.py
+}
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+
+ make
+}
+
+check() {
+ cd $srcdir/$pkgname-$pkgver
+
+ make check
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+
+ make DESTDIR=$pkgdir prefix=/usr install
+
+ for file in misc/*.lua ; do
+ install -Dm755 $file $pkgdir/usr/bin/$(basename $file)
+ done
+
+ install -d $pkgdir/usr/include/bam
+ install -Dm644 $srcdir/$pkgname-$pkgver/*.h $pkgdir/usr/include/bam
+
+ install -Dm644 libbam.a $pkgdir/usr/lib/libbam.a
+
+ install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
+}
diff --git a/makefile-system-htslib.patch b/makefile-system-htslib.patch
new file mode 100644
index 00000000000..864ac22bc7a
--- /dev/null
+++ b/makefile-system-htslib.patch
@@ -0,0 +1,96 @@
+diff -aur samtools-1.2/Makefile samtools-1.2-patched/Makefile
+--- samtools-1.2/Makefile 2015-02-02 16:18:41.000000000 +0100
++++ samtools-1.2-patched/Makefile 2015-02-04 11:58:14.059908160 +0100
+@@ -25,7 +25,7 @@
+ CPPFLAGS = $(DFLAGS) $(INCLUDES)
+ CFLAGS = -g -Wall -O2
+ LDFLAGS =
+-LDLIBS =
++LDLIBS = -lhts
+ DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_CURSES_LIB=1
+ LOBJS= bam_aux.o bam.o bam_import.o sam.o \
+ sam_header.o bam_plbuf.o
+@@ -82,10 +82,8 @@
+
+
+ # Adjust $(HTSDIR) to point to your top-level htslib directory
+-HTSDIR = ../htslib
+-include $(HTSDIR)/htslib.mk
+-HTSLIB = $(HTSDIR)/libhts.a
+-BGZIP = $(HTSDIR)/bgzip
++HTSDIR = /usr/include
++BGZIP = bgzip
+
+
+ PACKAGE_VERSION = 1.2
+@@ -121,8 +119,8 @@
+ libbam.a:$(LOBJS)
+ $(AR) -csru $@ $(LOBJS)
+
+-samtools: $(AOBJS) libbam.a $(HTSLIB)
+- $(CC) -pthread $(LDFLAGS) -o $@ $(AOBJS) libbam.a $(HTSLIB) $(LDLIBS) $(LIBCURSES) -lm -lz
++samtools: $(AOBJS) libbam.a
++ $(CC) -pthread $(LDFLAGS) -o $@ $(AOBJS) libbam.a $(LDLIBS) $(LIBCURSES) -lm -lz
+
+ bam_h = bam.h $(htslib_bgzf_h) $(htslib_sam_h)
+ bam2bcf_h = bam2bcf.h $(htslib_vcf_h) errmod.h
+@@ -178,7 +176,7 @@
+ # For tests that might use it, set $REF_PATH explicitly to use only reference
+ # areas within the test suite (or set it to ':' to use no reference areas).
+ # (regression.sh sets $REF_PATH to a subdirectory itself.)
+-check test: samtools $(BGZIP) $(BUILT_TEST_PROGRAMS)
++check test: samtools $(BUILT_TEST_PROGRAMS)
+ REF_PATH=: test/test.pl --exec bgzip=$(BGZIP)
+ test/merge/test_bam_translate test/merge/test_bam_translate.tmp
+ test/merge/test_pretty_header
+@@ -191,32 +189,32 @@
+ test/split/test_parse_args
+
+
+-test/merge/test_bam_translate: test/merge/test_bam_translate.o test/test.o $(HTSLIB)
+- $(CC) -pthread $(LDFLAGS) -o $@ test/merge/test_bam_translate.o test/test.o $(HTSLIB) $(LDLIBS) -lz
++test/merge/test_bam_translate: test/merge/test_bam_translate.o test/test.o
++ $(CC) -pthread $(LDFLAGS) -o $@ test/merge/test_bam_translate.o test/test.o $(LDLIBS) -lz
+
+-test/merge/test_pretty_header: test/merge/test_pretty_header.o $(HTSLIB)
+- $(CC) -pthread $(LDFLAGS) -o $@ test/merge/test_pretty_header.o $(HTSLIB) $(LDLIBS) -lz
++test/merge/test_pretty_header: test/merge/test_pretty_header.o
++ $(CC) -pthread $(LDFLAGS) -o $@ test/merge/test_pretty_header.o $(LDLIBS) -lz
+
+-test/merge/test_rtrans_build: test/merge/test_rtrans_build.o $(HTSLIB)
+- $(CC) -pthread $(LDFLAGS) -o $@ test/merge/test_rtrans_build.o $(HTSLIB) $(LDLIBS) -lz
++test/merge/test_rtrans_build: test/merge/test_rtrans_build.o
++ $(CC) -pthread $(LDFLAGS) -o $@ test/merge/test_rtrans_build.o $(LDLIBS) -lz
+
+-test/merge/test_trans_tbl_init: test/merge/test_trans_tbl_init.o $(HTSLIB)
+- $(CC) -pthread $(LDFLAGS) -o $@ test/merge/test_trans_tbl_init.o $(HTSLIB) $(LDLIBS) -lz
++test/merge/test_trans_tbl_init: test/merge/test_trans_tbl_init.o
++ $(CC) -pthread $(LDFLAGS) -o $@ test/merge/test_trans_tbl_init.o $(LDLIBS) -lz
+
+-test/split/test_count_rg: test/split/test_count_rg.o test/test.o $(HTSLIB)
+- $(CC) -pthread $(LDFLAGS) -o $@ test/split/test_count_rg.o test/test.o $(HTSLIB) $(LDLIBS) -lz
++test/split/test_count_rg: test/split/test_count_rg.o test/test.o
++ $(CC) -pthread $(LDFLAGS) -o $@ test/split/test_count_rg.o test/test.o $(LDLIBS) -lz
+
+-test/split/test_expand_format_string: test/split/test_expand_format_string.o test/test.o $(HTSLIB)
+- $(CC) -pthread $(LDFLAGS) -o $@ test/split/test_expand_format_string.o test/test.o $(HTSLIB) $(LDLIBS) -lz
++test/split/test_expand_format_string: test/split/test_expand_format_string.o test/test.o
++ $(CC) -pthread $(LDFLAGS) -o $@ test/split/test_expand_format_string.o test/test.o $(LDLIBS) -lz
+
+-test/split/test_filter_header_rg: test/split/test_filter_header_rg.o test/test.o $(HTSLIB)
+- $(CC) -pthread $(LDFLAGS) -o $@ test/split/test_filter_header_rg.o test/test.o $(HTSLIB) $(LDLIBS) -lz
++test/split/test_filter_header_rg: test/split/test_filter_header_rg.o test/test.o
++ $(CC) -pthread $(LDFLAGS) -o $@ test/split/test_filter_header_rg.o test/test.o $(LDLIBS) -lz
+
+-test/split/test_parse_args: test/split/test_parse_args.o test/test.o $(HTSLIB)
+- $(CC) -pthread $(LDFLAGS) -o $@ test/split/test_parse_args.o test/test.o $(HTSLIB) $(LDLIBS) -lz
++test/split/test_parse_args: test/split/test_parse_args.o test/test.o
++ $(CC) -pthread $(LDFLAGS) -o $@ test/split/test_parse_args.o test/test.o $(LDLIBS) -lz
+
+-test/vcf-miniview: test/vcf-miniview.o $(HTSLIB)
+- $(CC) -pthread $(LDFLAGS) -o $@ test/vcf-miniview.o $(HTSLIB) $(LDLIBS) -lz
++test/vcf-miniview: test/vcf-miniview.o
++ $(CC) -pthread $(LDFLAGS) -o $@ test/vcf-miniview.o $(LDLIBS) -lz
+
+ test_test_h = test/test.h $(htslib_sam_h)
+