diff --git a/Formula/php-uuid.rb b/Formula/php-uuid.rb index 84a1dcc..6a05bf7 100644 --- a/Formula/php-uuid.rb +++ b/Formula/php-uuid.rb @@ -1,21 +1,23 @@ class PhpUuid < Formula desc "UUID Extension for PHP" homepage "https://pecl.php.net/uuid" - url "https://pecl.php.net/get/uuid-1.2.0.tgz" - sha256 "5cb834d32fa7d270494aa47fd96e062ef819df59d247788562695fd1f4e470a4" head "https://github.com/php/pecl-networking-uuid.git" + stable do + url "https://pecl.php.net/get/uuid-1.2.0.tgz" + sha256 "5cb834d32fa7d270494aa47fd96e062ef819df59d247788562695fd1f4e470a4" + patch do + # let's fix the path to uuid.h (uuid/uuid.h on linux, ossp/uuid.h on OSX) + # uuid_mac & uuid_time might not be available on OSX, let's add test to avoid compiling issue on these functions + url "https://github.com/php/pecl-networking-uuid/commit/a393861918b75d9657cb8125a4e17cebd2432c4a.patch?full_index=1" + sha256 "f72c5bd71d4c320a3bf7922104bbce959b574b79e3d504e35bccb154054f0f66" + directory "uuid-1.2.0" + end + end + depends_on "autoconf" => :build - depends_on "ossp-uuid" depends_on "php" - - patch do - # let's fix the path to uuid.h (uuid/uuid.h on linux, ossp/uuid.h on OSX) - # uuid_mac & uuid_time might not be available on OSX, let's add test to avoid compiling issue on these functions - url "https://github.com/SMillerDev/pecl-networking-uuid/commit/90a448026454af4e3b76fa514dca583a1d31d7e5.patch?full_index=1" - sha256 "c590c2045cf9837e9c97f1bfd078b615cf32d4d4c2995a793bc3691b9a0c29ee" - directory "uuid-1.2.0" - end + depends_on "util-linux" def module_path extension_dir = Utils.safe_popen_read("#{Formula["php"].opt_bin}/php-config", "--extension-dir").chomp @@ -24,16 +26,15 @@ def module_path end def install - chdir "uuid-#{version}" do - system Formula["php"].bin/"phpize" - configure_args = %W[ - --with-php-config=#{Formula["php"].opt_bin/"php-config"} - --with-uuid=#{Formula["ossp-uuid"].opt_include} - ] - system "./configure", *configure_args - system "make" - (lib/module_path).install "modules/uuid.so" - end + chdir "uuid-#{version}" if build.stable? + system Formula["php"].bin/"phpize" + configure_args = %W[ + --with-php-config=#{Formula["php"].opt_bin/"php-config"} + --with-uuid=#{Formula["util-linux"].opt_prefix} + ] + system "./configure", *configure_args + system "make" + (lib/module_path).install "modules/uuid.so" end def post_install