From 0f1e7ef6f6e9097c481dbbf35b091bf92fcc3fed Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Fri, 9 Dec 2022 12:03:41 +0000 Subject: [PATCH] Install: add support for Linux with glibc patch version #3423 --- docs/changelog.md | 3 +++ install/libvips.js | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index 22242b3c1..46cd41399 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -9,6 +9,9 @@ Requires libvips v8.13.3 * Expose `interFrameMaxError` and `interPaletteMaxError` GIF optimisation properties. [#3401](https://github.com/lovell/sharp/issues/3401) +* Allow installation on Linux with glibc patch versions e.g. Fedora 38. + [#3423](https://github.com/lovell/sharp/issues/3423) + * Expand range of existing `sharpen` parameters to match libvips. [#3427](https://github.com/lovell/sharp/issues/3427) diff --git a/install/libvips.js b/install/libvips.js index 5f9e45841..a70b9db56 100644 --- a/install/libvips.js +++ b/install/libvips.js @@ -138,7 +138,8 @@ try { const libcFamily = detectLibc.familySync(); const libcVersion = detectLibc.versionSync(); if (libcFamily === detectLibc.GLIBC && libcVersion && minimumGlibcVersionByArch[arch]) { - if (semverLessThan(`${libcVersion}.0`, `${minimumGlibcVersionByArch[arch]}.0`)) { + const libcVersionWithoutPatch = libcVersion.split('.').slice(0, 2).join('.'); + if (semverLessThan(`${libcVersionWithoutPatch}.0`, `${minimumGlibcVersionByArch[arch]}.0`)) { handleError(new Error(`Use with glibc ${libcVersion} requires manual installation of libvips >= ${minimumLibvipsVersion}`)); } }