diff --git a/Formula/wxpython.rb b/Formula/wxpython.rb index 331b5db171ce..4fbaa2d75e31 100644 --- a/Formula/wxpython.rb +++ b/Formula/wxpython.rb @@ -3,10 +3,9 @@ class Wxpython < Formula desc "Python bindings for wxWidgets" homepage "https://www.wxpython.org/" - url "https://files.pythonhosted.org/packages/b0/4d/80d65c37ee60a479d338d27a2895fb15bbba27a3e6bb5b6d72bb28246e99/wxPython-4.1.1.tar.gz" - sha256 "00e5e3180ac7f2852f342ad341d57c44e7e4326de0b550b9a5c4a8361b6c3528" + url "https://files.pythonhosted.org/packages/d9/33/b616c7ed4742be6e0d111ca375b41379607dc7cc7ac7ff6aead7a5a0bf53/wxPython-4.2.0.tar.gz" + sha256 "663cebc4509d7e5d113518865fe274f77f95434c5d57bc386ed58d65ceed86c7" license "LGPL-2.0-or-later" => { with: "WxWindows-exception-3.1" } - revision 3 bottle do sha256 cellar: :any, arm64_monterey: "7b558516617be5aa563cf1250276eea3eda660e19bdf8bf66417aa55215992ea" @@ -16,51 +15,45 @@ class Wxpython < Formula sha256 cellar: :any, catalina: "363cff6b220e1d12e1075e3dfbb580eab83c0fea65f3c4f398d2d6eba80c5145" end - depends_on "freetype" - depends_on "jpeg-turbo" - depends_on "libpng" - depends_on "libtiff" + depends_on "doxygen" => :build + depends_on "sip" => :build depends_on "numpy" depends_on "pillow" - # The current stable release 4.1.1 is incompatible with Python 3.10. - # Requires backporting multiple upstream commits (e.g. PR 2026, 2039, 2062, ...) - # TODO: Update to `python@3.10` on next release. - # Ref: https://src.fedoraproject.org/rpms/python-wxpython4/commits/ - depends_on "python@3.9" + depends_on "python@3.10" depends_on "six" - depends_on "tcl-tk" - - uses_from_macos "zlib" + depends_on "wxwidgets" on_linux do depends_on "pkg-config" => :build depends_on "gtk+3" end - def install - # Work around error: [Errno 2] No such file or directory: 'brew' - # Try removing in the next release. - ENV["SETUPTOOLS_USE_DISTUTILS"] = "stdlib" - - # Fix build of included wxwidgets: - # https://github.com/wxWidgets/Phoenix/issues/1247 - # https://github.com/Homebrew/homebrew-core/pull/58988 - inreplace "buildtools/build_wxwidgets.py" do |s| - s.gsub! "#wxpy_configure_opts.append(\"--enable-monolithic\")", - "wxpy_configure_opts.append(\"--disable-precomp-headers\")" - end - - inreplace "wscript", "MACOSX_DEPLOYMENT_TARGET = \"10.6\"", - "MACOSX_DEPLOYMENT_TARGET = \"#{MacOS.version}\"" + # Fix build scripts depending on attrdict3 even though only used on Windows. + # Remove once upstream PR is merged and in release. + # PR ref: https://github.com/wxWidgets/Phoenix/pull/2224 + patch do + url "https://github.com/wxWidgets/Phoenix/commit/2e9169effa9abf14f34f8436a791b8829eea7774.patch?full_index=1" + sha256 "932b3decf8fe5bd982c857796f0b9d936c6a080616733b98ffbd2d3229692e20" + end - if OS.mac? && (sdk = MacOS.sdk_path_if_needed) - ENV.append_to_cflags "-I#{sdk}/usr/include" - end - system "python3.9", *Language::Python.setup_install_args(prefix) + def install + ENV["DOXYGEN"] = Formula["doxygen"].opt_bin/"doxygen" + python = "python3.10" + system python, "-u", "build.py", "dox", "touch", "etg", "sip", "build_py", + "--release", + "--use_syswx", + "--prefix=#{prefix}", + "--jobs=#{ENV.make_jobs}", + "--verbose", + "--nodoc" + system python, *Language::Python.setup_install_args(prefix, python), + "--skip-build", + "--install-platlib=#{prefix/Language::Python.site_packages(python)}" end test do - output = shell_output("python3.9 -c 'import wx ; print(wx.__version__)'") + python = Formula["python@3.10"].opt_bin/"python3.10" + output = shell_output("#{python} -c 'import wx ; print(wx.__version__)'") assert_match version.to_s, output end end