1 |
commit: f7bdf03a3823e8156f7e31aea55948702f4882e2 |
2 |
Author: Marek Szuba <marecki <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 1 08:45:02 2018 +0000 |
4 |
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 1 08:45:33 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7bdf03a |
7 |
|
8 |
dev-perl/Bio-DB-HTS: allow explicit specification of htslib directories |
9 |
|
10 |
Upstream build script takes a single directory as htslib prefix, then |
11 |
appends "include/htslib" while looking for header files and "lib" while |
12 |
looking for library. Unsurprisingly, the latter fails to locate the htslib |
13 |
library on SYMLINK_LIB=no systems. |
14 |
|
15 |
I have patched the build script to allow both htslib-includedir and |
16 |
htslib-libdir to be provided explicitly, thus letting the ebuild take |
17 |
care of choosing the correct libdir name for the specified |
18 |
architecture/ABI. |
19 |
|
20 |
Closes: https://bugs.gentoo.org/654460 |
21 |
Package-Manager: Portage-2.3.24, Repoman-2.3.6 |
22 |
|
23 |
dev-perl/Bio-DB-HTS/Bio-DB-HTS-2.10.ebuild | 3 +- |
24 |
.../files/2.10-build_split_htslib_opts.patch | 48 ++++++++++++++++++++++ |
25 |
2 files changed, 50 insertions(+), 1 deletion(-) |
26 |
|
27 |
diff --git a/dev-perl/Bio-DB-HTS/Bio-DB-HTS-2.10.ebuild b/dev-perl/Bio-DB-HTS/Bio-DB-HTS-2.10.ebuild |
28 |
index 1490c3fe5ed..0a150300213 100644 |
29 |
--- a/dev-perl/Bio-DB-HTS/Bio-DB-HTS-2.10.ebuild |
30 |
+++ b/dev-perl/Bio-DB-HTS/Bio-DB-HTS-2.10.ebuild |
31 |
@@ -23,9 +23,10 @@ DEPEND="${RDEPEND} |
32 |
|
33 |
PATCHES=( |
34 |
"${FILESDIR}/2.10-build_search_for_so.patch" |
35 |
+ "${FILESDIR}/2.10-build_split_htslib_opts.patch" |
36 |
) |
37 |
|
38 |
src_configure() { |
39 |
- local myconf="--htslib=${EPREFIX}/usr" |
40 |
+ local myconf="--htslib-includedir=${EPREFIX}/usr/include/htslib --htslib-libdir=${EPREFIX}/usr/$(get_libdir)" |
41 |
perl-module_src_configure |
42 |
} |
43 |
|
44 |
diff --git a/dev-perl/Bio-DB-HTS/files/2.10-build_split_htslib_opts.patch b/dev-perl/Bio-DB-HTS/files/2.10-build_split_htslib_opts.patch |
45 |
new file mode 100644 |
46 |
index 00000000000..d68bc54e40d |
47 |
--- /dev/null |
48 |
+++ b/dev-perl/Bio-DB-HTS/files/2.10-build_split_htslib_opts.patch |
49 |
@@ -0,0 +1,48 @@ |
50 |
+--- a/Build.PL |
51 |
++++ b/Build.PL |
52 |
+@@ -68,7 +68,13 @@ |
53 |
+ # If either of these are set, we expect to find the htslib files there: |
54 |
+ # (They're explicitly set by the user, so we shouldn't fall back to |
55 |
+ # finding another copy somewhere else.) |
56 |
+- if (my $dir = $self->args('htslib')) { |
57 |
++ if (my ($incdir, $libdir) = ($self->args('htslib-includedir'), $self->args('htslib-libdir'))) { |
58 |
++ return 1 if $self->find_hts_in_split_install_dirs($incdir, $libdir); |
59 |
++ $self->die_hts_not_found( |
60 |
++ "--htslib-includedir '$incdir' or --htslib-libdir '$libdir' command line parameters do not contain expected files\n" |
61 |
++ ); |
62 |
++ } |
63 |
++ elsif (my $dir = $self->args('htslib')) { |
64 |
+ return 1 if $self->find_hts_in_build_dir($dir); |
65 |
+ return 1 if $self->find_hts_in_install_dir($dir); |
66 |
+ $self->die_hts_not_found( |
67 |
+@@ -155,6 +161,22 @@ |
68 |
+ } |
69 |
+ } |
70 |
+ |
71 |
++sub find_hts_in_split_install_dirs { |
72 |
++ my ($self, $hts_include, $hts_lib) = @_; |
73 |
++ |
74 |
++ chomp($hts_include); |
75 |
++ chomp($hts_lib); |
76 |
++ |
77 |
++ if ((-f "$hts_lib/libhts.so" || -f "$hts_lib/libhts.a") && -f "$hts_include/hts.h") { |
78 |
++ $self->config_data('hts_lib' => $hts_lib); |
79 |
++ $self->config_data('hts_include' => $hts_include); |
80 |
++ return 1; |
81 |
++ } |
82 |
++ else { |
83 |
++ return 0; |
84 |
++ } |
85 |
++} |
86 |
++ |
87 |
+ sub die_hts_not_found { |
88 |
+ my ($self, $msg) = @_; |
89 |
+ |
90 |
+@@ -166,6 +188,7 @@ |
91 |
+ |
92 |
+ This script will attempt to locate htslib by looking for hts.h and libhts.so/libhts.a in: |
93 |
+ |
94 |
++ 0. --htslib-includedir and --htslib-libdir command line arguments |
95 |
+ 1. --htslib command line argument |
96 |
+ 2. HTSLIB_DIR environment variable |
97 |
+ 3. --prefix command line argument (which also sets installation location) |