Skip to content

Commit 332e7f2

Browse files
authored
Merge pull request #196561 from Homebrew/libxml2-drop-py311
libxml2: drop `python@3.11`, use `--with-legacy` for better ABI compat
2 parents 247ae96 + 3b9747a commit 332e7f2

File tree

1 file changed

+28
-29
lines changed

1 file changed

+28
-29
lines changed

Formula/lib/libxml2.rb

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ class Libxml2 < Formula
1414
end
1515

1616
bottle do
17-
sha256 cellar: :any, arm64_sequoia: "958deabfc4c6a8908580a7538b1392e4a50c6f3cc7246239a62bf603ae33acaf"
18-
sha256 cellar: :any, arm64_sonoma: "7dd663ec7beda167b1f0705d984ccb38db2d882ef1f78678b7abecd81ddeb119"
19-
sha256 cellar: :any, arm64_ventura: "4fe3f65d703d925efbeeff545561dabc1e3d70de359c3b2cc3e6799aa4b33e6f"
20-
sha256 cellar: :any, sonoma: "3bd5fd6fa2457c18f3f68e71dfc1cb0f6155a7aaa2acd93b42d3e7eb955b72d3"
21-
sha256 cellar: :any, ventura: "be5ba075471da4de1260ec75e78c496b3689678e8edaf5860febe9f26f4a2cd8"
22-
sha256 cellar: :any_skip_relocation, x86_64_linux: "d43aafed4f334588e937fac87b381df3c6e42f790b3828dd932512bf349b77df"
17+
rebuild 1
18+
sha256 cellar: :any, arm64_sequoia: "3211945521a13a278641145097b44c242a91afb03819efdce733dd2a39b4ca9b"
19+
sha256 cellar: :any, arm64_sonoma: "c7661433ff9cf455314ec3bd7fa0cc15debee3df74e6c894f82707f804471f7d"
20+
sha256 cellar: :any, arm64_ventura: "7d218dd815b26bf68e824b45e491bbad0d4e8c5c8246d8bbe5f6de784815d788"
21+
sha256 cellar: :any, sonoma: "c3f316fa073279036b0c81fad21d158ddac26a30d0a457be67b753bb8fcdc2b5"
22+
sha256 cellar: :any, ventura: "7e48fccee11b2ee6d789460b57e1ac3b49c42297be839f05361bcfff61795b73"
23+
sha256 cellar: :any_skip_relocation, x86_64_linux: "29e6b3900187de9084702abb031c991f7918b1d44b8084bec2c52d7d37ba6a0f"
2324
end
2425

2526
head do
@@ -33,7 +34,7 @@ class Libxml2 < Formula
3334

3435
keg_only :provided_by_macos
3536

36-
depends_on "python@3.11" => [:build, :test]
37+
depends_on "python-setuptools" => :build
3738
depends_on "python@3.12" => [:build, :test]
3839
depends_on "python@3.13" => [:build, :test]
3940
depends_on "pkg-config" => :test
@@ -61,6 +62,7 @@ def install
6162
"--with-history",
6263
"--with-http",
6364
"--with-icu",
65+
"--with-legacy", # https://gitlab.gnome.org/GNOME/libxml2/-/issues/751#note_2157870
6466
"--without-lzma",
6567
"--without-python",
6668
*std_configure_args
@@ -70,29 +72,26 @@ def install
7072
.to_formula
7173
inreplace [bin/"xml2-config", lib/"pkgconfig/libxml-2.0.pc"], icu4c.prefix.realpath, icu4c.opt_prefix
7274

73-
cd "python" do
74-
sdk_include = if OS.mac?
75-
sdk = MacOS.sdk_path_if_needed
76-
sdk/"usr/include" if sdk
77-
else
78-
HOMEBREW_PREFIX/"include"
79-
end
75+
sdk_include = if OS.mac?
76+
sdk = MacOS.sdk_path_if_needed
77+
sdk/"usr/include" if sdk
78+
else
79+
HOMEBREW_PREFIX/"include"
80+
end
81+
82+
includes = [include, sdk_include].compact.map do |inc|
83+
"'#{inc}',"
84+
end.join(" ")
85+
86+
# We need to insert our include dir first
87+
inreplace "python/setup.py", "includes_dir = [",
88+
"includes_dir = [#{includes}"
8089

81-
includes = [include, sdk_include].compact.map do |inc|
82-
"'#{inc}',"
83-
end.join(" ")
84-
85-
# We need to insert our include dir first
86-
inreplace "setup.py", "includes_dir = [",
87-
"includes_dir = [#{includes}"
88-
89-
# Needed for Python 3.12+.
90-
# https://github.com/Homebrew/homebrew-core/pull/154551#issuecomment-1820102786
91-
with_env(PYTHONPATH: buildpath/"python") do
92-
pythons.each do |python|
93-
build_isolation = Language::Python.major_minor_version(python) >= "3.12"
94-
system python, "-m", "pip", "install", *std_pip_args(build_isolation:), "."
95-
end
90+
# Needed for Python 3.12+.
91+
# https://github.com/Homebrew/homebrew-core/pull/154551#issuecomment-1820102786
92+
with_env(PYTHONPATH: buildpath/"python") do
93+
pythons.each do |python|
94+
system python, "-m", "pip", "install", *std_pip_args, "./python"
9695
end
9796
end
9897
end

0 commit comments

Comments
 (0)