Skip to content

Commit

Permalink
sci-biology/pysam: Fix broken relative -I
Browse files Browse the repository at this point in the history
Bug: https://bugs.gentoo.org/show_bug.cgi?id=629670
Package-Manager: Portage-2.3.8, Repoman-2.3.3
  • Loading branch information
SoapGentoo committed Sep 2, 2017
1 parent 5af882f commit e4dbb5c
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
63 changes: 63 additions & 0 deletions sci-biology/pysam/files/pysam-0.12-fix-buildsystem.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
The build system is not designed with partial out-of-source
builds in mind. This is evident by using relative includes
such as '-Isamtools' instead of proper relative or absolute
paths.

Bug: https://bugs.gentoo.org/show_bug.cgi?id=629670

--- a/setup.py
+++ b/setup.py
@@ -359,6 +359,8 @@

define_macros = []

+samtools_include_dirs = [os.path.abspath("samtools")]
+
chtslib = Extension(
"pysam.libchtslib",
[source_pattern % "htslib",
@@ -385,7 +387,7 @@
htslib_sources +
os_c_files,
library_dirs=htslib_library_dirs,
- include_dirs=["pysam", "samtools", "."] + include_os + htslib_include_dirs,
+ include_dirs=["pysam", "."] + samtools_include_dirs + include_os + htslib_include_dirs,
libraries=external_htslib_libraries + internal_htslib_libraries,
language="c",
extra_compile_args=extra_compile_args,
@@ -404,7 +406,7 @@
htslib_sources +
os_c_files,
library_dirs=htslib_library_dirs,
- include_dirs=["pysam", "samtools"] + include_os + htslib_include_dirs,
+ include_dirs=["pysam"] + samtools_include_dirs + include_os + htslib_include_dirs,
libraries=external_htslib_libraries + internal_htslib_libraries,
language="c",
extra_compile_args=extra_compile_args,
@@ -423,7 +425,7 @@
htslib_sources +
os_c_files,
library_dirs=htslib_library_dirs,
- include_dirs=["pysam", "samtools", "."] + include_os + htslib_include_dirs,
+ include_dirs=["pysam", "."] + samtools_include_dirs + include_os + htslib_include_dirs,
libraries=external_htslib_libraries + internal_htslib_libraries,
language="c",
extra_compile_args=extra_compile_args,
@@ -467,7 +469,7 @@
htslib_sources +
os_c_files,
library_dirs=["pysam"] + htslib_library_dirs,
- include_dirs=["samtools", "pysam", "."] +
+ include_dirs=["pysam", "."] + samtools_include_dirs +
include_os + htslib_include_dirs,
libraries=external_htslib_libraries + internal_htslib_libraries,
language="c",
@@ -482,7 +484,7 @@
htslib_sources +
os_c_files,
library_dirs=["pysam"] + htslib_library_dirs,
- include_dirs=["bcftools", "pysam", "."] +
+ include_dirs=["bcftools", "pysam", "."] + samtools_include_dirs +
include_os + htslib_include_dirs,
libraries=external_htslib_libraries + internal_htslib_libraries,
language="c",
6 changes: 5 additions & 1 deletion sci-biology/pysam/pysam-0.12.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ DEPEND="${RDEPEND}
dev-python/cython[${PYTHON_USEDEP}]
dev-python/setuptools[${PYTHON_USEDEP}]"

PATCHES=( "${FILESDIR}"/${PN}-0.12-fix-buildsystem.patch )

python_prepare_all() {
# unbundle htslib
export HTSLIB_MODE="external"
export HTSLIB_INCLUDE_DIR="${EPREFIX}"/usr/include
export HTSLIB_LIBRARY_DIR="${EPREFIX}"/usr/$(get_libdir)
export HTSLIB_CONFIGURE_OPTIONS="--disable-libcurl"
rm -r htslib || die

# prevent setup.py from adding RPATHs
sed -e "/ext\.extra_link_args += \['-Wl,-rpath,\$ORIGIN'\]/d" \
Expand Down

0 comments on commit e4dbb5c

Please sign in to comment.