#!/bin/bash # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. set -e # Update from https://www.zlib.net/ zlib_version="1.2.11" zlib_sha256="c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1" # Update from https://apr.apache.org/ apr_version="1.6.5" apr_sha256="70dcf9102066a2ff2ffc47e93c289c8e54c95d8dda23b503f9e61bb0cbd2d105" apr_util_version="1.6.1" apr_util_sha256="b65e40713da57d004123b6319828be7f1273fbc6490e145874ee1177e112c459" # Update from https://httpd.apache.org/download.cgi httpd_version="2.4.38" httpd_sha256="38d0b73aa313c28065bf58faf64cec12bf7c7d5196146107df2ad07541aa26a6" # Update from https://www.openssl.org/source/ openssl_version="1.1.1b" openssl_sha256="5c557b023230413dfb0756f3137a13e6d726838ccd1430888ad15bfb2b43ea4b" # Update from https://www.pcre.org/ pcre_version="8.42" pcre_sha256="69acbc2fbdefb955d42a4c606dfde800c2885711d2979e356c0636efde9ec3b5" # Update from https://secure.php.net/downloads.php php_version="7.3.3" php_sha256="9bde40cbf8608ae9c595a6643a02cf0c692c131e2b3619af3fd2af8425d8e677" build="$PWD/build" out="$PWD/out" src="$PWD/src" if [ -d "$build" ]; then echo "$build already exists. Remove for a new build" exit 1 fi if [ -d "$out" ]; then echo "$out already exists. Remove for a new build" exit 1 fi if [ -d "$src" ]; then echo "$src already exists. Remove for a new build" exit 1 fi jobs=5 echo "Downloading sources" curl_if_needed() { if [ ! -f "$1" ]; then curl -o "$1" "$2" fi } curl_if_needed "apr-${apr_version}.tar.gz" "https://archive.apache.org/dist/apr/apr-${apr_version}.tar.gz" curl_if_needed "apr-util-${apr_util_version}.tar.gz" "https://archive.apache.org/dist/apr/apr-util-${apr_util_version}.tar.gz" curl_if_needed "httpd-${httpd_version}.tar.gz" "https://archive.apache.org/dist/httpd/httpd-${httpd_version}.tar.gz" curl_if_needed "openssl-${openssl_version}.tar.gz" "https://www.openssl.org/source/openssl-${openssl_version}.tar.gz" curl_if_needed "pcre-${pcre_version}.tar.gz" "https://ftp.pcre.org/pub/pcre/pcre-${pcre_version}.tar.gz" curl_if_needed "php-${php_version}.tar.gz" "https://secure.php.net/distributions/php-${php_version}.tar.gz" curl_if_needed "zlib-${zlib_version}.tar.gz" "https://www.zlib.net/zlib-${zlib_version}.tar.gz" # Check hashes. cat > SHA256SUMS < "${out}/LICENSE" <> "${out}/LICENSE" echo "=======================" >> "${out}/LICENSE" echo >> "${out}/LICENSE" echo "${f}:" >> "${out}/LICENSE" cat "${src}/${f}" >> "${out}/LICENSE" done # zlib does not have a standalone LICENSE file. Extract it from the README # instead. echo >> "${out}/LICENSE" echo "=======================" >> "${out}/LICENSE" echo >> "${out}/LICENSE" echo "From zlib-${zlib_version}/README:" >> "${out}/LICENSE" sed -n -e '/^Copyright notice:/,//p' "${src}/zlib-${zlib_version}/README" >> "${out}/LICENSE" for f in ${bin_files} ${lib_files} ${libexec_files}; do cp "${build}/${f}" "${out}/${f}" for lib in ${lib_files}; do install_name_tool -change "${build}/${lib}" "@rpath/$(basename "${lib}")" "${out}/${f}" done done for f in ${bin_files}; do install_name_tool -add_rpath "@executable_path/../lib" "${out}/${f}" done for f in ${lib_files}; do install_name_tool -id "@rpath/$(basename "${f}")" "${out}/${f}" done for f in ${libexec_files}; do install_name_tool -id "@rpath/../libexec/$(basename "${f}")" "${out}/${f}" done