Skip to content

Commit

Permalink
pypy3.9: update resources and workaround to enable new setuptools
Browse files Browse the repository at this point in the history
pypi_formula_mappings: add `pypy3.9` extra_packages
pypy3.9: update sha256

Signed-off-by: Patrick Linnane <[email protected]>
Signed-off-by: Michael Cho <[email protected]>
  • Loading branch information
cho-m committed Mar 13, 2024
1 parent 84aa57b commit fe84f1a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
37 changes: 24 additions & 13 deletions Formula/p/pypy3.9.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Pypy39 < Formula
desc "Implementation of Python 3 in Python"
homepage "https://pypy.org/"
url "https://downloads.python.org/pypy/pypy3.9-v7.3.15-src.tar.bz2"
sha256 "e42c16593dd2d8e30ffa6287660c6984562bf4e9f95e660706e16764dfec85a8"
sha256 "6bb9537d85aa7ad13c0aad2e41ff7fd55080bc9b4d1361b8f502df51db816e18"
license "MIT"
head "https://github.com/pypy/pypy.git", branch: "main"

Expand Down Expand Up @@ -36,17 +36,14 @@ class Pypy39 < Formula
uses_from_macos "unzip"
uses_from_macos "zlib"

# setuptools >= 60 required sysconfig patch
# See https://github.com/Homebrew/homebrew-core/pull/99892#issuecomment-1108492321
resource "setuptools" do
url "https://files.pythonhosted.org/packages/ef/75/2bc7bef4d668f9caa9c6ed3f3187989922765403198243040d08d2a52725/setuptools-59.8.0.tar.gz"
sha256 "09980778aa734c3037a47997f28d6db5ab18bdf2af0e49f719bfc53967fd2e82"
resource "pip" do
url "https://files.pythonhosted.org/packages/94/59/6638090c25e9bc4ce0c42817b5a234e183872a1129735a9330c472cc2056/pip-24.0.tar.gz"
sha256 "ea9bd1a847e8c5774a5777bb398c19e80bcd4e2aa16a4b301b718fe6f593aba2"
end

# always pull the latest pip, https://pypi.org/project/pip/#files
resource "pip" do
url "https://files.pythonhosted.org/packages/b7/06/6b1ad0ae8f97d7a0d6f6ad640db10780578999e647a9593512ceb6f06469/pip-23.3.2.tar.gz"
sha256 "7fd9972f96db22c8077a1ee2691b172c8089b17a5652a44494a9ecb0d78f9149"
resource "setuptools" do
url "https://files.pythonhosted.org/packages/4d/5b/dc575711b6b8f2f866131a40d053e30e962e633b332acf7cd2c24843d83d/setuptools-69.2.0.tar.gz"
sha256 "0ff4183f8f42cd8fa3acea16c45205521a4ef28f73c6391d8a25e92893134f2e"
end

# Build fixes:
Expand All @@ -64,6 +61,11 @@ def newest_abi_version?
end

def install

Check failure on line 63 in Formula/p/pypy3.9.rb

View workflow job for this annotation

GitHub Actions / Linux

`brew install --verbose --build-bottle pypy3.9` failed on Linux!

