-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
expect@8.2.rb
executable file
·62 lines (55 loc) · 2.44 KB
/
expect@8.2.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# typed: true
# frozen_string_literal: true
require File.expand_path("../Abstract/abstract-php-extension", __dir__)
# Class for Expect Extension
class ExpectAT82 < AbstractPhpExtension
init
desc "Expect PHP extension"
homepage "https://github.com/sibaz/pecl-expect"
url "https://pecl.php.net/get/expect-0.4.0.tgz"
sha256 "032ff2f92a9f95a2cb91d9e1c1b711c696e562ea57cdec8459954d8b0601d442"
head "https://github.com/sibaz/pecl-expect.git"
license "PHP-3.01"
bottle do
root_url "https://ghcr.io/v2/shivammathur/extensions"
rebuild 4
sha256 cellar: :any, arm64_ventura: "fb4acb3d0827a9bcb5c9c033591d20530075300003051c509b401928dac3169e"
sha256 cellar: :any, arm64_monterey: "c021ffae06be734d56577cc5e35c75836e711b781d891654cb9afa3abe434cc8"
sha256 cellar: :any, arm64_big_sur: "3fd9350c63cd6feca569d7459d691ff74e30036c69eb94c93181fd9d12a58e66"
sha256 cellar: :any, ventura: "85592a5d53fb3fc1822fcb5933988f6bc7e0074de8088857719b23b1cf24b1e8"
sha256 cellar: :any, monterey: "edea134e8c01a93f0bd18cd916eb90116df6a29b283e24166741f2a7efa548d1"
sha256 cellar: :any, big_sur: "f838245af03644510849c3851e3fe7967a35bad60a36c157ed144e89a76b659a"
sha256 cellar: :any_skip_relocation, x86_64_linux: "137ab8ac19a8db36d65a84ce441b6991b08b5545f054aff9ad9e5f6d2a32c505"
end
depends_on "expect"
depends_on "tcl-tk"
def add_expect_lib
expect_lib = Dir["#{Formula["homebrew/core/expect"].opt_lib}/expect*/libexpect*"].first
lib.install_symlink expect_lib => "libexpect#{File.extname(expect_lib)}" if expect_lib
ENV.append "LDFLAGS", "-L#{lib}"
end
def add_expect_headers
headers = Dir["#{Formula["tcl-tk"].opt_include}/**/*.h"]
(buildpath/"expect-#{version}/include").install_symlink headers unless headers.empty?
end
def install
args = %W[
--with-expect=shared,#{Formula["expect"].opt_prefix}
--with-tcldir=#{Formula["tcl-tk"].opt_prefix}/lib
]
add_expect_lib
add_expect_headers
Dir.chdir "expect-#{version}"
inreplace "expect_fopen_wrapper.c", " TSRMLS_DC", ""
inreplace "expect.c" do |s|
s.gsub! " TSRMLS_CC", ""
s.gsub! "ulong", "zend_ulong"
end
safe_phpize
system "./configure", "--prefix=#{prefix}", phpconfig, *args
system "make"
prefix.install "modules/#{extension}.so"
write_config_file
add_include_files
end
end