language/python: add --install-lib to setup_install_args

About 25 formula in homebrew/core pass `--install-lib` to `python3` in
addition to `*setup_install_args` in order to ensure that all files are
installed into the formula's prefix rather than into a `site-packages`
directory in Python's keg.

Let's simplify these formulae by also adding the appropriate
`--install-lib` flag to `setup_install_args`.
This commit is contained in:
Carlo Cabrera 2022-07-09 22:22:10 +08:00
parent 8dd96ae8ba
commit c9af8a632d
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -70,7 +70,7 @@ module Language
quiet_system python, "-c", script quiet_system python, "-c", script
end end
def self.setup_install_args(prefix) def self.setup_install_args(prefix, python = "python3")
shim = <<~PYTHON shim = <<~PYTHON
import setuptools, tokenize import setuptools, tokenize
__file__ = 'setup.py' __file__ = 'setup.py'
@ -84,6 +84,7 @@ module Language
install install
--prefix=#{prefix} --prefix=#{prefix}
--install-scripts=#{prefix}/bin --install-scripts=#{prefix}/bin
--install-lib=#{prefix/site_packages(python)}
--single-version-externally-managed --single-version-externally-managed
--record=installed.txt --record=installed.txt
] ]