1 |
commit: 1442f328453dc90ea24b64ec3abd4e661504f408 |
2 |
Author: Kent Fredric <kentnl <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed May 20 17:00:14 2020 +0000 |
4 |
Commit: Kent Fredric <kentnl <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed May 20 17:01:20 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1442f328 |
7 |
|
8 |
dev-perl/Bio-SamTools: Add fixed version for bug #661112 |
9 |
|
10 |
- Reworked patches so the autodetection stuff is nixed, because its |
11 |
really silly and doesn't work. |
12 |
- Paths now computed in ebuild and passed explicitly |
13 |
- Fix handling of libdir for lib64 re bug #661112, but in a different |
14 |
way than proposed by Sławomir Nizio, mostly because I didn't see that |
15 |
suggestion until after I'd done all my changes (but also because |
16 |
relying on a hardcoded path in the code is also fragile) |
17 |
- Converted to EAPI7 |
18 |
- Removed unused empty variable assignments |
19 |
|
20 |
Bug: https://bugs.gentoo.org/661112 |
21 |
Package-Manager: Portage-2.3.99, Repoman-2.3.22 |
22 |
Signed-off-by: Kent Fredric <kentnl <AT> gentoo.org> |
23 |
|
24 |
.../Bio-SamTools/Bio-SamTools-1.430.0-r1.ebuild | 38 +++++++ |
25 |
.../files/Bio-SamTools-1.430.0-legacy-r1.patch | 110 +++++++++++++++++++++ |
26 |
2 files changed, 148 insertions(+) |
27 |
|
28 |
diff --git a/dev-perl/Bio-SamTools/Bio-SamTools-1.430.0-r1.ebuild b/dev-perl/Bio-SamTools/Bio-SamTools-1.430.0-r1.ebuild |
29 |
new file mode 100644 |
30 |
index 00000000000..861acb6faa2 |
31 |
--- /dev/null |
32 |
+++ b/dev-perl/Bio-SamTools/Bio-SamTools-1.430.0-r1.ebuild |
33 |
@@ -0,0 +1,38 @@ |
34 |
+# Copyright 1999-2020 Gentoo Authors |
35 |
+# Distributed under the terms of the GNU General Public License v2 |
36 |
+ |
37 |
+EAPI=7 |
38 |
+ |
39 |
+DIST_AUTHOR=LDS |
40 |
+DIST_VERSION=1.43 |
41 |
+inherit perl-module toolchain-funcs multilib |
42 |
+ |
43 |
+DESCRIPTION="Read SAM/BAM database files" |
44 |
+ |
45 |
+SLOT="0" |
46 |
+KEYWORDS="~amd64 ~x86" |
47 |
+LICENSE="|| ( Apache-2.0 Artistic-2 GPL-1+ )" |
48 |
+ |
49 |
+RDEPEND=" |
50 |
+ >=sci-biology/bioperl-1.6.9 |
51 |
+ sci-biology/samtools:0.1-legacy= |
52 |
+" |
53 |
+DEPEND=" |
54 |
+ dev-perl/Module-Build |
55 |
+ sci-biology/samtools:0.1-legacy= |
56 |
+" |
57 |
+BDEPEND="${RDEPEND} |
58 |
+ virtual/perl-ExtUtils-CBuilder |
59 |
+ >=dev-perl/Module-Build-0.420.0 |
60 |
+" |
61 |
+ |
62 |
+PATCHES=( |
63 |
+ "${FILESDIR}"/${PN}-1.430.0-legacy-r1.patch |
64 |
+) |
65 |
+ |
66 |
+src_configure() { |
67 |
+ tc-export CC |
68 |
+ SAM_LIB="${EPREFIX}/usr/$(get_libdir)/libbam-0.1-legacy.so" \ |
69 |
+ SAM_INCLUDE="${EPREFIX}/usr/include/bam-0.1-legacy" \ |
70 |
+ perl-module_src_configure |
71 |
+} |
72 |
|
73 |
diff --git a/dev-perl/Bio-SamTools/files/Bio-SamTools-1.430.0-legacy-r1.patch b/dev-perl/Bio-SamTools/files/Bio-SamTools-1.430.0-legacy-r1.patch |
74 |
new file mode 100644 |
75 |
index 00000000000..ee9bde8fe3d |
76 |
--- /dev/null |
77 |
+++ b/dev-perl/Bio-SamTools/files/Bio-SamTools-1.430.0-legacy-r1.patch |
78 |
@@ -0,0 +1,110 @@ |
79 |
+From 82942523b2db5143a9da0f9d2f8ec83a26c8d5b0 Mon Sep 17 00:00:00 2001 |
80 |
+From: Kent Fredric <kentfredric@×××××.com> |
81 |
+Date: Sun, 10 Sep 2017 13:33:32 +1200 |
82 |
+Subject: Fix linking/compiling for bam-0.1-legacy |
83 |
+ |
84 |
+--- |
85 |
+ Build.PL | 14 +++++++------- |
86 |
+ c_bin/bam2bedgraph.c | 2 +- |
87 |
+ c_bin/makefile | 6 +++--- |
88 |
+ lib/Bio/DB/Sam.xs | 6 +++--- |
89 |
+ 4 files changed, 14 insertions(+), 14 deletions(-) |
90 |
+ |
91 |
+diff --git a/Build.PL b/Build.PL |
92 |
+index 685815f..882f231 100644 |
93 |
+--- a/Build.PL |
94 |
++++ b/Build.PL |
95 |
+@@ -4,11 +4,10 @@ use strict; |
96 |
+ use Module::Build; |
97 |
+ use Module::Load::Conditional qw(can_load); |
98 |
+ |
99 |
+-my $HeaderFile = "bam.h"; |
100 |
+-my $LibFile = "libbam.a"; |
101 |
+-my $ReadLine; |
102 |
+- |
103 |
+-my ($sam_include,$sam_lib) = find_sam(); # may exit with error here |
104 |
++my ($sam_include,$sam_lib) = do { |
105 |
++ ($ENV{"SAM_INCLUDE"} || die "SAM_INCLUDE not set"), |
106 |
++ ($ENV{"SAM_LIB"} || die "SAM_LIB not set") |
107 |
++}; |
108 |
+ |
109 |
+ my $class = Module::Build->subclass(code=><<EOF); |
110 |
+ sub process_c_bin_files { |
111 |
+@@ -39,7 +38,7 @@ my $build = $class->new( |
112 |
+ dist_abstract => 'Perl interface to SamTools library for DNA sequencing', |
113 |
+ license => 'perl', |
114 |
+ include_dirs => [$sam_include], |
115 |
+- extra_linker_flags => ["-L$sam_lib",'-lbam','-lpthread','-lz'], |
116 |
++ extra_linker_flags => ["-L$sam_lib",'-lbam-0.1-legacy','-lpthread','-lz'], |
117 |
+ |
118 |
+ extra_compiler_flags=>[ |
119 |
+ |
120 |
+@@ -67,7 +66,7 @@ $build->add_build_element('c_bin'); |
121 |
+ $build->create_build_script; |
122 |
+ |
123 |
+ exit 0; |
124 |
+- |
125 |
++=for non-gentoo |
126 |
+ sub find_sam { |
127 |
+ my ($sam_include,$sam_lib); |
128 |
+ |
129 |
+@@ -162,6 +161,7 @@ sub prompt { |
130 |
+ $ReadLine->addhistory($in) if $in =~ /\S/; |
131 |
+ return $in; |
132 |
+ } |
133 |
++=cut |
134 |
+ |
135 |
+ sub _samtools { |
136 |
+ $ENV{SAMTOOLS} || |
137 |
+diff --git a/c_bin/bam2bedgraph.c b/c_bin/bam2bedgraph.c |
138 |
+index 298e9a8..91218fa 100644 |
139 |
+--- a/c_bin/bam2bedgraph.c |
140 |
++++ b/c_bin/bam2bedgraph.c |
141 |
+@@ -1,5 +1,5 @@ |
142 |
+ #include <stdio.h> |
143 |
+-#include "sam.h" |
144 |
++#include "bam-0.1-legacy/sam.h" |
145 |
+ |
146 |
+ typedef struct { |
147 |
+ uint32_t ltid; |
148 |
+diff --git a/c_bin/makefile b/c_bin/makefile |
149 |
+index 9aef917..0abbb4c 100644 |
150 |
+--- a/c_bin/makefile |
151 |
++++ b/c_bin/makefile |
152 |
+@@ -1,5 +1,5 @@ |
153 |
+-CC= gcc |
154 |
+-CFLAGS= -g -Wall -O2 -fPIC |
155 |
++CC?= gcc |
156 |
++CFLAGS?= -g -Wall -O2 -fPIC |
157 |
+ DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 |
158 |
+ INCLUDES= |
159 |
+ LIBPATH= |
160 |
+@@ -14,7 +14,7 @@ PROG= bam2bedgraph |
161 |
+ all:$(PROG) |
162 |
+ |
163 |
+ bam2bedgraph: bam2bedgraph.o |
164 |
+- $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBPATH) -lbam -lpthread -lm -lz |
165 |
++ $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBPATH) -lbam-0.1-legacy -lpthread -lm -lz |
166 |
+ |
167 |
+ clean: |
168 |
+ rm -f *.o $(PROG) |
169 |
+diff --git a/lib/Bio/DB/Sam.xs b/lib/Bio/DB/Sam.xs |
170 |
+index 023f655..86410fb 100644 |
171 |
+--- a/lib/Bio/DB/Sam.xs |
172 |
++++ b/lib/Bio/DB/Sam.xs |
173 |
+@@ -25,9 +25,9 @@ |
174 |
+ |
175 |
+ #include <unistd.h> |
176 |
+ #include <math.h> |
177 |
+-#include "bam.h" |
178 |
+-#include "khash.h" |
179 |
+-#include "faidx.h" |
180 |
++#include "bam-0.1-legacy/bam.h" |
181 |
++#include "bam-0.1-legacy/khash.h" |
182 |
++#include "bam-0.1-legacy/faidx.h" |
183 |
+ |
184 |
+ /* stolen from bam_aux.c */ |
185 |
+ #define MAX_REGION 1<<29 |
186 |
+-- |
187 |
+2.26.2 |
188 |
+ |