summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWouter Deconinck <wdconinc@gmail.com>2022-09-19 15:41:11 -0500
committerGitHub <noreply@github.com>2022-09-19 15:41:11 -0500
commit5b26df8f64b39e2679c344dee6d58745faef5819 (patch)
treee39a3f09cb3640c64c6996b6932e337bc23682eb
parent83e66ce03ec5d57a5fef285715259da8f9060c31 (diff)
downloadspack-5b26df8f64b39e2679c344dee6d58745faef5819.tar.gz
spack-5b26df8f64b39e2679c344dee6d58745faef5819.tar.bz2
spack-5b26df8f64b39e2679c344dee6d58745faef5819.tar.xz
spack-5b26df8f64b39e2679c344dee6d58745faef5819.zip
imagemagick: new variant ghostscript (#32450)
* imagemagick: new variant ghostscript Ghostscript adds about 75 dependencies to an installation of imagemagick (97 without, 172 with Ghostscript). This adds a variant (defaulting to true for backward compatibility) that allows users to turn off Ghostscript support. * imagemagick: be explicit when `--with-gslib` * imagemagick: fix suggestion fail * imagemagick: use spec.prefix.share.font * imagemagick: default ghostscript false * imagemagick: no need for join_path anymore Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
-rw-r--r--var/spack/repos/builtin/packages/imagemagick/package.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/imagemagick/package.py b/var/spack/repos/builtin/packages/imagemagick/package.py
index 1ea57d0348..198f0b5b34 100644
--- a/var/spack/repos/builtin/packages/imagemagick/package.py
+++ b/var/spack/repos/builtin/packages/imagemagick/package.py
@@ -18,6 +18,8 @@ class Imagemagick(AutotoolsPackage):
version("7.0.2-7", sha256="f2f18a97f861c1668befdaff0cc3aaafb2111847aab028a88b4c2cb017acfbaa")
version("7.0.2-6", sha256="7d49ca8030f895c683cae69c52d8edfc4876de651f5b8bfdbea907e222480bd3")
+ variant("ghostscript", default=False, description="Compile with Ghostscript support")
+
depends_on("jpeg")
depends_on("pango")
depends_on("libtool", type="build")
@@ -26,15 +28,21 @@ class Imagemagick(AutotoolsPackage):
depends_on("freetype")
depends_on("fontconfig")
depends_on("libtiff")
- depends_on("ghostscript")
- depends_on("ghostscript-fonts")
+ depends_on("ghostscript", when="+ghostscript")
+ depends_on("ghostscript-fonts", when="+ghostscript")
depends_on("libsm")
depends_on("pkgconfig", type="build")
def configure_args(self):
+ args = []
spec = self.spec
- gs_font_dir = join_path(spec["ghostscript-fonts"].prefix.share, "font")
- return ["--with-gs-font-dir={0}".format(gs_font_dir)]
+ if spec.satisfies("+ghostscript"):
+ args.append("--with-gslib")
+ gs_font_dir = spec["ghostscript-fonts"].prefix.share.font
+ args.append("--with-gs-font-dir={0}".format(gs_font_dir))
+ else:
+ args.append("--without-gslib")
+ return args
@property
def libs(self):