Skip to content

Commit

Permalink
Compile libmpdec-dev from sources
Browse files Browse the repository at this point in the history
The package is not available on Debian Bookworm.
  • Loading branch information
rybakit committed Jun 16, 2023
1 parent 8cc5d0a commit 5459571
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,26 @@ if [[ -n "$COVERAGE_FILE" ]]; then
fi

if [[ -z "$EXT_DISABLE_DECIMAL" || "0" == "$EXT_DISABLE_DECIMAL" || "false" == "$EXT_DISABLE_DECIMAL" ]] ; then
RUN_CMDS="$RUN_CMDS && \\\\\n apt-get install -y libmpdec-dev"
RUN_CMDS="$RUN_CMDS && \\\\\n pecl install decimal && docker-php-ext-enable decimal"
# PHP 8.x images are based on Debian Bookworm, where the libmpdec-dev package
# is not available, therefore the package has to be compiled from sources.
# See https://github.com/docker-library/php/pull/1416.

MPDEC_RELEASE_NAME="mpdecimal-2.5.1"
MPDEC_URL="https://www.bytereef.org/software/mpdecimal/releases/$MPDEC_RELEASE_NAME.tar.gz"
MPDEC_SHA256_SUM="9f9cd4c041f99b5c49ffb7b59d9f12d95b683d88585608aa56a6307667b2b21f"
MPDEC_TMP_DIR="/tmp/$MPDEC_RELEASE_NAME"
MPDEC_TMP_ARCHIVE="$MPDEC_TMP_DIR/$MPDEC_RELEASE_NAME.tar.gz"

RUN_CMDS="$RUN_CMDS\\n\\nRUN"
RUN_CMDS="$RUN_CMDS mkdir -p $MPDEC_TMP_DIR"
RUN_CMDS="$RUN_CMDS && \\\\\n cd $MPDEC_TMP_DIR"
RUN_CMDS="$RUN_CMDS && \\\\\n curl -LO $MPDEC_URL"
RUN_CMDS="$RUN_CMDS && \\\\\n echo \"$MPDEC_SHA256_SUM $MPDEC_TMP_ARCHIVE\" | sha256sum --check --status -"
RUN_CMDS="$RUN_CMDS && \\\\\n tar xf $MPDEC_TMP_ARCHIVE"
RUN_CMDS="$RUN_CMDS && \\\\\n cd $MPDEC_RELEASE_NAME"
RUN_CMDS="$RUN_CMDS && \\\\\n ./configure && make && make install"
RUN_CMDS="$RUN_CMDS && \\\\\n rm -rf $MPDEC_TMP_DIR"
RUN_CMDS="$RUN_CMDS && \\\\\n pecl install decimal && docker-php-ext-enable decimal"
fi

echo -e "
Expand Down

0 comments on commit 5459571

Please sign in to comment.