forked from shivammathur/homebrew-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·56 lines (49 loc) · 2.1 KB
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
# typed: true
# frozen_string_literal: true
require File.expand_path("../Abstract/abstract-php-extension", __dir__)
# Class for Expect Extension
class ExpectAT56 < 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 3
sha256 cellar: :any, arm64_sequoia: "515e4a089c1c46b632de1ad24c3d207df5e3409c4fd357ea3abaaac6d35b5a34"
sha256 cellar: :any, arm64_sonoma: "900e8e441fc4ff016c2d9678747edd20a2d7fb7c4d473deb7128d82c49faa285"
sha256 cellar: :any, arm64_ventura: "f0ab53b5e13df739b6bfb6d2d1a51c92931a350bd4629a98a01707382a6acbff"
sha256 cellar: :any, ventura: "38becc15c1c4f4e4fc47c817062e021a4785bb2bc3a8f854d804108fc31fd75f"
sha256 cellar: :any_skip_relocation, x86_64_linux: "a054b9cb99edc9d90672f75fb67644a54533be3cedb3d43fa129cbda0b6fec54"
end
depends_on "expect"
depends_on "tcl-tk@8"
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@8"].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@8"].opt_prefix}/lib
]
add_expect_lib
add_expect_headers
Dir.chdir "expect-#{version}"
ENV.append "CFLAGS", "-Wno-incompatible-function-pointer-types"
safe_phpize
system "./configure", "--prefix=#{prefix}", phpconfig, *args
system "make"
prefix.install "modules/#{extension}.so"
write_config_file
add_include_files
end
end