-
Notifications
You must be signed in to change notification settings - Fork 39
fix: add APT dependencies to some scripts for scalingo-24-minimal #529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
14649eb
ba5bc52
5b3657a
0bfbed1
9f33105
c542e43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#/usr/bin/env bash | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if [ -n "$DEBUG" ]; then | ||
set -x | ||
set -x | ||
fi | ||
|
||
basedir="$( cd -P "$( dirname "$0" )" && pwd )" | ||
|
@@ -19,89 +19,93 @@ if [ -z "$1" ]; then | |
fi | ||
|
||
php_version="$1" | ||
php_series="$(echo $php_version | cut -d '.' -f1,2)" | ||
|
||
echo "-----> Packaging PHP $php_version" | ||
|
||
tempdir=$(mktmpdir php) | ||
cd $tempdir | ||
cd "$tempdir" | ||
|
||
echo "-----> Downloading dependency zlib ${zlib_version}" | ||
curl -LO "${PHP_BASE_URL}/zlib/zlib-${zlib_version}.tar.gz" | ||
tar -xzvf "zlib-${zlib_version}.tar.gz" | ||
tar -xzf "zlib-${zlib_version}.tar.gz" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed the verbosity of the |
||
|
||
echo "-----> Downloading dependency libonig ${libonig_version}" | ||
libzip_flag="" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This always empty |
||
mkdir /app/vendor/libonig -p | ||
curl -L -o - "${PHP_BASE_URL}/package/libonig-${libonig_version}.tgz" | tar -C /app/vendor/libonig -xvz | ||
export C_INCLUDE_PATH="$C_INCLUDE_PATH:/app/vendor/libonig/include" | ||
export PKG_CONFIG_PATH="/app/vendor/libonig/lib/pkgconfig:$PKG_CONFIG_PATH" | ||
|
||
echo "-----> Downloading dependency WebP library ${webp_version}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just moved this earlier |
||
mkdir -p "/app/vendor/libwebp" | ||
curl "${PHP_BASE_URL}/package/libwebp-${webp_version}.tgz" | tar xz -C /app/vendor/libwebp | ||
|
||
echo "-----> Downloading PHP $php_version" | ||
curl -LO "https://php.net/distributions/php-${php_version}.tar.gz" | ||
tar -xzvf "php-${php_version}.tar.gz" | ||
tar -xzf "php-${php_version}.tar.gz" | ||
|
||
install_zend_optimizer=":" | ||
install_zend_optimizer=$(cat <<SH | ||
echo "zend_extension=opcache.so" > /app/vendor/php/etc/conf.d/opcache.ini | ||
SH | ||
) | ||
|
||
WITH_CURL_CONFIGURE="" | ||
WITH_CURL_CONFIGURE="--with-curl=/usr" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This default value was already in the call to |
||
if [ -d '/app/.apt/usr' ] ; then | ||
WITH_CURL_CONFIGURE="--with-curl=/app/.apt/usr" | ||
fi | ||
|
||
mkdir -p "/app/vendor/libwebp" \ | ||
&& curl "${PHP_BASE_URL}/package/libwebp-${webp_version}.tgz" | tar xzv -C /app/vendor/libwebp | ||
|
||
export WEBP_LIBS="-L/app/vendor/libwebp/lib -lwebp" | ||
export WEBP_CFLAGS="-I/app/vendor/libwebp/include" | ||
|
||
ENABLE_GD_CONFIGURE="--enable-gd --with-jpeg --with-freetype --with-webp" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added these options in the |
||
|
||
mkdir -p "/app/vendor/php/etc/conf.d" \ | ||
&& pushd zlib-${zlib_version} >/dev/null && ./configure --prefix=/app/vendor/php/zlib && make && make install && popd > /dev/null \ | ||
&& pushd php-${php_version} >/dev/null \ | ||
&& ./configure --prefix=/app/vendor/php \ | ||
--with-config-file-path=/app/vendor/php/etc \ | ||
--with-config-file-scan-dir=/app/vendor/php/etc/conf.d \ | ||
--enable-intl \ | ||
${ENABLE_GD_CONFIGURE} \ | ||
--enable-exif \ | ||
--with-mysqli \ | ||
--with-pdo-mysql \ | ||
--with-pdo-sqlite \ | ||
--with-pdo-pgsql=/usr/bin/pg_config \ | ||
--with-pgsql \ | ||
--enable-shmop \ | ||
--with-zip \ | ||
${WITH_CURL_CONFIGURE} \ | ||
${libzip_flag} \ | ||
--with-zlib=/app/vendor/php/zlib \ | ||
--with-bz2 \ | ||
--with-openssl \ | ||
--enable-soap \ | ||
--enable-xmlreader \ | ||
--with-curl=/usr \ | ||
--with-xsl \ | ||
--enable-fpm \ | ||
--enable-mbstring \ | ||
--enable-pcntl \ | ||
--enable-sockets \ | ||
--enable-bcmath \ | ||
--with-readline \ | ||
--with-password-argon2 \ | ||
--disable-debug \ | ||
&& echo ${php_version} | grep ^5.3 && sed -i '/^BUILD_/ s/\$(CC)/\$(CXX)/g' Makefile || true \ | ||
&& make -j 8 \ | ||
&& make install \ | ||
&& popd > /dev/null \ | ||
&& eval $install_zend_optimizer | ||
mkdir -p "/app/vendor/php/etc/conf.d" | ||
|
||
echo "-----> Compile ZLib v${zlib_version}" | ||
pushd "zlib-${zlib_version}" >/dev/null | ||
./configure --prefix=/app/vendor/php/zlib | ||
make | ||
make install | ||
popd > /dev/null | ||
|
||
echo "-----> Compile PHP v${php_version}" | ||
pushd "php-${php_version}" >/dev/null | ||
./configure --prefix=/app/vendor/php \ | ||
--with-config-file-path=/app/vendor/php/etc \ | ||
--with-config-file-scan-dir=/app/vendor/php/etc/conf.d \ | ||
--enable-intl \ | ||
--enable-gd --with-jpeg --with-freetype --with-webp \ | ||
--enable-exif \ | ||
--with-mysqli \ | ||
--with-pdo-mysql \ | ||
--with-pdo-sqlite \ | ||
--with-pdo-pgsql=/usr/bin/pg_config \ | ||
--with-pgsql \ | ||
--enable-shmop \ | ||
--with-zip \ | ||
${WITH_CURL_CONFIGURE} \ | ||
--with-zlib=/app/vendor/php/zlib \ | ||
--with-bz2 \ | ||
--with-openssl \ | ||
--enable-soap \ | ||
--enable-xmlreader \ | ||
--with-xsl \ | ||
--enable-fpm \ | ||
--enable-mbstring \ | ||
--enable-pcntl \ | ||
--enable-sockets \ | ||
--enable-bcmath \ | ||
--with-readline \ | ||
--with-password-argon2 \ | ||
--disable-debug | ||
echo "${php_version}" | grep ^5.3 && sed -i '/^BUILD_/ s/\$(CC)/\$(CXX)/g' Makefile || true | ||
make -j 8 | ||
make install | ||
popd > /dev/null | ||
|
||
eval "$install_zend_optimizer" | ||
|
||
mkdir package | ||
pushd /app/vendor/php > /dev/null | ||
tar zcvf "${tempdir}/package/php-${php_version}.tgz" . | ||
tar zcf "${tempdir}/package/php-${php_version}.tgz" . | ||
popd > /dev/null | ||
|
||
echo "-----> Moving package to Swift" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable is never used