diff --git a/Formula/vsh-php80.rb b/Formula/vsh-php80.rb index 8c56cc6b..3361efa6 100644 --- a/Formula/vsh-php80.rb +++ b/Formula/vsh-php80.rb @@ -1,11 +1,11 @@ class VshPhp80 < Formula desc "General-purpose scripting language" homepage "https://www.php.net/" - url "https://www.php.net/distributions/php-8.0.30.tar.xz" - mirror "https://fossies.org/linux/www/php-8.0.30.tar.xz" - sha256 "216ab305737a5d392107112d618a755dc5df42058226f1670e9db90e77d777d9" + url "https://github.com/shivammathur/php-src-backports/archive/b27aa4bf6d3e236bb853d2f1ef9cca338a3a5370.tar.gz" + version "8.0.30" + sha256 "ea4a8d291f031921fafddd4878d12db1329391d9e8450ccb96aebb823a230aae" license "PHP-3.01" - revision 56 + revision 500 bottle do root_url "https://github.com/valet-sh/homebrew-core/releases/download/bottles" @@ -14,6 +14,7 @@ class VshPhp80 < Formula depends_on "bison" => :build depends_on "pkg-config" => :build + depends_on "re2c" => :build depends_on "apr" depends_on "apr-util" depends_on "argon2" @@ -26,7 +27,7 @@ class VshPhp80 < Formula depends_on "gettext" depends_on "glib" depends_on "gmp" - depends_on "icu4c@74" + depends_on "icu4c@75" depends_on "jpeg" depends_on "libpng" depends_on "libyaml" @@ -37,7 +38,7 @@ class VshPhp80 < Formula depends_on "libzip" depends_on "oniguruma" depends_on "openldap" - depends_on "openssl@1.1" + depends_on "openssl@3" depends_on "pcre2" depends_on "sqlite" depends_on "tidy-html5" @@ -48,6 +49,7 @@ class VshPhp80 < Formula uses_from_macos "xz" => :build uses_from_macos "bzip2" uses_from_macos "libedit" + uses_from_macos "libffi", since: :catalina uses_from_macos "libxml2" uses_from_macos "libxslt" uses_from_macos "zlib" @@ -67,11 +69,14 @@ class VshPhp80 < Formula end def install - # Ensure that libxml2 will be detected correctly in older MacOS - ENV["SDKROOT"] = MacOS.sdk_path if MacOS.version == :el_capitan || MacOS.version == :sierra + # Work around for building with Xcode 15.3 + if DevelopmentTools.clang_build_version >= 1500 + ENV.append "CFLAGS", "-Wno-incompatible-function-pointer-types" + ENV.append "LDFLAGS", "-lresolv" + end - current_pkg_config_path = ENV["PKG_CONFIG_PATH"] - ENV["PKG_CONFIG_PATH"] = "/usr/local/opt/openssl@1.1/lib/pkgconfig:#{current_pkg_config_path}" + # Work around to support `icu4c` 75, which needs C++17. + ENV["ICU_CXXFLAGS"] = "-std=c++17" # buildconf required due to system library linking bug patch system "./buildconf", "--force" @@ -83,8 +88,15 @@ def install ENV["lt_cv_path_SED"] = "sed" # system pkg-config missing - ENV["SASL_CFLAGS"] = "-I#{MacOS.sdk_path_if_needed}/usr/include/sasl" - ENV["SASL_LIBS"] = "-lsasl2" + ENV["KERBEROS_CFLAGS"] = " " + if OS.mac? + ENV["SASL_CFLAGS"] = "-I#{MacOS.sdk_path_if_needed}/usr/include/sasl" + ENV["SASL_LIBS"] = "-lsasl2" + else + ENV["SQLITE_CFLAGS"] = "-I#{Formula["sqlite"].opt_include}" + ENV["SQLITE_LIBS"] = "-lsqlite3" + ENV["BZIP_DIR"] = Formula["bzip2"].opt_prefix + end # Each extension that is built on Mojave needs a direct reference to the # sdk path or it won't find the headers @@ -192,11 +204,13 @@ def install } # Use OpenSSL cert bundle - openssl = Formula["openssl@1.1"] - inreplace "php.ini-development", /; ?openssl\.cafile=/, - "openssl.cafile = \"#{openssl.pkgetc}/cert.pem\"" - inreplace "php.ini-development", /; ?openssl\.capath=/, - "openssl.capath = \"#{openssl.pkgetc}/certs\"" + openssl = Formula["openssl@3"] + %w[development production].each do |mode| + inreplace "php.ini-#{mode}", /; ?openssl\.cafile=/, + "openssl.cafile = \"#{openssl.pkgetc}/cert.pem\"" + inreplace "php.ini-#{mode}", /; ?openssl\.capath=/, + "openssl.capath = \"#{openssl.pkgetc}/certs\"" + end inreplace "sapi/fpm/www.conf" do |s| s.gsub!(/listen =.*/, "listen = /tmp/#{name}.sock") diff --git a/Formula/vsh-php81.rb b/Formula/vsh-php81.rb index fae1185a..63b3bbfb 100644 --- a/Formula/vsh-php81.rb +++ b/Formula/vsh-php81.rb @@ -5,7 +5,7 @@ class VshPhp81 < Formula mirror "https://fossies.org/linux/www/php-8.1.30.tar.xz" sha256 "f24a6007f0b25a53cb7fbaee69c85017e0345b62089c2425a0afb7e177192ed1" license "PHP-3.01" - revision 1 + revision 10 bottle do root_url "https://github.com/valet-sh/homebrew-core/releases/download/bottles" @@ -14,6 +14,7 @@ class VshPhp81 < Formula depends_on "bison" => :build depends_on "pkg-config" => :build + depends_on "re2c" => :build depends_on "apr" depends_on "apr-util" depends_on "argon2" @@ -26,7 +27,7 @@ class VshPhp81 < Formula depends_on "gettext" depends_on "glib" depends_on "gmp" - depends_on "icu4c@74" + depends_on "icu4c@75" depends_on "krb5" depends_on "jpeg" depends_on "libpng" @@ -38,7 +39,7 @@ class VshPhp81 < Formula depends_on "libzip" depends_on "oniguruma" depends_on "openldap" - depends_on "openssl@1.1" + depends_on "openssl@3" depends_on "pcre2" depends_on "sqlite" depends_on "tidy-html5" @@ -46,7 +47,6 @@ class VshPhp81 < Formula depends_on "webp" depends_on "imagemagick" - uses_from_macos "xz" => :build uses_from_macos "bzip2" uses_from_macos "libedit" uses_from_macos "libffi", since: :catalina @@ -78,18 +78,14 @@ class VshPhp81 < Formula end def install - # Backport fix for libxml2 >= 2.13 # Ref: https://github.com/php/php-src/commit/67259e451d5d58b4842776c5696a66d74e157609 inreplace "ext/xml/compat.c", "!= XML_PARSER_ENTITY_VALUE && parser->parser->instate != XML_PARSER_ATTRIBUTE_VALUE)", "== XML_PARSER_CONTENT)" - # Ensure that libxml2 will be detected correctly in older MacOS - ENV["SDKROOT"] = MacOS.sdk_path if MacOS.version == :el_capitan || MacOS.version == :sierra - - current_pkg_config_path = ENV["PKG_CONFIG_PATH"] - ENV["PKG_CONFIG_PATH"] = "/usr/local/opt/openssl@1.1/lib/pkgconfig:#{current_pkg_config_path}" + # Work around to support `icu4c` 75, which needs C++17. + ENV["ICU_CXXFLAGS"] = "-std=c++17" # buildconf required due to system library linking bug patch system "./buildconf", "--force" @@ -101,8 +97,15 @@ def install ENV["lt_cv_path_SED"] = "sed" # system pkg-config missing - ENV["SASL_CFLAGS"] = "-I#{MacOS.sdk_path_if_needed}/usr/include/sasl" - ENV["SASL_LIBS"] = "-lsasl2" + ENV["KERBEROS_CFLAGS"] = " " + if OS.mac? + ENV["SASL_CFLAGS"] = "-I#{MacOS.sdk_path_if_needed}/usr/include/sasl" + ENV["SASL_LIBS"] = "-lsasl2" + else + ENV["SQLITE_CFLAGS"] = "-I#{Formula["sqlite"].opt_include}" + ENV["SQLITE_LIBS"] = "-lsqlite3" + ENV["BZIP_DIR"] = Formula["bzip2"].opt_prefix + end # Each extension that is built on Mojave needs a direct reference to the # sdk path or it won't find the headers @@ -210,11 +213,13 @@ def install } # Use OpenSSL cert bundle - openssl = Formula["openssl@1.1"] - inreplace "php.ini-development", /; ?openssl\.cafile=/, - "openssl.cafile = \"#{openssl.pkgetc}/cert.pem\"" - inreplace "php.ini-development", /; ?openssl\.capath=/, - "openssl.capath = \"#{openssl.pkgetc}/certs\"" + openssl = Formula["openssl@3"] + %w[development production].each do |mode| + inreplace "php.ini-#{mode}", /; ?openssl\.cafile=/, + "openssl.cafile = \"#{openssl.pkgetc}/cert.pem\"" + inreplace "php.ini-#{mode}", /; ?openssl\.capath=/, + "openssl.capath = \"#{openssl.pkgetc}/certs\"" + end inreplace "sapi/fpm/www.conf" do |s| s.gsub!(/listen =.*/, "listen = /tmp/#{name}.sock") diff --git a/Formula/vsh-php82.rb b/Formula/vsh-php82.rb index 8267d10d..bfcada9a 100644 --- a/Formula/vsh-php82.rb +++ b/Formula/vsh-php82.rb @@ -5,14 +5,16 @@ class VshPhp82 < Formula mirror "https://fossies.org/linux/www/php-8.2.25.tar.xz" sha256 "330b54876ea1d05ade12ee9726167332058bccd58dffa1d4e12117f6b4f616b9" license "PHP-3.01" - revision 1 + revision 10 bottle do root_url "https://github.com/valet-sh/homebrew-core/releases/download/bottles" sha256 ventura: "33c77f5257551c44f388a20ed193b43273b860e073d673dc6de087da91d82ec5" end + depends_on "bison" => :build depends_on "pkg-config" => :build + depends_on "re2c" => :build depends_on "apr" depends_on "apr-util" depends_on "argon2" @@ -23,14 +25,14 @@ class VshPhp82 < Formula depends_on "gd" depends_on "gettext" depends_on "gmp" - depends_on "icu4c@74" + depends_on "icu4c@75" depends_on "krb5" depends_on "libpq" depends_on "libsodium" depends_on "libzip" depends_on "oniguruma" depends_on "openldap" - depends_on "openssl@1.1" + depends_on "openssl@3" depends_on "pcre2" depends_on "sqlite" depends_on "tidy-html5" @@ -59,10 +61,6 @@ class VshPhp82 < Formula end def install - - current_pkg_config_path = ENV["PKG_CONFIG_PATH"] - ENV["PKG_CONFIG_PATH"] = "/usr/local/opt/openssl@1.1/lib/pkgconfig:#{current_pkg_config_path}" - # buildconf required due to system library linking bug patch system "./buildconf", "--force" @@ -83,10 +81,6 @@ def install ENV["BZIP_DIR"] = Formula["bzip2"].opt_prefix end - # system pkg-config missing - ENV["SASL_CFLAGS"] = "-I#{MacOS.sdk_path_if_needed}/usr/include/sasl" - ENV["SASL_LIBS"] = "-lsasl2" - # Each extension that is built on Mojave needs a direct reference to the # sdk path or it won't find the headers headers_path = "=#{MacOS.sdk_path_if_needed}/usr" @@ -187,11 +181,13 @@ def install } # Use OpenSSL cert bundle - openssl = Formula["openssl@1.1"] - inreplace "php.ini-development", /; ?openssl\.cafile=/, - "openssl.cafile = \"#{openssl.pkgetc}/cert.pem\"" - inreplace "php.ini-development", /; ?openssl\.capath=/, - "openssl.capath = \"#{openssl.pkgetc}/certs\"" + openssl = Formula["openssl@3"] + %w[development production].each do |mode| + inreplace "php.ini-#{mode}", /; ?openssl\.cafile=/, + "openssl.cafile = \"#{openssl.pkgetc}/cert.pem\"" + inreplace "php.ini-#{mode}", /; ?openssl\.capath=/, + "openssl.capath = \"#{openssl.pkgetc}/certs\"" + end inreplace "sapi/fpm/www.conf" do |s| s.gsub!(/listen =.*/, "listen = /tmp/#{name}.sock") diff --git a/Formula/vsh-php83.rb b/Formula/vsh-php83.rb index 728af883..1b6aea09 100644 --- a/Formula/vsh-php83.rb +++ b/Formula/vsh-php83.rb @@ -6,7 +6,7 @@ class VshPhp83 < Formula mirror "https://fossies.org/linux/www/php-8.3.13.tar.xz" sha256 "89adb978cca209124fe53fd6327bc4966ca21213a7fa2e9504f854e340873018" license "PHP-3.01" - revision 1 + revision 10 bottle do root_url "https://github.com/valet-sh/homebrew-core/releases/download/bottles" @@ -24,14 +24,14 @@ class VshPhp83 < Formula depends_on "gd" depends_on "gettext" depends_on "gmp" - depends_on "icu4c@74" + depends_on "icu4c@75" depends_on "krb5" depends_on "libpq" depends_on "libsodium" depends_on "libzip" depends_on "oniguruma" depends_on "openldap" - depends_on "openssl@1.1" + depends_on "openssl@3" depends_on "pcre2" depends_on "sqlite" depends_on "tidy-html5" @@ -60,10 +60,6 @@ class VshPhp83 < Formula end def install - - current_pkg_config_path = ENV["PKG_CONFIG_PATH"] - ENV["PKG_CONFIG_PATH"] = "/usr/local/opt/openssl@1.1/lib/pkgconfig:#{current_pkg_config_path}" - # buildconf required due to system library linking bug patch system "./buildconf", "--force" @@ -84,10 +80,6 @@ def install ENV["BZIP_DIR"] = Formula["bzip2"].opt_prefix end - # system pkg-config missing - ENV["SASL_CFLAGS"] = "-I#{MacOS.sdk_path_if_needed}/usr/include/sasl" - ENV["SASL_LIBS"] = "-lsasl2" - # Each extension that is built on Mojave needs a direct reference to the # sdk path or it won't find the headers headers_path = "=#{MacOS.sdk_path_if_needed}/usr" @@ -188,11 +180,13 @@ def install } # Use OpenSSL cert bundle - openssl = Formula["openssl@1.1"] - inreplace "php.ini-development", /; ?openssl\.cafile=/, - "openssl.cafile = \"#{openssl.pkgetc}/cert.pem\"" - inreplace "php.ini-development", /; ?openssl\.capath=/, - "openssl.capath = \"#{openssl.pkgetc}/certs\"" + openssl = Formula["openssl@3"] + %w[development production].each do |mode| + inreplace "php.ini-#{mode}", /; ?openssl\.cafile=/, + "openssl.cafile = \"#{openssl.pkgetc}/cert.pem\"" + inreplace "php.ini-#{mode}", /; ?openssl\.capath=/, + "openssl.capath = \"#{openssl.pkgetc}/certs\"" + end inreplace "sapi/fpm/www.conf" do |s| s.gsub!(/listen =.*/, "listen = /tmp/#{name}.sock")