8000 Remove now unneeded Arch Linux bad raqm.h workaround. · matplotlib/mplcairo@d540b17 · GitHub
[go: up one dir, main page]

Skip to content < 8000 span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full">

Commit d540b17

Browse files
committed
Remove now unneeded Arch Linux bad raqm.h workaround.
1 parent 6a59936 commit d540b17

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

setup.py

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -98,38 +98,26 @@ def finalize_options(self):
9898
include_dirs=[cairo.get_include()],
9999
)]
100100

101-
tmp_include_dir = Path(self.get_finalized_command("build").build_base,
102-
"include")
103-
tmp_include_dir.mkdir(parents=True, exist_ok=True)
104-
# On Arch Linux, the python-pillow (Arch) package
105-
# includes a version of ``raqm.h`` that is both invalid
106-
# (https://bugs.archlinux.org/task/57492) and now outdated (it is
107-
# missing a declaration for `raqm_version_string`), but placed in an
108-
# non-overridable directory for distutils. Thus, on that distro, force
109-
# the use of a cleanly downloaded header.
101+
# NOTE: Versions <= 8.2 of Arch Linux's python-pillow package included
102+
# *into a non-overridable distutils header directory* a ``raqm.h`` that
103+
# is both invalid (https://bugs.archlinux.org/task/57492) and outdated
104+
# (missing a declaration for `raqm_version_string`). It is thus not
105+
# possible to build mplcairo with such an old distro package installed.
110106
try:
111-
is_arch = "Arch Linux" in Path("/etc/os-release").read_text()
112-
except OSError:
113-
is_arch = False
114-
if is_arch:
115-
has_pkgconfig_raqm = False
116-
else:
117-
try:
118-
get_pkgconfig(f"--atleast-version={MIN_RAQM_VERSION}", "raqm")
119-
except (FileNotFoundError, CalledProcessError):
120-
has_pkgconfig_raqm = False
121-
else:
122-
has_pkgconfig_raqm = True
123-
if has_pkgconfig_raqm:
124-
ext.extra_compile_args += get_pkgconfig("--cflags", "raqm")
125-
else:
107+
get_pkgconfig(f"--atleast-version={MIN_RAQM_VERSION}", "raqm")
108+
except (FileNotFoundError, CalledProcessError):
109+
tmp_include_dir = Path(
110+
self.get_finalized_command("build").build_base, "include")
111+
tmp_include_dir.mkdir(parents=True, exist_ok=True)
126112
(tmp_include_dir / "raqm-version.h").write_text("") # Touch it.
127113
with urllib.request.urlopen(
128114
f"https://raw.githubusercontent.com/HOST-Oman/libraqm/"
129115
f"v{MIN_RAQM_VERSION}/src/raqm.h") as request, \
130116
(tmp_include_dir / "raqm.h").open("wb") as file:
131117
file.write(request.read())
132118
ext.include_dirs += [tmp_include_dir]
119+
else:
120+
ext.extra_compile_args += get_pkgconfig("--cflags", "raqm")
133121

134122
if os.name == "posix":
135123
get_pkgconfig(f"--atleast-version={MIN_CAIRO_VERSION}", "cairo")

0 commit comments

Comments
 (0)
0