[c:writing] pypy_module_cpyext_3.c [c:writing] pypy_module_cpyext_4.c [c:writing] pypy_module_cpyext_5.c [c:writing] pypy_module_cpyext_6.c [c:writing] pypy_module_cpyext_7.c [c:writing] pypy_module_exceptions.c [c:writing] pypy_module_faulthandler.c [c:writing] pypy_module_fcntl.c [c:writing] pypy_module_gc.c [c:writing] pypy_module_imp.c [c:writing] pypy_module_itertools.c [c:writing] pypy_module_marshal.c [c:writing] pypy_module_math.c [c:writing] pypy_module_mmap.c [c:writing] pypy_module_operator.c [c:writing] pypy_module_parser.c [c:writing] pypy_module_posix.c [c:writing] pypy_module_pwd.c [c:writing] pypy_module_pyexpat.c [c:writing] pypy_module_pypyjit.c [c:writing] pypy_module_select.c [c:writing] pypy_module_signal.c [c:writing] pypy_module_struct.c [c:writing] pypy_module_sys.c [c:writing] pypy_module_termios.c [c:writing] pypy_module_thread.c [c:writing] pypy_module_time.c [c:writing] pypy_module_token.c [c:writing] pypy_module_unicodedata.c [c:writing] pypy_module_zipimport.c [c:writing] pypy_module_zlib.c [c:writing] pypy_objspace.c [c:writing] pypy_objspace_std.c [c:writing] pypy_objspace_std_1.c [c:writing] pypy_objspace_std_2.c [c:writing] pypy_objspace_std_3.c [c:writing] pypy_objspace_std_4.c [c:writing] pypy_objspace_std_5.c [c:writing] pypy_objspace_std_6.c [c:writing] pypy_objspace_std_7.c [c:writing] pypy_objspace_std_8.c [c:writing] pypy_objspace_std_9.c [c:writing] pypy_objspace_std_10.c [c:writing] rpython_flowspace.c [c:writing] rpython_jit_backend.c [c:writing] rpython_jit_backend_llsupport.c [c:writing] rpython_jit_backend_llsupport_1.c [c:writing] rpython_jit_backend_x86.c [c:writing] rpython_jit_backend_x86_1.c [c:writing] rpython_jit_backend_x86_2.c [c:writing] rpython_jit_backend_x86_3.c [c:writing] rpython_jit_codewriter.c [c:writing] rpython_jit_metainterp.c [c:writing] rpython_jit_metainterp_1.c [c:writing] rpython_jit_metainterp_2.c [c:writing] rpython_jit_metainterp_3.c [c:writing] rpython_jit_metainterp_4.c [c:writing] rpython_jit_metainterp_5.c [c:writing] rpython_jit_metainterp_6.c [c:writing] rpython_jit_metainterp_7.c [c:writing] rpython_jit_metainterp_8.c [c:writing] rpython_jit_metainterp_optimizeopt.c [c:writing] rpython_jit_metainterp_optimizeopt_1.c [c:writing] rpython_jit_metainterp_optimizeopt_2.c [c:writing] rpython_jit_metainterp_optimizeopt_3.c [c:writing] rpython_jit_metainterp_optimizeopt_4.c [c:writing] rpython_memory.c [c:writing] rpython_memory_gc.c [c:writing] rpython_memory_gctransform.c [c:writing] rpython_rlib.c [c:writing] rpython_rlib_1.c [c:writing] rpython_rlib_2.c [c:writing] rpython_rlib_3.c [c:writing] rpython_rlib_rjitlog.c [c:writing] rpython_rlib_rsre.c [c:writing] rpython_rlib_rstruct.c [c:writing] rpython_rlib_rvmprof.c [c:writing] rpython_rlib_unicodedata.c [c:writing] rpython_rtyper.c [c:writing] rpython_rtyper_lltypesystem.c [c:writing] rpython_rtyper_lltypesystem_1.c [c:writing] rpython_rtyper_lltypesystem_2.c [c:writing] rpython_rtyper_lltypesystem_3.c [c:writing] rpython_rtyper_lltypesystem_module.c [c:writing] rpython_translator.c [c:writing] rpython_translator_c.c [translation:info] written: /tmp/pypy3.9-20240315-6012-yc705d/pypy3.9-v7.3.15-src/usession-release-pypy3.9-v7.3.15-0/testing_1/testing_1.c [1737e] translation-task} [translation:info] Compiling c source... [1737e] {translation-task starting compile_c [platform:execute] make -j 4 in /tmp/pypy3.9-20240315-6012-yc705d/pypy3.9-v7.3.15-src/usession-release-pypy3.9-v7.3.15-0/testing_1 [translation:info] copied: /tmp/pypy3.9-20240315-6012-yc705d/pypy3.9-v7.3.15-src/usession-release-pypy3.9-v7.3.15-0/testing_1/pypy3.9-c to /tmp/pypy3.9-20240315-6012-yc705d/pypy3.9-v7.3.15-src/pypy/goal/pypy3.9-c [translation:info] copied: /tmp/pypy3.9-20240315-6012-yc705d/pypy3.9-v7.3.15-src/usession-release-pypy3.9-v7.3.15-0/testing_1/libpypy3.9-c.so to /tmp/pypy3.9-20240315-6012-yc705d/pypy3.9-v7.3.15-src/pypy/goal/libpypy3.9-c.so [translation:info] created: /tmp/pypy3.9-20240315-6012-yc705d/pypy3.9-v7.3.15-src/pypy/goal/pypy3.9-c [173fd] translation-task} [translation:info] Create cffi bindings for mo
# Work around build failure with Xcode 15.3
# _curses_cffi.c:6795:38: error: incompatible function pointer types assigning to
# 'char *(*)(const char *, ...)' from 'char *(char *, ...)' [-Wincompatible-function-pointer-types]
ENV.append_to_cflags "-Wno-incompatible-function-pointer-types" if DevelopmentTools.clang_build_version >= 1500

