summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/htslib/package.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/htslib/package.py b/var/spack/repos/builtin/packages/htslib/package.py
index 3b4b9fcf2d..a267809a4d 100644
--- a/var/spack/repos/builtin/packages/htslib/package.py
+++ b/var/spack/repos/builtin/packages/htslib/package.py
@@ -42,18 +42,23 @@ class Htslib(AutotoolsPackage):
"libcurl",
default=True,
description="Enable libcurl-based support for http/https/etc URLs,"
- " for versions >= 1.3. This also enables S3 and GCS support.",
+ " for versions >= 1.3. This also enables S3 and GCS support by default.",
)
variant(
"libdeflate",
default=True,
description="use libdeflate for faster crc and deflate algorithms",
)
+ variant("gcs", default=True, description="enable gcs url support", when="@1.5:+libcurl")
+ variant("s3", default=True, description="enable s3 url support", when="@1.5:+libcurl")
+ variant("plugins", default=False, description="enable support for separately compiled plugins")
+ variant("pic", default=True, description="Compile with PIC support")
depends_on("zlib-api")
depends_on("bzip2", when="@1.4:")
depends_on("xz", when="@1.4:")
depends_on("curl", when="@1.3:+libcurl")
+ depends_on("openssl", when="+s3")
depends_on("libdeflate", when="@1.8:+libdeflate")
depends_on("m4", when="@1.2")
@@ -76,6 +81,11 @@ class Htslib(AutotoolsPackage):
url = "https://github.com/samtools/htslib/releases/download/{0}/htslib-{0}.tar.bz2"
return url.format(version.dotted)
+ def flag_handler(self, name, flags):
+ if name == "cflags" and self.spec.satisfies("+pic"):
+ flags.append(self.compiler.cc_pic_flag)
+ return (flags, None, None)
+
def configure_args(self):
spec = self.spec
args = []
@@ -83,6 +93,11 @@ class Htslib(AutotoolsPackage):
if spec.satisfies("@1.3:"):
args.extend(self.enable_or_disable("libcurl"))
+ if spec.satisfies("@1.5:"):
+ args.extend(self.enable_or_disable("s3"))
+ args.extend(self.enable_or_disable("gcs"))
+ args.extend(self.enable_or_disable("plugins"))
+
if spec.satisfies("@1.8:"):
args.extend(self.enable_or_disable("libdeflate"))