aboutsummaryrefslogtreecommitdiff
blob: ac93590811d7ce70658b06d95d30c1d179096084 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

DESCRIPTION="SSAHA2-based pipeline to align reads"
HOMEPAGE="http://www.sanger.ac.uk/resources/software/ssaha2/"
SRC_URI="ftp://ftp.sanger.ac.uk/pub4/resources/software/ssaha2/pileup.tgz"

# http://samtools.sourceforge.net/pileup.shtml
#
LICENSE="GRL"
SLOT="0"
KEYWORDS=""
IUSE=""

DEPEND=""
RDEPEND="${DEPEND}"

S="${WORKDIR}"/pileup_v"${PV}"

src_prepare(){
	sed -i "s/^CC= gcc/#CC= gcc/" ssaha_pileup/ssaha_pileup/makefile || die "sed failed to fix makefile"
	sed -i "s/^CFLAGS= -O2/#CFLAGS= -O2/" ssaha_pileup/ssaha_pileup/makefile || die "sed failed to fix makefile"

	for d in get_seqreads ssaha_split; do
		sed -i "s/^CC = cc/#CC = cc/" ssaha_pileup/other_codes/$d/Makefile || die "sed failed to fix Makefile"
		sed -i "s/^CFLAGS = -O4/#CFLAGS = -O4/" ssaha_pileup/other_codes/$d/Makefile || die "sed failed to fix Makefile"
	done

	for d in search_read ssaha_parseSNP; do
		sed -i "s/^CC = gcc/#CC = gcc/" ssaha_pileup/other_codes/$d/Makefile || die "sed failed to fix Makefile"
		sed -i "s/^CFLAGS = -Wall -O4/#CFLAGS = -Wall -O4/" ssaha_pileup/other_codes/$d/Makefile || die "sed failed to fix Makefile"
	done
}

src_compile(){
	cd ssaha_pileup/ssaha_pileup || die "Cannot cd to "${S}"ssaha_pileup/ssaha_pileup"
	default

	for d in get_seqreads ssaha_split ssaha_parseSNP search_read; do
		cd "${S}"/ssaha_pileup/other_codes/$d  || die "Cannot cd to "${S}"ssaha_pileup/other_codes/"$d
		make clean
		default
	done
}

src_install(){
	cd ssaha_pileup/ssaha_pileup || die "Cannot cd to "${S}"ssaha_pileup/ssaha_pileup"
	dobin ssaha_pileup ssaha_solexa ssaha_pairs ssaha_clean ssaha_mates ssaha_cigar ssaha_indel view_pileup ssaha_reads ssaha_merge ssaha_check-cigar "dobin failed"

	cd "${S}" || die
	for f in ssaha_pileup/other_codes/get_seqreads/get_seqreads \
		ssaha_pileup/other_codes/ssaha_split/ssaha_split \
		ssaha_pileup/other_codes/ssaha_parseSNP/ssaha_parseSNP \
		ssaha_pileup/other_codes/search_read/search_read; do
			dobin $f "dobin failed"
	done

	# TODO:
	# pileup_v0.6/ssaha_pileup/tag.pl

	# Finally, a tcsh shell script has to be created with full paths to ssaha2 binaries
	# convert the awk line from install.csh to a proper shellscript based on pileup.csh_src
}