From 20c19b72f73a925aba86dfad70ff9f40cee5a742 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 23 Jun 2023 16:45:53 +0200 Subject: [PATCH] Support decimal on Debian bookworm (#767) --- data/special-requirements | 1 - install-php-extensions | 30 ++++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/data/special-requirements b/data/special-requirements index 4c50e85..8606a4c 100644 --- a/data/special-requirements +++ b/data/special-requirements @@ -1,6 +1,5 @@ cassandra !jessie !stretch !buster !bullseye !bookworm ddtrace !jessie -decimal !bookworm geos !alpine3.9 !alpine3.10 lz4 !jessie memcached !bookworm diff --git a/install-php-extensions b/install-php-extensions index 95d9104..3e9d837 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -740,8 +740,10 @@ buildRequiredPackageLists() { fi ;; decimal@debian) - buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmpdec[0-9]*$" - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmpdec-dev" + if test $DISTRO_MAJMIN_VERSION -lt 1200; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmpdec[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmpdec-dev" + fi ;; enchant@alpine) if test $DISTRO_MAJMIN_VERSION -ge 312; then @@ -2113,6 +2115,16 @@ installLibavif() { cd - >/dev/null } +# Install libmpdec +installLibMPDec() { + installLibMPDec_src="$(getPackageSource https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.5.1.tar.gz)" + cd -- "$installLibMPDec_src" + ./configure --disable-cxx + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + # Install Composer installComposer() { installComposer_version="$(getWantedPHPModuleVersion @composer)" @@ -2658,12 +2670,14 @@ installRemoteModule() { case "$DISTRO" in alpine) if ! test -f /usr/local/lib/libmpdec.so; then - installRemoteModule_src="$(getPackageSource https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.5.1.tar.gz)" - cd -- "$installRemoteModule_src" - ./configure --disable-cxx - make -j$(getProcessorCount) - make install - cd - >/dev/null + installLibMPDec + fi + ;; + debian) + if test $DISTRO_MAJMIN_VERSION -ge 1200; then + if test -z "$(ldconfig -p | grep -E '\slibmpdec.so\s')"; then + installLibMPDec + fi fi ;; esac