summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2024-04-10 18:20:42 +0200
committerGitHub <noreply@github.com>2024-04-10 18:20:42 +0200
commitbbcd4224fa1edfa1fb91e101b58596f30b79b85f (patch)
tree8406694d26e63c8a86c0889d1f27144f8a3bf471
parent4c0cdb99b3c1f4837f386c0d70e88c6dd3b5c889 (diff)
downloadspack-bbcd4224fa1edfa1fb91e101b58596f30b79b85f.tar.gz
spack-bbcd4224fa1edfa1fb91e101b58596f30b79b85f.tar.bz2
spack-bbcd4224fa1edfa1fb91e101b58596f30b79b85f.tar.xz
spack-bbcd4224fa1edfa1fb91e101b58596f30b79b85f.zip
py-matplotlib: add v3.8.4 (#43487)
* py-matplotlib: add v3.8.4 * matplotlib requires exact version of freetype for tests to pass * Add version constraints to fontconfig deps * Fix freetype build * Freetype cmake build is useless * Typo * Fix download * Fix build of older freetype * cmake is useless
-rw-r--r--var/spack/repos/builtin/packages/cairo/package.py2
-rw-r--r--var/spack/repos/builtin/packages/fontconfig/package.py6
-rw-r--r--var/spack/repos/builtin/packages/freetype/package.py13
-rw-r--r--var/spack/repos/builtin/packages/libxfont/package.py2
-rw-r--r--var/spack/repos/builtin/packages/mkfontscale/package.py2
-rw-r--r--var/spack/repos/builtin/packages/py-matplotlib/package.py87
6 files changed, 83 insertions, 29 deletions
diff --git a/var/spack/repos/builtin/packages/cairo/package.py b/var/spack/repos/builtin/packages/cairo/package.py
index 20cd0c8fbf..6784c8f3cd 100644
--- a/var/spack/repos/builtin/packages/cairo/package.py
+++ b/var/spack/repos/builtin/packages/cairo/package.py
@@ -59,7 +59,7 @@ class Cairo(AutotoolsPackage):
depends_on("autoconf", type="build")
depends_on("libtool", type="build")
depends_on("m4", type="build")
- depends_on("freetype", when="+ft")
+ depends_on("freetype build_system=autotools", when="+ft")
depends_on("pkgconfig", type="build")
depends_on("fontconfig@2.10.91:", when="+fc") # Require newer version of fontconfig.
depends_on("which", type="build")
diff --git a/var/spack/repos/builtin/packages/fontconfig/package.py b/var/spack/repos/builtin/packages/fontconfig/package.py
index c0cb9fecbe..f6b65144ea 100644
--- a/var/spack/repos/builtin/packages/fontconfig/package.py
+++ b/var/spack/repos/builtin/packages/fontconfig/package.py
@@ -23,10 +23,12 @@ class Fontconfig(AutotoolsPackage):
version("2.12.1", sha256="a9f42d03949f948a3a4f762287dbc16e53a927c91a07ee64207ebd90a9e5e292")
version("2.11.1", sha256="b6b066c7dce3f436fdc0dfbae9d36122b38094f4f53bd8dffd45e195b0540d8d")
+ # freetype2 21.0.15+ provided by freetype 2.8.1+
+ depends_on("freetype@2.8.1:", when="@2.13:")
depends_on("freetype")
depends_on("gperf", type="build", when="@2.12.2:")
- depends_on("libxml2")
- depends_on("pkgconfig", type="build")
+ depends_on("libxml2@2.6:")
+ depends_on("pkgconfig@0.9:", type="build")
depends_on("font-util")
depends_on("uuid", when="@2.13.1:")
depends_on("python@3:", type="build", when="@2.13.93:")
diff --git a/var/spack/repos/builtin/packages/freetype/package.py b/var/spack/repos/builtin/packages/freetype/package.py
index 0ebfaa8113..01baca992c 100644
--- a/var/spack/repos/builtin/packages/freetype/package.py
+++ b/var/spack/repos/builtin/packages/freetype/package.py
@@ -16,6 +16,7 @@ class Freetype(AutotoolsPackage, CMakePackage):
homepage = "https://www.freetype.org/index.html"
url = "https://download.savannah.gnu.org/releases/freetype/freetype-2.10.1.tar.gz"
+ list_url = "https://download.savannah.gnu.org/releases/freetype/freetype-old/"
maintainers("michaelkuhn")
@@ -30,8 +31,10 @@ class Freetype(AutotoolsPackage, CMakePackage):
version("2.9.1", sha256="ec391504e55498adceb30baceebd147a6e963f636eb617424bcfc47a169898ce")
version("2.7.1", sha256="162ef25aa64480b1189cdb261228e6c5c44f212aac4b4621e28cf2157efb59f5")
version("2.7", sha256="7b657d5f872b0ab56461f3bd310bd1c5ec64619bd15f0d8e08282d494d9cfea4")
+ version("2.6.1", sha256="0a3c7dfbda6da1e8fce29232e8e96d987ababbbf71ebc8c75659e4132c367014")
version("2.5.3", sha256="41217f800d3f40d78ef4eb99d6a35fd85235b64f81bc56e4812d7672fca7b806")
+ # CMake build does not install freetype-config, which is needed by most packages
build_system("cmake", "autotools", default="autotools")
depends_on("bzip2")
@@ -53,6 +56,14 @@ class Freetype(AutotoolsPackage, CMakePackage):
patch("windows.patch", when="@2.9.1")
+ def url_for_version(self, version):
+ url = "https://download.savannah.gnu.org/releases/{}/freetype-{}.tar.gz"
+ if version >= Version("2.7"):
+ directory = "freetype"
+ else:
+ directory = "freetype/freetype-old"
+ return url.format(directory, version)
+
@property
def headers(self):
headers = find_headers("*", self.prefix.include, recursive=True)
@@ -61,6 +72,8 @@ class Freetype(AutotoolsPackage, CMakePackage):
class AutotoolsBuilder(AutotoolsBuilder):
+ build_directory = "builds/unix"
+
def configure_args(self):
args = [
"--with-brotli=no",
diff --git a/var/spack/repos/builtin/packages/libxfont/package.py b/var/spack/repos/builtin/packages/libxfont/package.py
index 7647d81fdb..321208dc7b 100644
--- a/var/spack/repos/builtin/packages/libxfont/package.py
+++ b/var/spack/repos/builtin/packages/libxfont/package.py
@@ -23,7 +23,7 @@ class Libxfont(AutotoolsPackage, XorgPackage):
version("1.5.2", sha256="a7350c75171d03d06ae0d623e42240356d6d3e1ac7dfe606639bf20f0d653c93")
depends_on("libfontenc")
- depends_on("freetype")
+ depends_on("freetype build_system=autotools")
depends_on("xtrans")
depends_on("xproto")
diff --git a/var/spack/repos/builtin/packages/mkfontscale/package.py b/var/spack/repos/builtin/packages/mkfontscale/package.py
index da3531e9bf..c96bddfe6c 100644
--- a/var/spack/repos/builtin/packages/mkfontscale/package.py
+++ b/var/spack/repos/builtin/packages/mkfontscale/package.py
@@ -20,7 +20,7 @@ class Mkfontscale(AutotoolsPackage, XorgPackage):
version("1.1.2", sha256="8bba59e60fbc4cb082092cf6b67e810b47b4fe64fbc77dbea1d7e7d55312b2e4")
depends_on("libfontenc")
- depends_on("freetype")
+ depends_on("freetype build_system=autotools")
depends_on("xproto@7.0.25:")
depends_on("pkgconfig", type="build")
diff --git a/var/spack/repos/builtin/packages/py-matplotlib/package.py b/var/spack/repos/builtin/packages/py-matplotlib/package.py
index b7ddf66c12..719f777e8b 100644
--- a/var/spack/repos/builtin/packages/py-matplotlib/package.py
+++ b/var/spack/repos/builtin/packages/py-matplotlib/package.py
@@ -26,6 +26,7 @@ class PyMatplotlib(PythonPackage):
license("Apache-2.0")
+ version("3.8.4", sha256="8aac397d5e9ec158960e31c381c5ffc52ddd52bd9a47717e2a694038167dffea")
version("3.8.3", sha256="7b416239e9ae38be54b028abbf9048aff5054a9aba5416bef0bd17f9162ce161")
version("3.8.2", sha256="01a978b871b881ee76017152f1f1a0cbf6bd5f7b8ff8c96df0df1bd57d8755a1")
version("3.8.1", sha256="044df81c1f6f3a8e52d70c4cfcb44e77ea9632a10929932870dfaa90de94365d")
@@ -61,14 +62,38 @@ class PyMatplotlib(PythonPackage):
version("3.1.0", sha256="1e0213f87cc0076f7b0c4c251d7e23601e2419cd98691df79edb95517ba06f0c")
version("3.0.2", sha256="c94b792af431f6adb6859eb218137acd9a35f4f7442cea57e4a59c54751c36af")
version("3.0.0", sha256="b4e2333c98a7c2c1ff6eb930cd2b57d4b818de5437c5048802096b32f66e65f9")
- version("2.2.5", sha256="a3037a840cd9dfdc2df9fee8af8f76ca82bfab173c0f9468193ca7a89a2b60ea")
- version("2.2.4", sha256="029620799e581802961ac1dcff5cb5d3ee2f602e0db9c0f202a90495b37d2126")
- version("2.2.3", sha256="7355bf757ecacd5f0ac9dd9523c8e1a1103faadf8d33c22664178e17533f8ce5")
- version("2.2.2", sha256="4dc7ef528aad21f22be85e95725234c5178c0f938e2228ca76640e5e84d8cde8")
- version("2.0.2", sha256="0ffbc44faa34a8b1704bc108c451ecf87988f900ef7ce757b8e2e84383121ff1")
- version("2.0.0", sha256="36cf0985829c1ab2b8b1dae5e2272e53ae681bf33ab8bedceed4f0565af5f813")
+ version(
+ "2.2.5",
+ sha256="a3037a840cd9dfdc2df9fee8af8f76ca82bfab173c0f9468193ca7a89a2b60ea",
+ deprecated=True,
+ )
+ version(
+ "2.2.4",
+ sha256="029620799e581802961ac1dcff5cb5d3ee2f602e0db9c0f202a90495b37d2126",
+ deprecated=True,
+ )
+ version(
+ "2.2.3",
+ sha256="7355bf757ecacd5f0ac9dd9523c8e1a1103faadf8d33c22664178e17533f8ce5",
+ deprecated=True,
+ )
+ version(
+ "2.2.2",
+ sha256="4dc7ef528aad21f22be85e95725234c5178c0f938e2228ca76640e5e84d8cde8",
+ deprecated=True,
+ )
+ version(
+ "2.0.2",
+ sha256="0ffbc44faa34a8b1704bc108c451ecf87988f900ef7ce757b8e2e84383121ff1",
+ deprecated=True,
+ )
+ version(
+ "2.0.0",
+ sha256="36cf0985829c1ab2b8b1dae5e2272e53ae681bf33ab8bedceed4f0565af5f813",
+ deprecated=True,
+ )
- # https://matplotlib.org/tutorials/introductory/usage.html#backends
+ # https://matplotlib.org/stable/users/explain/figure/backends.html
# From `lib/matplotlib/rcsetup.py`:
interactive_bk = [
# GTK
@@ -133,7 +158,7 @@ class PyMatplotlib(PythonPackage):
variant("latex", default=False, description="Enable LaTeX text rendering support")
variant("fonts", default=False, description="Enable support for system font detection")
- # https://matplotlib.org/stable/devel/dependencies.html
+ # https://matplotlib.org/stable/users/installing/dependencies.html
# Runtime dependencies
# Mandatory dependencies
depends_on("python@3.9:", when="@3.8:", type=("build", "link", "run"))
@@ -144,13 +169,14 @@ class PyMatplotlib(PythonPackage):
depends_on("py-fonttools@4.22:", when="@3.5:", type=("build", "run"))
depends_on("py-kiwisolver@1.3.1:", when="@3.8.1:", type=("build", "run"))
depends_on("py-kiwisolver@1.0.1:", when="@2.2:", type=("build", "run"))
- depends_on("py-numpy@1.21:1", when="@3.8:", type=("build", "link", "run"))
- depends_on("py-numpy@1.20:", when="@3.7:", type=("build", "link", "run"))
- depends_on("py-numpy@1.19:", when="@3.6:", type=("build", "link", "run"))
- depends_on("py-numpy@1.17:", when="@3.5:", type=("build", "link", "run"))
- depends_on("py-numpy@1.16:", when="@3.4:", type=("build", "link", "run"))
- depends_on("py-numpy@1.15:", when="@3.3:", type=("build", "link", "run"))
- depends_on("py-numpy@1.11:", type=("build", "run"))
+ depends_on("py-numpy@1.21:", when="@3.8.4:", type=("build", "link", "run"))
+ depends_on("py-numpy@1.21:1", when="@3.8.0:3.8.3", type=("build", "link", "run"))
+ depends_on("py-numpy@1.20:1", when="@3.7", type=("build", "link", "run"))
+ depends_on("py-numpy@1.19:1", when="@3.6", type=("build", "link", "run"))
+ depends_on("py-numpy@1.17:1", when="@3.5", type=("build", "link", "run"))
+ depends_on("py-numpy@1.16:1", when="@3.4", type=("build", "link", "run"))
+ depends_on("py-numpy@1.15:1", when="@3.3", type=("build", "link", "run"))
+ depends_on("py-numpy@1.11:1", when="@:3.2", type=("build", "run"))
depends_on("py-packaging@20:", when="@3.6:", type=("build", "run"))
depends_on("py-packaging", when="@3.5:", type=("build", "run"))
depends_on("pil@8:", when="@3.8.1:", type=("build", "run"))
@@ -166,7 +192,6 @@ class PyMatplotlib(PythonPackage):
# Historical dependencies
depends_on("py-pytz", type=("build", "run"), when="@:2")
depends_on("py-six@1.10.0:", type=("build", "run"), when="@2")
- depends_on("py-six@1.9.0:", type=("build", "run"), when="@:1")
# Optional dependencies
# Backends
@@ -219,7 +244,7 @@ class PyMatplotlib(PythonPackage):
depends_on("pkgconfig", type="build")
# C libraries
- depends_on("freetype@2.3:") # freetype 2.6.1 needed for tests to pass
+ depends_on("freetype@2.3: build_system=autotools")
depends_on("qhull@2020.2:", when="@3.4:")
# starting from qhull 2020.2 libqhull.so on which py-matplotlib@3.3 versions
# rely on does not exist anymore, only libqhull_r.so
@@ -240,10 +265,9 @@ class PyMatplotlib(PythonPackage):
depends_on("py-setuptools-scm-git-archive", when="@3.5", type="build")
# Testing dependencies
- # https://matplotlib.org/stable/devel/development_setup.html#additional-dependencies-for-testing
- depends_on("py-pytest@3.6:", type="test")
- depends_on("ghostscript@9.0:", type="test")
- # depends_on("inkscape@:0", type="test")
+ # Required
+ depends_on("freetype@2.6.1 build_system=autotools", type="test")
+ depends_on("py-pytest@7:", type="test")
msg = "MacOSX backend requires macOS 10.12+"
conflicts("platform=linux", when="backend=macosx", msg=msg)
@@ -306,7 +330,22 @@ class PyMatplotlib(PythonPackage):
config.write("enable_lto = False\n")
@run_after("install")
+ def copy_reference_images(self):
+ # https://matplotlib.org/devdocs/devel/testing.html#obtain-the-reference-images
+ install_tree(
+ join_path("lib", "matplotlib", "tests", "baseline_images"),
+ join_path(python_platlib, "matplotlib", "tests", "baseline_images"),
+ )
+ for toolkit in ["axes_grid1", "axisartist", "mplot3d"]:
+ install_tree(
+ join_path("lib", "mpl_toolkits", toolkit, "tests", "baseline_images"),
+ join_path(python_platlib, "mpl_toolkits", toolkit, "tests", "baseline_images"),
+ )
+
+ @run_after("install")
@on_package_attributes(run_tests=True)
- def build_test(self):
- pytest = which("pytest")
- pytest()
+ def install_test(self):
+ # https://matplotlib.org/devdocs/devel/testing.html#run-the-tests
+ python("-m", "pytest", "--pyargs", "matplotlib.tests")
+ for toolkit in ["axes_grid1", "axisartist", "mplot3d"]:
+ python("-m", "pytest", "--pyargs", f"mpl_toolkits.{toolkit}.tests")