# The `tcl-tk` library paths are hardcoded and need to be modified for non-/usr/local prefix
inreplace "lib_pypy/_tkinter/tklib_build.py" do |s|
s.gsub! "/usr/local/opt/tcl-tk/", Formula["tcl-tk"].opt_prefix/""
Expand Down Expand Up @@ -96,12 +98,15 @@ def install
system "tar", "-C", libexec.to_s, "--strip-components", "1", "-xf", "pypy3.tar.bz2"
end

# Move original libexec/bin directory to allow preserving user-installed scripts
libexec.install libexec/"bin" => "pypybin"

# The PyPy binary install instructions suggest installing somewhere
# (like /opt) and symlinking in binaries as needed. Specifically,
# we want to avoid putting PyPy's Python.h somewhere that configure
# scripts will find it.
bin.install_symlink libexec/"bin/pypy#{abi_version}"
lib.install_symlink libexec/"bin"/shared_library("libpypy#{abi_version}-c")
bin.install_symlink libexec/"pypybin/pypy#{abi_version}"
lib.install_symlink libexec/"pypybin"/shared_library("libpypy#{abi_version}-c")
include.install_symlink libexec/"include/pypy#{abi_version}"

if newest_abi_version?
Expand Down Expand Up @@ -135,8 +140,14 @@ def post_install
# Symlink the prefix site-packages into the cellar.
site_packages(libexec).parent.install_symlink site_packages(HOMEBREW_PREFIX)

# Tell distutils-based installers where to put scripts
# Create a scripts folder in the prefix and symlink it as libexec/bin.
# This is needed as setuptools' distutils ignores our distutils.cfg.
# Also create symlinks for original binaries we moved in case they are needed.
scripts_folder.mkpath
libexec.install_symlink scripts_folder => "bin"
scripts_folder.install_symlink (libexec/"pypybin").children

# Tell distutils-based installers where to put scripts
(distutils/"distutils.cfg").atomic_write <<~EOS
[install]
install-scripts=#{scripts_folder}
Expand Down
4 changes: 4 additions & 0 deletions pypi_formula_mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,10 @@
"pyinstaller": {
"extra_packages": ["macholib"]
},
"pypy3.9": {
"package_name": "",
"extra_packages": ["pip", "setuptools"]
},
"pyqt": {
"exclude_packages": [
"PyQt6-3D-Qt6", "PyQt6-Charts-Qt6", "PyQt6-DataVisualization-Qt6",
Expand Down

0 comments on commit fe84f1a

Please sign in to comment.