Update Homebrew mirror (bottles/casks sync)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
cask "android-platform-tools" do
|
||||
os macos: "darwin", linux: "linux"
|
||||
|
||||
version "37.0.1"
|
||||
sha256 arm: "ee39ad5967e95c2a07f04dbcbde96b1a0c916ba376096db5d2f498b7727a5d1d",
|
||||
x86_64: "ee39ad5967e95c2a07f04dbcbde96b1a0c916ba376096db5d2f498b7727a5d1d",
|
||||
x86_64_linux: "d230f13842f60f782a8645f9c813f8f845bf36089ea7289f28c48f17979313f1",
|
||||
arm64_linux: "d230f13842f60f782a8645f9c813f8f845bf36089ea7289f28c48f17979313f1"
|
||||
|
||||
url "https://homebrew.mirror.ygg/cask/android-platform-tools/platform-tools_r37.0.1-darwin.zip",
|
||||
verified: "google.com/android/repository/"
|
||||
name "Android SDK Platform-Tools"
|
||||
desc "Android SDK component"
|
||||
homepage "https://developer.android.com/tools/releases/platform-tools"
|
||||
|
||||
livecheck do
|
||||
url :homepage
|
||||
regex(/data-text=["']?[^"' >]*?v?(\d+(?:\.\d+)+)["'> (]/i)
|
||||
end
|
||||
|
||||
binary "#{staged_path}/platform-tools/adb"
|
||||
binary "#{staged_path}/platform-tools/etc1tool"
|
||||
binary "#{staged_path}/platform-tools/fastboot"
|
||||
binary "#{staged_path}/platform-tools/hprof-conv"
|
||||
binary "#{staged_path}/platform-tools/make_f2fs"
|
||||
binary "#{staged_path}/platform-tools/make_f2fs_casefold"
|
||||
binary "#{staged_path}/platform-tools/mke2fs"
|
||||
|
||||
# No zap stanza required
|
||||
end
|
||||
@@ -0,0 +1,46 @@
|
||||
cask "macfuse" do
|
||||
version "5.3.3"
|
||||
sha256 "7a0b7b66c0e7f8932707d1215dc9cf486e178d097ae0a2dcdf17d8530566aa15"
|
||||
|
||||
url "https://homebrew.mirror.ygg/cask/macfuse/macfuse-5.3.3.dmg",
|
||||
verified: "github.com/macfuse/macfuse/"
|
||||
name "macFUSE"
|
||||
desc "File system integration"
|
||||
homepage "https://macfuse.github.io/"
|
||||
|
||||
livecheck do
|
||||
url "https://macfuse.github.io/releases/CurrentRelease.plist"
|
||||
strategy :xml do |xml|
|
||||
xml.get_elements("//key[text()='Version']").map { |item| item.next_element&.text&.strip }
|
||||
end
|
||||
end
|
||||
|
||||
auto_updates true
|
||||
conflicts_with cask: "macfuse@dev"
|
||||
depends_on :macos
|
||||
|
||||
pkg "Extras/macFUSE #{version}.pkg"
|
||||
|
||||
postflight_steps do
|
||||
set_ownership ["/usr/local/include", "/usr/local/lib"]
|
||||
end
|
||||
|
||||
uninstall launchctl: [
|
||||
"io.macfuse.app.launchservice.broker",
|
||||
"io.macfuse.app.launchservice.daemon",
|
||||
],
|
||||
pkgutil: [
|
||||
"io.macfuse.installer.components.core",
|
||||
"io.macfuse.installer.components.preferencepane",
|
||||
]
|
||||
|
||||
zap trash: [
|
||||
"/Library/PreferencePanes/macFUSE.prefPane",
|
||||
"~/Library/Caches/io.macfuse.preferencepanes.macfuse",
|
||||
"~/Library/HTTPStorages/io.macfuse.preferencepanes.macfuse",
|
||||
]
|
||||
|
||||
caveats do
|
||||
kext
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,45 @@
|
||||
class Atuin < Formula
|
||||
bottle do
|
||||
root_url "https://homebrew.mirror.ygg/bottles"
|
||||
sha256 cellar: :any_skip_relocation, arm64_tahoe: "2eb11c5b9f67dc155ed426a101029a9445c9c088beb520d8b0b8c3b64accf0f0"
|
||||
sha256 cellar: :any_skip_relocation, arm64_sequoia: "258558bbe65a9c54906ad2487778d369c531dd6d400873944202f7188a1d08b1"
|
||||
sha256 cellar: :any, x86_64_linux: "52891ba9303cfd0159cf625a9600f1e4162de620459a60b452b2b9c1b78cb553"
|
||||
end
|
||||
desc "Improved shell history for zsh, bash, fish and nushell"
|
||||
homepage "https://atuin.sh/"
|
||||
url "https://github.com/atuinsh/atuin/releases/download/v18.19.0/source.tar.gz"
|
||||
sha256 "02fc084a925824f9b8ad899803da4c895341a6ae2fcb585ca8eac4fbe1fb454e"
|
||||
license "MIT"
|
||||
head "https://github.com/atuinsh/atuin.git", branch: "main"
|
||||
|
||||
|
||||
|
||||
depends_on "pkgconf" => :build
|
||||
depends_on "protobuf" => :build
|
||||
depends_on "rust" => :build
|
||||
|
||||
on_linux do
|
||||
depends_on "openssl@3"
|
||||
end
|
||||
|
||||
def install
|
||||
system "cargo", "install", *std_cargo_args(path: "crates/atuin")
|
||||
|
||||
generate_completions_from_executable(bin/"atuin", "gen-completion", "--shell",
|
||||
shells: [:bash, :zsh, :fish, :pwsh])
|
||||
end
|
||||
|
||||
service do
|
||||
run [opt_bin/"atuin", "daemon", "start"]
|
||||
keep_alive true
|
||||
log_path var/"log/atuin.log"
|
||||
error_log_path var/"log/atuin.log"
|
||||
end
|
||||
|
||||
test do
|
||||
# or `atuin init zsh` to setup the `ATUIN_SESSION`
|
||||
ENV["ATUIN_SESSION"] = "random"
|
||||
assert_match "autoload -U add-zsh-hook", shell_output("#{bin}/atuin init zsh")
|
||||
assert shell_output("#{bin}/atuin history list").blank?
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,177 @@
|
||||
class CaCertificates < Formula
|
||||
desc "Mozilla CA certificate store"
|
||||
homepage "https://curl.se/docs/caextract.html"
|
||||
url "https://curl.se/ca/cacert-2026-07-16.pem"
|
||||
sha256 "3ff344e30b9b1ed2971044eabb438a08f2e2245ddb5f8ab1a3ad8b63ab4eaf91"
|
||||
license "MPL-2.0"
|
||||
compatibility_version 1
|
||||
|
||||
livecheck do
|
||||
url :homepage
|
||||
regex(/href=.*?cacert[._-](\d{4}-\d{2}-\d{2})\.pem/i)
|
||||
end
|
||||
|
||||
|
||||
|
||||
def install
|
||||
pkgshare.install "cacert-#{version}.pem" => "cacert.pem"
|
||||
|
||||
post_install = libexec/"post-install"
|
||||
post_install.write <<~'BASH'
|
||||
#!/bin/bash
|
||||
# Build a CA bundle from trusted system and Mozilla certificates.
|
||||
set -euo pipefail
|
||||
shopt -s nullglob
|
||||
|
||||
if [[ "$#" -ne 2 ]]; then
|
||||
echo "usage: post-install SOURCE DESTINATION" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source_file="$1"
|
||||
destination="$2"
|
||||
destination_dir="${destination%/*}"
|
||||
mkdir -p "$destination_dir"
|
||||
|
||||
# Build beside the destination so the final rename cannot expose a partial bundle.
|
||||
work_dir="$(mktemp -d "${destination_dir}/.ca-certificates.XXXXXX")"
|
||||
trap 'rm -rf "$work_dir"' EXIT
|
||||
fingerprints_file="$work_dir/fingerprints"
|
||||
bundle_file="$work_dir/cert.pem"
|
||||
: >"$fingerprints_file"
|
||||
: >"$bundle_file"
|
||||
|
||||
# Split concatenated PEM bundles so each certificate can be validated independently.
|
||||
split_certificates() {
|
||||
local input_file="$1"
|
||||
local output_dir="$2"
|
||||
mkdir -p "$output_dir"
|
||||
awk -v output_dir="$output_dir" '
|
||||
/-----BEGIN CERTIFICATE-----/ {
|
||||
certificate = ""
|
||||
writing_certificate = 1
|
||||
}
|
||||
writing_certificate {
|
||||
certificate = certificate $0 ORS
|
||||
}
|
||||
/-----END CERTIFICATE-----/ && writing_certificate {
|
||||
output_file = output_dir "/" ++certificate_count ".pem"
|
||||
printf "%s", certificate > output_file
|
||||
close(output_file)
|
||||
writing_certificate = 0
|
||||
}
|
||||
' "$input_file"
|
||||
}
|
||||
|
||||
# Track fingerprints while appending to discard malformed and duplicate certificates.
|
||||
append_unique_certificate() {
|
||||
local certificate_file="$1"
|
||||
local openssl_command="$2"
|
||||
local fingerprint
|
||||
fingerprint="$("$openssl_command" x509 -inform pem -fingerprint -sha256 -noout \
|
||||
<"$certificate_file" 2>/dev/null)" || return 0
|
||||
grep -Fqx "$fingerprint" "$fingerprints_file" && return
|
||||
|
||||
printf '%s\n' "$fingerprint" >>"$fingerprints_file"
|
||||
cat "$certificate_file" >>"$bundle_file"
|
||||
printf '\n' >>"$bundle_file"
|
||||
}
|
||||
|
||||
# Append every valid, unique certificate from a PEM bundle.
|
||||
append_bundle() {
|
||||
local input_file="$1"
|
||||
local output_dir="$2"
|
||||
local openssl_command="$3"
|
||||
local certificate_file
|
||||
split_certificates "$input_file" "$output_dir"
|
||||
for certificate_file in "$output_dir"/*.pem; do
|
||||
append_unique_certificate "$certificate_file" "$openssl_command"
|
||||
done
|
||||
}
|
||||
|
||||
# Include only unexpired keychain certificates trusted for server TLS.
|
||||
append_keychain() {
|
||||
local keychain="$1"
|
||||
local purpose="$2"
|
||||
local output_dir="$work_dir/keychain-$purpose"
|
||||
local certificate_file
|
||||
/usr/bin/security find-certificate -a -p "$keychain" >"$work_dir/keychain.pem"
|
||||
split_certificates "$work_dir/keychain.pem" "$output_dir"
|
||||
for certificate_file in "$output_dir"/*.pem; do
|
||||
/usr/bin/openssl x509 -inform pem -checkend 0 -noout <"$certificate_file" &>/dev/null || continue
|
||||
/usr/bin/openssl x509 -inform pem -purpose -noout <"$certificate_file" 2>/dev/null |
|
||||
grep -Fq "SSL server CA : Yes" || continue
|
||||
/usr/bin/security verify-cert -l -L -c "$certificate_file" -p "$purpose" -R offline &>/dev/null ||
|
||||
continue
|
||||
append_unique_certificate "$certificate_file" /usr/bin/openssl
|
||||
done
|
||||
}
|
||||
|
||||
if [[ "$(uname -s)" == "Darwin" ]]; then
|
||||
# Begin with system trust, then append Mozilla certificates not already present.
|
||||
append_keychain "/Library/Keychains/System.keychain" ssl
|
||||
append_keychain "/System/Library/Keychains/SystemRootCertificates.keychain" basic
|
||||
append_bundle "$source_file" "$work_dir/mozilla" /usr/bin/openssl
|
||||
else
|
||||
# Merge the first standard system CA bundle found with the Mozilla bundle.
|
||||
system_bundle=""
|
||||
for candidate in \
|
||||
/etc/ssl/certs/ca-certificates.crt \
|
||||
/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem \
|
||||
/etc/ssl/ca-bundle.pem; do
|
||||
if [[ -f "$candidate" && -r "$candidate" ]]; then
|
||||
system_bundle="$candidate"
|
||||
break
|
||||
fi
|
||||
done
|
||||
openssl_command="$(command -v openssl || true)"
|
||||
if [[ -n "$system_bundle" && -n "$openssl_command" ]]; then
|
||||
append_bundle "$system_bundle" "$work_dir/system" "$openssl_command"
|
||||
append_bundle "$source_file" "$work_dir/mozilla" "$openssl_command"
|
||||
else
|
||||
echo "Cannot find a readable system CA bundle or OpenSSL; using Mozilla certificates only." >&2
|
||||
output_dir="$work_dir/mozilla"
|
||||
split_certificates "$source_file" "$output_dir"
|
||||
for certificate_file in "$output_dir"/*.pem; do
|
||||
cat "$certificate_file" >>"$bundle_file"
|
||||
printf '\n' >>"$bundle_file"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
chmod 0644 "$bundle_file"
|
||||
mv -f "$bundle_file" "$destination"
|
||||
BASH
|
||||
chmod 0755, post_install
|
||||
end
|
||||
|
||||
post_install_steps do
|
||||
run "post-install", args: ["{{pkgshare}}/cacert.pem", "{{pkgetc}}/cert.pem"], base: :libexec
|
||||
end
|
||||
|
||||
def caveats
|
||||
on_macos do
|
||||
<<~EOS
|
||||
CA certificates have been bootstrapped using certificates from the system keychain.
|
||||
EOS
|
||||
end
|
||||
|
||||
on_linux do
|
||||
<<~EOS
|
||||
CA certificates have been bootstrapped from both the Mozilla CA store and the system CA store at
|
||||
one of the following locations, depending on your distro:
|
||||
|
||||
/etc/ssl/certs/ca-certificates.crt # Debian/Ubuntu, Alpine Linux, Arch Linux
|
||||
/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem # RHEL/CentOS/Fedora, Amazon Linux
|
||||
/etc/ssl/ca-bundle.pem # SUSE/openSUSE
|
||||
|
||||
EOS
|
||||
end
|
||||
end
|
||||
|
||||
test do
|
||||
assert_path_exists pkgshare/"cacert.pem"
|
||||
assert_path_exists pkgetc/"cert.pem"
|
||||
assert_match "-----BEGIN CERTIFICATE-----", (pkgetc/"cert.pem").read
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,47 @@
|
||||
class Certifi < Formula
|
||||
desc "Mozilla CA bundle for Python"
|
||||
homepage "https://github.com/certifi/python-certifi"
|
||||
url "https://files.pythonhosted.org/packages/a3/c2/24167ea9858356b47a87a50d39908bfdb72ceeefe0041586e704e5376b3a/certifi-2026.7.22.tar.gz"
|
||||
sha256 "741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55"
|
||||
license "MPL-2.0"
|
||||
compatibility_version 1
|
||||
|
||||
|
||||
|
||||
depends_on "python@3.14" => [:build, :test]
|
||||
depends_on "python@3.12" => :test # keep on oldest python to support (externally managed and not EOL)
|
||||
depends_on "ca-certificates"
|
||||
|
||||
def pythons
|
||||
deps.filter_map { |dep| dep.to_formula if dep.name.start_with?("python@") }
|
||||
end
|
||||
|
||||
def install
|
||||
oldest_python, python = pythons.sort_by(&:version)
|
||||
python_exe = python.opt_libexec/"bin/python"
|
||||
system python_exe, "-m", "pip", "install", *std_pip_args(build_isolation: true), "."
|
||||
|
||||
# Use brewed ca-certificates PEM file instead of the bundled copy
|
||||
site_packages = prefix/Language::Python.site_packages(python_exe)
|
||||
rm site_packages/"certifi/cacert.pem"
|
||||
(site_packages/"certifi").install_symlink Formula["ca-certificates"].pkgetc/"cert.pem" => "cacert.pem"
|
||||
|
||||
python.versioned_formulae.each do |extra_python|
|
||||
next if extra_python.version < oldest_python.version
|
||||
|
||||
# Cannot use Python.site_packages as that requires formula to be installed
|
||||
extra_site_packages = lib/"python#{extra_python.version.major_minor}/site-packages"
|
||||
site_packages.find do |path|
|
||||
(extra_site_packages/path.relative_path_from(site_packages)).dirname.install_symlink path if path.file?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
test do
|
||||
pythons.each do |python|
|
||||
python_exe = python.opt_libexec/"bin/python"
|
||||
output = shell_output("#{python_exe} -m certifi").chomp
|
||||
assert_equal Formula["ca-certificates"].pkgetc/"cert.pem", Pathname(output).realpath
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,59 @@
|
||||
class ClangFormat < Formula
|
||||
bottle do
|
||||
root_url "https://homebrew.mirror.ygg/bottles"
|
||||
sha256 cellar: :any_skip_relocation, arm64_tahoe: "e20d0dbbf9f69f0867b35266ec5c64e2483d2ec9a5275cfe1ae2781cfeb5ad75"
|
||||
sha256 cellar: :any_skip_relocation, arm64_sequoia: "7f943e52e18ec8cfda8ab3174eb733017600af529203e53a3a49443044656f46"
|
||||
sha256 cellar: :any, x86_64_linux: "442dd96bb8ecbc6a01c8c7245ecba01567511b0626dba79a349854a68897fc2f"
|
||||
end
|
||||
desc "Formatting tools for C, C++, Obj-C, Java, JavaScript, TypeScript"
|
||||
homepage "https://clang.llvm.org/docs/ClangFormat.html"
|
||||
url "https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.8/llvm-project-22.1.8.src.tar.xz"
|
||||
sha256 "922f1817a0df7b1489272d18134ee0087a8b068828f87ac63b9861b1a9965888"
|
||||
# The LLVM Project is under the Apache License v2.0 with LLVM Exceptions
|
||||
license "Apache-2.0" => { with: "LLVM-exception" }
|
||||
version_scheme 1
|
||||
head "https://github.com/llvm/llvm-project.git", branch: "main"
|
||||
|
||||
livecheck do
|
||||
url :stable
|
||||
regex(/llvmorg[._-]v?(\d+(?:\.\d+)+)/i)
|
||||
strategy :github_latest
|
||||
end
|
||||
|
||||
|
||||
|
||||
depends_on "cmake" => :build
|
||||
|
||||
uses_from_macos "python"
|
||||
|
||||
on_linux do
|
||||
keg_only "it conflicts with llvm"
|
||||
end
|
||||
|
||||
def install
|
||||
system "cmake", "-S", "llvm", "-B", "build",
|
||||
"-DLLVM_ENABLE_PROJECTS=clang",
|
||||
"-DLLVM_INCLUDE_BENCHMARKS=OFF",
|
||||
*std_cmake_args
|
||||
system "cmake", "--build", "build", "--target", "clang-format"
|
||||
system "cmake", "--install", "build", "--component", "clang-format"
|
||||
end
|
||||
|
||||
test do
|
||||
system "git", "init"
|
||||
system "git", "commit", "--allow-empty", "-m", "initial commit", "--quiet"
|
||||
|
||||
# NB: below C code is messily formatted on purpose.
|
||||
(testpath/"test.c").write <<~C
|
||||
int main(char *args) { \n \t printf("hello"); }
|
||||
C
|
||||
system "git", "add", "test.c"
|
||||
|
||||
assert_equal <<~C, shell_output("#{bin}/clang-format -style=Google test.c")
|
||||
int main(char* args) { printf("hello"); }
|
||||
C
|
||||
|
||||
ENV.prepend_path "PATH", bin
|
||||
assert_match "test.c", shell_output("git clang-format", 1)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,105 @@
|
||||
class Conan < Formula
|
||||
bottle do
|
||||
root_url "https://homebrew.mirror.ygg/bottles"
|
||||
sha256 cellar: :any, arm64_tahoe: "1c472a422807d34bb027626e4cc17e94452dd12956e9b405552f41301a067a50"
|
||||
sha256 cellar: :any, arm64_sequoia: "ff95446f4b646b2abfe32f0a0b64e59ac7620d103439616b6e69fbba3fb2f8c2"
|
||||
sha256 cellar: :any, x86_64_linux: "f01d3988065086768750b731a5a93524ec07826bfc8bc9f5fe13e1a73689cf52"
|
||||
end
|
||||
include Language::Python::Virtualenv
|
||||
|
||||
desc "Distributed, open source, package manager for C/C++"
|
||||
homepage "https://conan.io"
|
||||
url "https://files.pythonhosted.org/packages/f0/2f/f88c73d7042b87924e482cf2081645dfdc4ee4c20071f3d3b4aa08ca2f5e/conan-2.31.2.tar.gz"
|
||||
sha256 "d820e9f5ac44eca1567874f6a7c83586c16a3df5ebca006d9c0c6933fbb375b1"
|
||||
license "MIT"
|
||||
head "https://github.com/conan-io/conan.git", branch: "develop2"
|
||||
|
||||
|
||||
|
||||
depends_on "pkgconf" => :build
|
||||
depends_on "cmake" => :test
|
||||
depends_on "certifi" => :no_linkage
|
||||
depends_on "libyaml"
|
||||
depends_on "python@3.14"
|
||||
|
||||
pypi_packages exclude_packages: "certifi",
|
||||
extra_packages: "distro"
|
||||
|
||||
resource "charset-normalizer" do
|
||||
url "https://files.pythonhosted.org/packages/bd/2a/23f34ec9d04624958e137efdc394888716353190e75f25dd22c7a2c7a8aa/charset_normalizer-3.4.9.tar.gz"
|
||||
sha256 "673611bbd43f0810bec0b0f028ddeaaa501190339cac411f347ac76917c3ae7b"
|
||||
end
|
||||
|
||||
resource "colorama" do
|
||||
url "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz"
|
||||
sha256 "08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"
|
||||
end
|
||||
|
||||
resource "distro" do
|
||||
url "https://files.pythonhosted.org/packages/fc/f8/98eea607f65de6527f8a2e8885fc8015d3e6f5775df186e443e0964a11c3/distro-1.9.0.tar.gz"
|
||||
sha256 "2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed"
|
||||
end
|
||||
|
||||
resource "fasteners" do
|
||||
url "https://files.pythonhosted.org/packages/2d/18/7881a99ba5244bfc82f06017316ffe93217dbbbcfa52b887caa1d4f2a6d3/fasteners-0.20.tar.gz"
|
||||
sha256 "55dce8792a41b56f727ba6e123fcaee77fd87e638a6863cec00007bfea84c8d8"
|
||||
end
|
||||
|
||||
resource "idna" do
|
||||
url "https://files.pythonhosted.org/packages/cd/63/9496c57188a2ee585e0f1db071d75089a11e98aa86eb99d9d7618fc1edce/idna-3.18.tar.gz"
|
||||
sha256 "ffb385a7e039654cef1ab9ef32c6fafe283c0c0467bba1d9029738ce4a14a848"
|
||||
end
|
||||
|
||||
resource "jinja2" do
|
||||
url "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz"
|
||||
sha256 "0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d"
|
||||
end
|
||||
|
||||
resource "markupsafe" do
|
||||
url "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz"
|
||||
sha256 "722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698"
|
||||
end
|
||||
|
||||
resource "patch-ng" do
|
||||
url "https://files.pythonhosted.org/packages/da/b6/8ea8095f964f93567bbe28709298b30104ad418b50d4217538387bf48f7d/patch_ng-1.19.1.tar.gz"
|
||||
sha256 "036a3cc00134ec53f37e92333958ee75e117f2e62a5ec2b85c7122e5e815c29e"
|
||||
end
|
||||
|
||||
resource "python-dateutil" do
|
||||
url "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz"
|
||||
sha256 "37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"
|
||||
end
|
||||
|
||||
resource "pyyaml" do
|
||||
url "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz"
|
||||
sha256 "d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f"
|
||||
end
|
||||
|
||||
resource "requests" do
|
||||
url "https://files.pythonhosted.org/packages/ac/c3/e2a2b89f2d3e2179abd6d00ebd70bff6273f37fb3e0cc209f48b39d00cbf/requests-2.34.2.tar.gz"
|
||||
sha256 "f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed"
|
||||
end
|
||||
|
||||
resource "six" do
|
||||
url "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz"
|
||||
sha256 "ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"
|
||||
end
|
||||
|
||||
resource "urllib3" do
|
||||
url "https://files.pythonhosted.org/packages/53/0c/06f8b233b8fd13b9e5ee11424ef85419ba0d8ba0b3138bf360be2ff56953/urllib3-2.7.0.tar.gz"
|
||||
sha256 "231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c"
|
||||
end
|
||||
|
||||
def install
|
||||
virtualenv_install_with_resources
|
||||
end
|
||||
|
||||
test do
|
||||
system bin/"conan", "profile", "detect"
|
||||
system bin/"conan", "install", "--requires=zlib/1.3.1",
|
||||
"--build=missing",
|
||||
"--lockfile-out=conan.lock"
|
||||
lockfile = JSON.parse(File.read("conan.lock", mode: "r"))
|
||||
refute_predicate lockfile["requires"].select { |req| req.start_with?("zlib/1.3.1") }, :empty?
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,47 @@
|
||||
class Libyaml < Formula
|
||||
bottle do
|
||||
root_url "https://homebrew.mirror.ygg/bottles"
|
||||
sha256 cellar: :any, arm64_tahoe: "5cd5a1875da18599e25283465b2fb8735eb8717ee7158ef17f8f4260205404f2"
|
||||
sha256 cellar: :any, arm64_sequoia: "0ec9bf8082245c008803b42dcae3e6a0c8cd7a67aed589d9b6482b115c0a543b"
|
||||
sha256 cellar: :any_skip_relocation, x86_64_linux: "354677a745b6c62109e792ddbd0cbdaf9e6a471d84fdbde3a7d9bae36d832da8"
|
||||
end
|
||||
desc "YAML Parser"
|
||||
homepage "https://github.com/yaml/libyaml"
|
||||
url "https://github.com/yaml/libyaml/archive/refs/tags/0.2.5.tar.gz"
|
||||
sha256 "fa240dbf262be053f3898006d502d514936c818e422afdcf33921c63bed9bf2e"
|
||||
license "MIT"
|
||||
compatibility_version 1
|
||||
|
||||
livecheck do
|
||||
url :stable
|
||||
strategy :github_latest
|
||||
end
|
||||
|
||||
|
||||
|
||||
depends_on "autoconf" => :build
|
||||
depends_on "automake" => :build
|
||||
depends_on "libtool" => :build
|
||||
|
||||
def install
|
||||
system "./bootstrap"
|
||||
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
|
||||
system "make", "install"
|
||||
end
|
||||
|
||||
test do
|
||||
(testpath/"test.c").write <<~C
|
||||
#include <yaml.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
yaml_parser_t parser;
|
||||
yaml_parser_initialize(&parser);
|
||||
yaml_parser_delete(&parser);
|
||||
return 0;
|
||||
}
|
||||
C
|
||||
system ENV.cc, "test.c", "-L#{lib}", "-lyaml", "-o", "test"
|
||||
system "./test"
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,39 @@
|
||||
class Lz4 < Formula
|
||||
bottle do
|
||||
root_url "https://homebrew.mirror.ygg/bottles"
|
||||
rebuild 1
|
||||
sha256 cellar: :any, arm64_tahoe: "caf14ac1b6c922611db94615341ed6dc97f5601664280bc1d397e10f62e37222"
|
||||
sha256 cellar: :any, arm64_sequoia: "5bd143b7b784989e549637ea4e484af85ba481e640dde69bc35f3843ae25abc6"
|
||||
sha256 cellar: :any, sequoia: "f75cb29a4d25d37e1db38d95c5970cc45de7ec63ce43cfa881a877b424154a42"
|
||||
sha256 cellar: :any_skip_relocation, x86_64_linux: "a8082c2e40dc6d63850f43ea8fa095e55adf18fb0f25ec66bcaee2c4b4438205"
|
||||
end
|
||||
desc "Extremely Fast Compression algorithm"
|
||||
homepage "https://lz4.github.io/lz4/"
|
||||
url "https://github.com/lz4/lz4/archive/refs/tags/v1.10.0.tar.gz"
|
||||
mirror "http://fresh-center.net/linux/misc/lz4-1.10.0.tar.gz"
|
||||
mirror "http://fresh-center.net/linux/misc/legacy/lz4-1.10.0.tar.gz"
|
||||
sha256 "537512904744b35e232912055ccf8ec66d768639ff3abe5788d90d792ec5f48b"
|
||||
license "BSD-2-Clause"
|
||||
head "https://github.com/lz4/lz4.git", branch: "dev"
|
||||
|
||||
livecheck do
|
||||
url :stable
|
||||
strategy :github_latest
|
||||
end
|
||||
|
||||
|
||||
|
||||
def install
|
||||
system "make", "install", "PREFIX=#{prefix}"
|
||||
# Prevent dependents from hardcoding Cellar paths.
|
||||
inreplace lib/"pkgconfig/liblz4.pc", prefix, opt_prefix
|
||||
end
|
||||
|
||||
test do
|
||||
input = "testing compression and decompression"
|
||||
compressed = pipe_output(bin/"lz4", input)
|
||||
refute_empty compressed
|
||||
decompressed = pipe_output("#{bin}/lz4 -d", compressed)
|
||||
assert_equal decompressed, input
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,66 @@
|
||||
class Mpdecimal < Formula
|
||||
bottle do
|
||||
root_url "https://homebrew.mirror.ygg/bottles"
|
||||
sha256 cellar: :any, arm64_tahoe: "518dd69097ceef4b2f5b51603d930d7f5a334237c52b83f8d9822e58c83de172"
|
||||
sha256 cellar: :any, arm64_sequoia: "e21da583e42e86d5a2f0aedfaf7820e51b8af3065da599cff179d1a39903f3ab"
|
||||
sha256 cellar: :any, sequoia: "2d5d6956ca6cafdcd541611c99eed16c0f7a3c7c217efb0141ecfed265716564"
|
||||
sha256 cellar: :any_skip_relocation, x86_64_linux: "f540928b0baae439b6b7bbbb54aa0b0d8fda3631a2fb46c1d1ccd6bf9c2b5389"
|
||||
end
|
||||
desc "Library for decimal floating point arithmetic"
|
||||
homepage "https://www.bytereef.org/mpdecimal/"
|
||||
url "https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-4.0.1.tar.gz"
|
||||
sha256 "96d33abb4bb0070c7be0fed4246cd38416188325f820468214471938545b1ac8"
|
||||
license "BSD-2-Clause"
|
||||
compatibility_version 1
|
||||
|
||||
livecheck do
|
||||
url "https://www.bytereef.org/mpdecimal/download.html"
|
||||
regex(/href=.*?mpdecimal[._-]v?(\d+(?:\.\d+)+)\.t/i)
|
||||
end
|
||||
|
||||
|
||||
|
||||
def install
|
||||
ENV.append "LDFLAGS", "-Wl,-rpath,#{rpath}"
|
||||
ENV.append "LDXXFLAGS", "-Wl,-rpath,#{rpath}"
|
||||
system "./configure", *std_configure_args
|
||||
system "make"
|
||||
system "make", "install"
|
||||
end
|
||||
|
||||
test do
|
||||
(testpath/"test.c").write <<~C
|
||||
#include <assert.h>
|
||||
#include <mpdecimal.h>
|
||||
#include <string.h>
|
||||
|
||||
int main() {
|
||||
mpd_context_t ctx;
|
||||
mpd_t *a, *b, *result;
|
||||
char *rstring;
|
||||
|
||||
mpd_defaultcontext(&ctx);
|
||||
|
||||
a = mpd_new(&ctx);
|
||||
b = mpd_new(&ctx);
|
||||
result = mpd_new(&ctx);
|
||||
|
||||
mpd_set_string(a, "0.1", &ctx);
|
||||
mpd_set_string(b, "0.2", &ctx);
|
||||
mpd_add(result, a, b, &ctx);
|
||||
rstring = mpd_to_sci(result, 1);
|
||||
|
||||
assert(strcmp(rstring, "0.3") == 0);
|
||||
|
||||
mpd_del(a);
|
||||
mpd_del(b);
|
||||
mpd_del(result);
|
||||
mpd_free(rstring);
|
||||
|
||||
return 0;
|
||||
}
|
||||
C
|
||||
system ENV.cc, "test.c", "-o", "test", "-L#{lib}", "-lmpdec"
|
||||
system "./test"
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,192 @@
|
||||
class OpensslAT3 < Formula
|
||||
bottle do
|
||||
root_url "https://homebrew.mirror.ygg/bottles"
|
||||
rebuild 1
|
||||
sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "2d995a1bbbd8e6ee6a9042990dde87e7321d1ddd5716ffee53b140d23cb9f92f"
|
||||
sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "f8b0b5b2eda9321265b7483ce7ea167012c32afed73a127e8e18ebe9f1d9dffe"
|
||||
sha256 cellar: "/usr/local/Cellar", sequoia: "5477285c4ebec45713873ae4002affece39e427c5f1b655c6a3df49c6b90f924"
|
||||
sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "d9996e71b5caa202929fe512179516befeea35e205425beb8a35ed099eb8e47a"
|
||||
end
|
||||
desc "Cryptography and SSL/TLS Toolkit"
|
||||
homepage "https://openssl-library.org"
|
||||
url "https://github.com/openssl/openssl/releases/download/openssl-3.6.3/openssl-3.6.3.tar.gz"
|
||||
mirror "http://fresh-center.net/linux/misc/openssl-3.6.3.tar.gz"
|
||||
mirror "http://deb.debian.org/debian/pool/main/o/openssl/openssl_3.6.3.orig.tar.gz"
|
||||
sha256 "243a86649cf6f23eeb6a2ff2456e09e5d77dd9018a54d3d96b0c6bdd6ba6c7f1"
|
||||
license "Apache-2.0"
|
||||
compatibility_version 1
|
||||
|
||||
livecheck do
|
||||
url "https://openssl-library.org/source/"
|
||||
regex(/href=.*?openssl[._-]v?(3(?:\.\d+)+)\.t/i)
|
||||
end
|
||||
|
||||
|
||||
|
||||
depends_on "ca-certificates" => :no_linkage
|
||||
|
||||
on_linux do
|
||||
resource "Test::Harness" do
|
||||
url "https://cpan.metacpan.org/authors/id/L/LE/LEONT/Test-Harness-3.52.tar.gz"
|
||||
mirror "http://cpan.metacpan.org/authors/id/L/LE/LEONT/Test-Harness-3.52.tar.gz"
|
||||
sha256 "8fe65cfc0261ed3c8a4395f0524286f5719669fe305f9b03b16cf3684d62cd70"
|
||||
end
|
||||
|
||||
resource "Test::More" do
|
||||
url "https://cpan.metacpan.org/authors/id/E/EX/EXODIST/Test-Simple-1.302222.tar.gz"
|
||||
mirror "http://cpan.metacpan.org/authors/id/E/EX/EXODIST/Test-Simple-1.302222.tar.gz"
|
||||
sha256 "7cf84a18d6c9450e53ae8b4de5d5fa32c9fe99f3cebbe408fe59433f19921ec2"
|
||||
end
|
||||
|
||||
resource "ExtUtils::MakeMaker" do
|
||||
url "https://cpan.metacpan.org/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-7.78.tar.gz"
|
||||
mirror "http://cpan.metacpan.org/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-7.78.tar.gz"
|
||||
sha256 "43b33c20f8d82dba7cc48f8cd702f8fc9811e9d07880886dfd31b7077bd4a3a6"
|
||||
end
|
||||
end
|
||||
|
||||
link_overwrite "bin/c_rehash", "bin/openssl", "include/openssl/*"
|
||||
link_overwrite "lib/libcrypto*", "lib/libssl*"
|
||||
link_overwrite "lib/pkgconfig/libcrypto.pc", "lib/pkgconfig/libssl.pc", "lib/pkgconfig/openssl.pc"
|
||||
link_overwrite "share/doc/openssl/*", "share/man/man*/*ssl"
|
||||
|
||||
# Backport commits to avoid test timing failures
|
||||
patch do
|
||||
file "Patches/openssl/9061e9381306a053908177aca8509c262015cdf3.patch"
|
||||
type :backport
|
||||
end
|
||||
patch do
|
||||
file "Patches/openssl/2e2438b494e7f661be5212e4732f7fab86bf6303.patch"
|
||||
type :backport
|
||||
end
|
||||
patch do
|
||||
file "Patches/openssl/ea598f5dd23f1d64d8952e20fcf95d9f3a21d654.patch"
|
||||
type :backport
|
||||
end
|
||||
patch do
|
||||
file "Patches/openssl/cffb97915813aeeef58ee9a0d33c05d3d45e1fe6.patch"
|
||||
type :backport
|
||||
end
|
||||
|
||||
# SSLv2 died with 1.1.0, so no-ssl2 no longer required.
|
||||
# SSLv3 & zlib are off by default with 1.1.0 but this may not
|
||||
# be obvious to everyone, so explicitly state it for now to
|
||||
# help debug inevitable breakage.
|
||||
def configure_args
|
||||
args = %W[
|
||||
--prefix=#{prefix}
|
||||
--openssldir=#{openssldir}
|
||||
--libdir=lib
|
||||
no-ssl3
|
||||
no-ssl3-method
|
||||
no-zlib
|
||||
]
|
||||
on_linux do
|
||||
args += (ENV.cflags || "").split
|
||||
args += (ENV.cppflags || "").split
|
||||
args += (ENV.ldflags || "").split
|
||||
end
|
||||
args
|
||||
end
|
||||
|
||||
def install
|
||||
if OS.linux?
|
||||
ENV.prepend_create_path "PERL5LIB", buildpath/"lib/perl5"
|
||||
ENV.prepend_path "PATH", buildpath/"bin"
|
||||
|
||||
%w[ExtUtils::MakeMaker Test::Harness Test::More].each do |r|
|
||||
resource(r).stage do
|
||||
system "perl", "Makefile.PL", "INSTALL_BASE=#{buildpath}"
|
||||
system "make", "PERL5LIB=#{ENV["PERL5LIB"]}", "CC=#{ENV.cc}"
|
||||
system "make", "install"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# This ensures where Homebrew's Perl is needed the Cellar path isn't
|
||||
# hardcoded into OpenSSL's scripts, causing them to break every Perl update.
|
||||
# Whilst our env points to opt_bin, by default OpenSSL resolves the symlink.
|
||||
ENV["PERL"] = formula_opt_bin("perl")/"perl" if which("perl") == formula_opt_bin("perl")/"perl"
|
||||
|
||||
arch_args = []
|
||||
if OS.mac?
|
||||
arch_args += %W[darwin64-#{Hardware::CPU.arch}-cc enable-ec_nistp_64_gcc_128]
|
||||
elsif Hardware::CPU.intel?
|
||||
arch_args << (Hardware::CPU.is_64_bit? ? "linux-x86_64" : "linux-elf")
|
||||
elsif Hardware::CPU.arm?
|
||||
arch_args << (Hardware::CPU.is_64_bit? ? "linux-aarch64" : "linux-armv4")
|
||||
end
|
||||
|
||||
openssldir.mkpath
|
||||
system "perl", "./Configure", *(configure_args + arch_args)
|
||||
system "make"
|
||||
system "make", "install", "MANDIR=#{man}", "MANSUFFIX=ssl"
|
||||
# AF_ALG support isn't always enabled (e.g. some containers), which breaks the tests.
|
||||
# AF_ALG is a kernel feature and failures are unlikely to be issues with the formula.
|
||||
# `test_quick_tserver` intermittently fails on CI.
|
||||
# It has been reported upstream with no resolution in over a year, so we skip it.
|
||||
system "make", "HARNESS_JOBS=#{ENV.make_jobs}", "test", "TESTS=-test_afalg -test_quic_tserver"
|
||||
|
||||
# Prevent `brew` from pruning the `certs` and `private` directories.
|
||||
touch %w[certs private].map { |subdir| openssldir/subdir/".keepme" }
|
||||
end
|
||||
|
||||
def openssldir = pkgetc
|
||||
|
||||
post_install_steps do
|
||||
symlink "{{etc}}/ca-certificates/cert.pem", "{{pkgetc}}/cert.pem", overwrite: true
|
||||
end
|
||||
|
||||
def caveats
|
||||
<<~EOS
|
||||
To add additional certificates, place .pem files in
|
||||
#{openssldir}/certs
|
||||
|
||||
and run
|
||||
#{opt_bin}/c_rehash
|
||||
|
||||
OpenSSL 3.6 is only supported until 2026-11-01 so the `openssl@3`
|
||||
formula will be downgraded to OpenSSL 3.5 (LTS) in a future update.
|
||||
EOS
|
||||
end
|
||||
|
||||
test do
|
||||
# Make sure the necessary .cnf file exists, otherwise OpenSSL gets moody.
|
||||
assert_path_exists pkgetc/"openssl.cnf", "OpenSSL requires the .cnf file for some functionality"
|
||||
assert_path_exists openssldir/"certs", "OpenSSL throws confusing errors when this directory is missing"
|
||||
|
||||
# Check OpenSSL itself functions as expected.
|
||||
(testpath/"testfile.txt").write("This is a test file")
|
||||
expected_checksum = "e2d0fe1585a63ec6009c8016ff8dda8b17719a637405a4e23c0ff81339148249"
|
||||
system bin/"openssl", "dgst", "-sha256", "-out", "checksum.txt", "testfile.txt"
|
||||
open("checksum.txt") do |f|
|
||||
checksum = f.read(100).split("=").last.strip
|
||||
assert_equal checksum, expected_checksum
|
||||
end
|
||||
|
||||
# Invalid cert from superfish.badssl.com
|
||||
bad_cert = <<~PEM
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIC9TCCAl6gAwIBAgIJAK5EmlK7Klu5MA0GCSqGSIb3DQEBCwUAMFsxGDAWBgNV
|
||||
BAoTD1N1cGVyZmlzaCwgSW5jLjELMAkGA1UEBxMCU0YxCzAJBgNVBAgTAkNBMQsw
|
||||
CQYDVQQGEwJVUzEYMBYGA1UEAxMPU3VwZXJmaXNoLCBJbmMuMB4XDTE4MDUxNjE3
|
||||
MTUyM1oXDTIwMDUxNTE3MTUyM1owajELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNh
|
||||
bGlmb3JuaWExFjAUBgNVBAcMDVNhbiBGcmFuY2lzY28xDzANBgNVBAoMBkJhZFNT
|
||||
TDEdMBsGA1UEAwwUc3VwZXJmaXNoLmJhZHNzbC5jb20wggEiMA0GCSqGSIb3DQEB
|
||||
AQUAA4IBDwAwggEKAoIBAQDCBOz4jO4EwrPYUNVwWMyTGOtcqGhJsCK1+ZWesSss
|
||||
dj5swEtgTEzqsrTAD4C2sPlyyYYC+VxBXRMrf3HES7zplC5QN6ZnHGGM9kFCxUbT
|
||||
Focnn3TrCp0RUiYhc2yETHlV5NFr6AY9SBVSrbMo26r/bv9glUp3aznxJNExtt1N
|
||||
wMT8U7ltQq21fP6u9RXSM0jnInHHwhR6bCjqN0rf6my1crR+WqIW3GmxV0TbChKr
|
||||
3sMPR3RcQSLhmvkbk+atIgYpLrG6SRwMJ56j+4v3QHIArJII2YxXhFOBBcvm/mtU
|
||||
mEAnhccQu3Nw72kYQQdFVXz5ZD89LMOpfOuTGkyG0cqFAgMBAAGjLjAsMAkGA1Ud
|
||||
EwQCMAAwHwYDVR0RBBgwFoIUc3VwZXJmaXNoLmJhZHNzbC5jb20wDQYJKoZIhvcN
|
||||
AQELBQADgYEAKgHH4VD3jfwzxvtWTmIA1nwK+Fjqe9VFXyDwXiBnhqDwJp9J+/2y
|
||||
r7jbXfEKf7WBS6OmnU+HTjxUCFx2ZnA4r7dU5nIsNadKEDVHDOvYEJ6mXHPkrvlt
|
||||
k79iHC0DJiJX36BTXcU649wKEVjgX/kT2yy3YScPdBoN0vtzPN3yFsQ=
|
||||
-----END CERTIFICATE-----
|
||||
PEM
|
||||
output = pipe_output("#{bin}/openssl verify 2>&1", bad_cert, 2)
|
||||
assert_match "verification failed", output
|
||||
refute_match "error:80000002", output
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,549 @@
|
||||
class PythonAT314 < Formula
|
||||
bottle do
|
||||
root_url "https://homebrew.mirror.ygg/bottles"
|
||||
rebuild 1
|
||||
sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "c3246a28c51f4d6478ce24e908cf2c04c1460982f6a2b576b7173734fceb98eb"
|
||||
sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "40cd23ba68c55931f4acce01ccc78bf466fbe87ce34d7b0f15fcdad3782ea204"
|
||||
sha256 cellar: "/usr/local/Cellar", sequoia: "f019b78211cfbdbf5aa253934695f56859e751ab4d41299043ac3baef83d36ae"
|
||||
sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "65459b177976d613314ccaa2ba4f16e9c119f901ed5cbd72172ffc1b6fef1745"
|
||||
end
|
||||
desc "Interpreted, interactive, object-oriented programming language"
|
||||
homepage "https://www.python.org/"
|
||||
url "https://www.python.org/ftp/python/3.14.6/Python-3.14.6.tgz"
|
||||
sha256 "74d0d71d0600e477651a077101d6e62d1e2e69b8e992ba18c993dd643b7ba222"
|
||||
license "Python-2.0"
|
||||
compatibility_version 1
|
||||
|
||||
livecheck do
|
||||
url "https://www.python.org/downloads/source/"
|
||||
regex(%r{href=.*?/Python[._-]v?(3\.14(?:\.\d+)*)\.t}i)
|
||||
end
|
||||
|
||||
|
||||
|
||||
# https://devguide.python.org/versions/#versions
|
||||
deprecate! date: "2030-11-01", because: :deprecated_upstream
|
||||
disable! date: "2031-11-01", because: :deprecated_upstream
|
||||
|
||||
depends_on "pkgconf" => :build
|
||||
depends_on "mpdecimal"
|
||||
depends_on "openssl@3"
|
||||
depends_on "sqlite"
|
||||
depends_on "xz"
|
||||
depends_on "zstd"
|
||||
|
||||
uses_from_macos "bzip2"
|
||||
uses_from_macos "expat", since: :sequoia
|
||||
uses_from_macos "libedit"
|
||||
uses_from_macos "libffi"
|
||||
uses_from_macos "ncurses"
|
||||
|
||||
on_linux do
|
||||
depends_on "zlib-ng-compat"
|
||||
end
|
||||
|
||||
link_overwrite "bin/idle3"
|
||||
link_overwrite "bin/pip3"
|
||||
link_overwrite "bin/pydoc3"
|
||||
link_overwrite "bin/python3"
|
||||
link_overwrite "bin/python3-config"
|
||||
link_overwrite "bin/wheel3"
|
||||
link_overwrite "share/man/man1/python3.1"
|
||||
link_overwrite "lib/libpython3.so"
|
||||
link_overwrite "lib/pkgconfig/python3.pc"
|
||||
link_overwrite "lib/pkgconfig/python3-embed.pc"
|
||||
link_overwrite "lib/python3.14/site-packages/pip*"
|
||||
link_overwrite "lib/python3.14/site-packages/wheel*"
|
||||
link_overwrite "Frameworks/Python.framework/Headers"
|
||||
link_overwrite "Frameworks/Python.framework/Python"
|
||||
link_overwrite "Frameworks/Python.framework/Resources"
|
||||
link_overwrite "Frameworks/Python.framework/Versions/Current"
|
||||
|
||||
pypi_packages package_name: "",
|
||||
extra_packages: %w[flit-core pip wheel]
|
||||
|
||||
resource "flit-core" do
|
||||
url "https://files.pythonhosted.org/packages/69/59/b6fc2188dfc7ea4f936cd12b49d707f66a1cb7a1d2c16172963534db741b/flit_core-3.12.0.tar.gz"
|
||||
sha256 "18f63100d6f94385c6ed57a72073443e1a71a4acb4339491615d0f16d6ff01b2"
|
||||
end
|
||||
|
||||
resource "packaging" do
|
||||
url "https://files.pythonhosted.org/packages/d7/f1/e7a6dd94a8d4a5626c03e4e99c87f241ba9e350cd9e6d75123f992427270/packaging-26.2.tar.gz"
|
||||
sha256 "ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661"
|
||||
end
|
||||
|
||||
resource "pip" do
|
||||
url "https://files.pythonhosted.org/packages/01/91/47e7d486260f618783899587af63ccf7980fb60245c3e63dd4571c6b57ad/pip-26.1.2.tar.gz"
|
||||
sha256 "f49cd134c61cf2fd75e0ce2676db03e4054504a5a4986d00f8299ae632dc4605"
|
||||
end
|
||||
|
||||
resource "wheel" do
|
||||
url "https://files.pythonhosted.org/packages/39/62/75f18a0f03b4219c456652c7780e4d749b929eb605c098ce3a5b6b6bc081/wheel-0.47.0.tar.gz"
|
||||
sha256 "cc72bd1009ba0cf63922e28f94d9d83b920aa2bb28f798a31d0691b02fa3c9b3"
|
||||
end
|
||||
|
||||
# Modify default sysconfig to match the brew install layout.
|
||||
# Remove when a non-patching mechanism is added.
|
||||
# We (ab)use osx_framework_library to exploit pip behaviour to allow --prefix to still work.
|
||||
patch do
|
||||
file "Patches/python/3.13-sysconfig.diff"
|
||||
type :unofficial
|
||||
resolves "https://bugs.python.org/issue43976"
|
||||
end
|
||||
|
||||
def lib_cellar
|
||||
on_macos do
|
||||
return frameworks/"Python.framework/Versions"/version.major_minor/"lib/python#{version.major_minor}"
|
||||
end
|
||||
on_linux do
|
||||
return lib/"python#{version.major_minor}"
|
||||
end
|
||||
end
|
||||
|
||||
def site_packages_cellar = lib_cellar/"site-packages"
|
||||
|
||||
# The HOMEBREW_PREFIX location of site-packages.
|
||||
def site_packages = HOMEBREW_PREFIX/"lib/python#{version.major_minor}/site-packages"
|
||||
|
||||
def altinstall? = name != Formula["python3"].name
|
||||
|
||||
def python3 = bin/"python#{version.major_minor}"
|
||||
|
||||
deny_network_access!
|
||||
|
||||
def install
|
||||
# Unset these so that installing pip and setuptools puts them where we want
|
||||
# and not into some other Python the user has installed.
|
||||
ENV["PYTHONHOME"] = nil
|
||||
ENV["PYTHONPATH"] = nil
|
||||
|
||||
# Override the auto-detection of libmpdec, which assumes a universal build.
|
||||
# This is currently an inreplace due to https://github.com/python/cpython/issues/98557.
|
||||
if OS.mac?
|
||||
inreplace "configure", "libmpdec_machine=universal",
|
||||
"libmpdec_machine=#{ENV["PYTHON_DECIMAL_WITH_MACHINE"] = Hardware::CPU.arm? ? "uint128" : "x64"}"
|
||||
end
|
||||
|
||||
# The --enable-optimization and --with-lto flags diverge from what upstream
|
||||
# python does for their macOS binary releases. They have chosen not to apply
|
||||
# these flags because they want one build that will work across many macOS
|
||||
# releases. Homebrew is not so constrained because the bottling
|
||||
# infrastructure specializes for each macOS major release.
|
||||
args = %W[
|
||||
--prefix=#{prefix}
|
||||
--enable-ipv6
|
||||
--datarootdir=#{share}
|
||||
--datadir=#{share}
|
||||
--without-ensurepip
|
||||
--enable-loadable-sqlite-extensions
|
||||
--with-openssl=#{formula_opt_prefix("openssl@3")}
|
||||
--enable-optimizations
|
||||
--with-system-expat
|
||||
--with-system-libmpdec
|
||||
--with-readline=editline
|
||||
]
|
||||
|
||||
# Python re-uses flags when building native modules.
|
||||
# Since we don't want native modules prioritizing the brew
|
||||
# include path, we move them to [C|LD]FLAGS_NODIST.
|
||||
# Note: Changing CPPFLAGS causes issues with dbm, so we
|
||||
# leave it as-is.
|
||||
cflags = []
|
||||
cflags_nodist = ["-I#{HOMEBREW_PREFIX}/include"]
|
||||
ldflags = []
|
||||
ldflags_nodist = ["-L#{HOMEBREW_PREFIX}/lib", "-Wl,-rpath,#{HOMEBREW_PREFIX}/lib"]
|
||||
cppflags = ["-I#{HOMEBREW_PREFIX}/include"]
|
||||
|
||||
if OS.mac?
|
||||
# Enabling LTO on Linux makes libpython3.*.a unusable for anyone whose GCC
|
||||
# install does not match the one in CI _exactly_ (major and minor version).
|
||||
# https://github.com/orgs/Homebrew/discussions/3734
|
||||
args << "--with-lto"
|
||||
args << "--enable-framework=#{frameworks}"
|
||||
args << "--with-dtrace"
|
||||
args << "--with-dbmliborder=ndbm"
|
||||
|
||||
# Avoid linking to libgcc https://mail.python.org/pipermail/python-dev/2012-February/116205.html
|
||||
args << "MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}"
|
||||
else
|
||||
args << "--enable-shared"
|
||||
args << "--with-dbmliborder="
|
||||
end
|
||||
|
||||
# Allow python modules to use ctypes.find_library to find homebrew's stuff
|
||||
# even if homebrew is not a /usr/local/lib. Try this with:
|
||||
# `brew install enchant && pip install pyenchant`
|
||||
inreplace "./Lib/ctypes/macholib/dyld.py" do |f|
|
||||
f.gsub! "DEFAULT_LIBRARY_FALLBACK = [",
|
||||
"DEFAULT_LIBRARY_FALLBACK = [ '#{HOMEBREW_PREFIX}/lib', '#{formula_opt_lib("openssl@3")}',"
|
||||
f.gsub! "DEFAULT_FRAMEWORK_FALLBACK = [", "DEFAULT_FRAMEWORK_FALLBACK = [ '#{HOMEBREW_PREFIX}/Frameworks',"
|
||||
end
|
||||
|
||||
args << "CFLAGS=#{cflags.join(" ")}" unless cflags.empty?
|
||||
args << "CFLAGS_NODIST=#{cflags_nodist.join(" ")}" unless cflags_nodist.empty?
|
||||
args << "LDFLAGS=#{ldflags.join(" ")}" unless ldflags.empty?
|
||||
args << "LDFLAGS_NODIST=#{ldflags_nodist.join(" ")}" unless ldflags_nodist.empty?
|
||||
args << "CPPFLAGS=#{cppflags.join(" ")}" unless cppflags.empty?
|
||||
|
||||
# Disabled modules - provided in separate formulae
|
||||
args += %w[
|
||||
py_cv_module__tkinter=n/a
|
||||
]
|
||||
|
||||
system "./configure", *args
|
||||
system "make"
|
||||
|
||||
ENV.deparallelize do
|
||||
# The `altinstall` target prevents the installation of files with only Python's major
|
||||
# version in its name. This allows us to link multiple versioned Python formulae.
|
||||
# https://github.com/python/cpython#installing-multiple-versions
|
||||
#
|
||||
# Tell Python not to install into /Applications (default for framework builds)
|
||||
target = "#{"alt" if altinstall?}install"
|
||||
system "make", target, "PYTHONAPPSDIR=#{prefix}"
|
||||
system "make", "frameworkinstallextras", "PYTHONAPPSDIR=#{pkgshare}" if OS.mac?
|
||||
end
|
||||
|
||||
if OS.mac?
|
||||
# Any .app get a " 3" attached, so it does not conflict with python 2.x.
|
||||
prefix.glob("*.app") { |app| mv app, app.to_s.sub(/\.app$/, " 3.app") }
|
||||
|
||||
pc_dir = frameworks/"Python.framework/Versions"/version.major_minor/"lib/pkgconfig"
|
||||
# Symlink the pkgconfig files into HOMEBREW_PREFIX so they're accessible.
|
||||
(lib/"pkgconfig").install_symlink pc_dir.children
|
||||
|
||||
# Prevent third-party packages from building against fragile Cellar paths
|
||||
bad_cellar_path_files = [
|
||||
lib_cellar/"_sysconfigdata__darwin_darwin.py",
|
||||
lib_cellar/"_sysconfig_vars__darwin_darwin.json",
|
||||
lib_cellar/"config-#{version.major_minor}-darwin/Makefile",
|
||||
pc_dir/"python-#{version.major_minor}.pc",
|
||||
pc_dir/"python-#{version.major_minor}-embed.pc",
|
||||
]
|
||||
inreplace bad_cellar_path_files, prefix, opt_prefix
|
||||
|
||||
# Help third-party packages find the Python framework
|
||||
inreplace lib_cellar/"config-#{version.major_minor}-darwin/Makefile",
|
||||
/^LINKFORSHARED=(.*)PYTHONFRAMEWORKDIR(.*)/,
|
||||
"LINKFORSHARED=\\1PYTHONFRAMEWORKINSTALLDIR\\2"
|
||||
|
||||
# Symlink the pkgconfig files into HOMEBREW_PREFIX so they're accessible.
|
||||
(lib/"pkgconfig").install_symlink pc_dir.children
|
||||
|
||||
# Fix for https://github.com/Homebrew/homebrew-core/issues/21212
|
||||
inreplace lib_cellar/"_sysconfigdata__darwin_darwin.py",
|
||||
%r{('LINKFORSHARED': .*?) (Python.framework/Versions/3.\d+/Python)'}m,
|
||||
"\\1 #{opt_prefix}/Frameworks/\\2'"
|
||||
|
||||
# For an altinstall, remove symlinks that conflict with the main Python formula.
|
||||
rm frameworks.glob("Python.framework/{Headers,Python,Resources,Versions/Current}") if altinstall?
|
||||
else
|
||||
# Prevent third-party packages from building against fragile Cellar paths
|
||||
inreplace Dir[lib_cellar/"**/_sysconfigdata_*linux_x86_64-*.py",
|
||||
lib_cellar/"config*/Makefile",
|
||||
bin/"python#{version.major_minor}-config",
|
||||
lib/"pkgconfig/python-3*.pc"],
|
||||
prefix, opt_prefix
|
||||
|
||||
inreplace bin/"python#{version.major_minor}-config",
|
||||
'prefix_real=$(installed_prefix "$0")',
|
||||
"prefix_real=#{opt_prefix}"
|
||||
|
||||
# For an altinstall, remove symlinks that conflict with the main Python formula.
|
||||
rm lib/"libpython3.so" if altinstall?
|
||||
end
|
||||
|
||||
# Remove the site-packages that Python created in its Cellar.
|
||||
rm_r site_packages_cellar.children
|
||||
|
||||
# Prepare a wheel of wheel to install later.
|
||||
common_pip_args = %w[
|
||||
-v
|
||||
--no-deps
|
||||
--no-binary :all:
|
||||
--no-index
|
||||
--no-build-isolation
|
||||
]
|
||||
whl_build = buildpath/"whl_build"
|
||||
system python3, "-m", "venv", whl_build
|
||||
%w[flit-core wheel].each do |r|
|
||||
resource(r).stage do
|
||||
system whl_build/"bin/pip3", "install", *common_pip_args, "."
|
||||
end
|
||||
end
|
||||
resource("wheel").stage do
|
||||
system whl_build/"bin/pip3", "wheel", *common_pip_args,
|
||||
"--wheel-dir=#{libexec}",
|
||||
"."
|
||||
end
|
||||
|
||||
# Replace bundled pip with our own.
|
||||
rm lib_cellar.glob("ensurepip/_bundled/pip-*.whl")
|
||||
resource("pip").stage do
|
||||
system whl_build/"bin/pip3", "wheel", *common_pip_args,
|
||||
"--wheel-dir=#{lib_cellar}/ensurepip/_bundled",
|
||||
"."
|
||||
end
|
||||
|
||||
# Patch ensurepip to bootstrap our updated version of pip
|
||||
inreplace lib_cellar/"ensurepip/__init__.py" do |s|
|
||||
s.gsub!(/_PIP_VERSION = .*/, "_PIP_VERSION = \"#{resource("pip").version}\"")
|
||||
end
|
||||
|
||||
# Ensure that our new pip wheel is globally readable.
|
||||
chmod "ugo+r", lib_cellar.glob("ensurepip/_bundled/pip-*.whl")
|
||||
|
||||
# Install unversioned (and for an altinstall, major-versioned) symlinks in libexec/bin.
|
||||
{
|
||||
"idle" => "idle#{version.major_minor}",
|
||||
"pydoc" => "pydoc#{version.major_minor}",
|
||||
"python" => "python#{version.major_minor}",
|
||||
"python-config" => "python#{version.major_minor}-config",
|
||||
}.merge(altinstall? ? {
|
||||
"idle3" => "idle#{version.major_minor}",
|
||||
"pydoc3" => "pydoc#{version.major_minor}",
|
||||
"python3" => "python#{version.major_minor}",
|
||||
"python3-config" => "python#{version.major_minor}-config",
|
||||
} : {}).each do |short_name, long_name|
|
||||
(libexec/"bin").install_symlink (bin/long_name).realpath => short_name
|
||||
end
|
||||
|
||||
# Bootstrap initial install of pip.
|
||||
system python3, "-Im", "ensurepip"
|
||||
|
||||
# Install desired versions of pip, wheel using the version of
|
||||
# pip bootstrapped by ensurepip.
|
||||
# Note that while we replaced the ensurepip wheels, there's no guarantee
|
||||
# ensurepip actually used them, since other existing installations could
|
||||
# have been picked up (and we can't pass --ignore-installed).
|
||||
root_site_packages = lib/"python#{version.major_minor}/site-packages"
|
||||
bundled = lib_cellar/"ensurepip/_bundled"
|
||||
system python3, "-Im", "pip", "install", "-v",
|
||||
"--no-deps",
|
||||
"--no-index",
|
||||
"--upgrade",
|
||||
"--isolated",
|
||||
"--target=#{root_site_packages}",
|
||||
bundled/"pip-#{resource("pip").version}-py3-none-any.whl",
|
||||
libexec/"wheel-#{resource("wheel").version}-py3-none-any.whl"
|
||||
|
||||
# pip install with --target flag will just place the bin folder into the
|
||||
# target, so move its contents into the appropriate location
|
||||
mv (root_site_packages/"bin").children, bin
|
||||
rmdir root_site_packages/"bin"
|
||||
|
||||
rm bin/"pip"
|
||||
rm bin/"pip3" if altinstall?
|
||||
mv bin/"wheel", bin/"wheel#{version.major_minor}"
|
||||
bin.install_symlink "wheel#{version.major_minor}" => "wheel3" unless altinstall?
|
||||
|
||||
# Install unversioned (and for an altinstall, major-versioned) symlinks in libexec/bin.
|
||||
{
|
||||
"pip" => "pip#{version.major_minor}",
|
||||
"wheel" => "wheel#{version.major_minor}",
|
||||
}.merge(altinstall? ? {
|
||||
"pip3" => "pip#{version.major_minor}",
|
||||
"wheel3" => "wheel#{version.major_minor}",
|
||||
} : {}).each do |short_name, long_name|
|
||||
(libexec/"bin").install_symlink (bin/long_name).realpath => short_name
|
||||
end
|
||||
|
||||
if OS.mac?
|
||||
# Replace framework site-packages with a symlink to the real one.
|
||||
rm_r site_packages_cellar
|
||||
site_packages_cellar.parent.install_symlink root_site_packages
|
||||
end
|
||||
|
||||
# Write out sitecustomize.py
|
||||
(lib_cellar/"sitecustomize.py").atomic_write(sitecustomize)
|
||||
|
||||
# Mark Homebrew python as externally managed: https://peps.python.org/pep-0668/#marking-an-interpreter-as-using-an-external-package-manager
|
||||
# Placed after ensurepip since it invokes pip in isolated mode, meaning
|
||||
# we can't pass --break-system-packages.
|
||||
(lib_cellar/"EXTERNALLY-MANAGED").write <<~INI
|
||||
[externally-managed]
|
||||
Error=To install Python packages system-wide, try brew install
|
||||
xyz, where xyz is the package you are trying to
|
||||
install.
|
||||
|
||||
If you wish to install a Python library that isn't in Homebrew,
|
||||
use a virtual environment:
|
||||
|
||||
python3 -m venv path/to/venv
|
||||
source path/to/venv/bin/activate
|
||||
python3 -m pip install xyz
|
||||
|
||||
If you wish to install a Python application that isn't in Homebrew,
|
||||
it may be easiest to use 'pipx install xyz', which will manage a
|
||||
virtual environment for you. You can install pipx with
|
||||
|
||||
brew install pipx
|
||||
|
||||
You may restore the old behavior of pip by passing
|
||||
the '--break-system-packages' flag to pip, or by adding
|
||||
'break-system-packages = true' to your pip.conf file. The latter
|
||||
will permanently disable this error.
|
||||
|
||||
If you disable this error, we STRONGLY recommend that you additionally
|
||||
pass the '--user' flag to pip, or set 'user = true' in your pip.conf
|
||||
file. Failure to do this can result in a broken Homebrew installation.
|
||||
|
||||
Read more about this behavior here: <https://peps.python.org/pep-0668/>
|
||||
INI
|
||||
end
|
||||
|
||||
post_install_steps do
|
||||
on_macos do
|
||||
set_permissions "Python.framework/Versions/{{version.major_minor}}/" \
|
||||
"lib/python{{version.major_minor}}/venv/scripts/**/*",
|
||||
"u+w", base: :frameworks, recursive: false
|
||||
end
|
||||
on_linux do
|
||||
set_permissions "python{{version.major_minor}}/venv/scripts/**/*", "u+w", base: :lib, recursive: false
|
||||
end
|
||||
end
|
||||
|
||||
def sitecustomize
|
||||
<<~PYTHON
|
||||
# This file is created by Homebrew and is executed on each python startup.
|
||||
# Don't print from here, or else python command line scripts may fail!
|
||||
# <https://docs.brew.sh/Homebrew-and-Python>
|
||||
import re
|
||||
import os
|
||||
import site
|
||||
import sys
|
||||
if sys.version_info[:2] != (#{version.major}, #{version.minor}):
|
||||
# This can only happen if the user has set the PYTHONPATH to a mismatching site-packages directory.
|
||||
# Every Python looks at the PYTHONPATH variable and we can't fix it here in sitecustomize.py,
|
||||
# because the PYTHONPATH is evaluated after the sitecustomize.py. Many modules (e.g. PyQt4) are
|
||||
# built only for a specific version of Python and will fail with cryptic error messages.
|
||||
# In the end this means: Don't set the PYTHONPATH permanently if you use different Python versions.
|
||||
exit(f'Your PYTHONPATH points to a site-packages dir for Python #{version.major_minor} '
|
||||
f'but you are running Python {sys.version_info[0]}.{sys.version_info[1]}!\\n'
|
||||
f' PYTHONPATH is currently: "{os.environ["PYTHONPATH"]}"\\n'
|
||||
f' You should `unset PYTHONPATH` to fix this.')
|
||||
# Only do this for a brewed python:
|
||||
if os.path.realpath(sys.executable).startswith('#{rack}'):
|
||||
# Shuffle /Library site-packages to the end of sys.path
|
||||
library_site = '/Library/Python/#{version.major_minor}/site-packages'
|
||||
library_packages = [p for p in sys.path if p.startswith(library_site)]
|
||||
sys.path = [p for p in sys.path if not p.startswith(library_site)]
|
||||
# .pth files have already been processed so don't use addsitedir
|
||||
sys.path.extend(library_packages)
|
||||
# the Cellar site-packages is a symlink to the HOMEBREW_PREFIX
|
||||
# site_packages; prefer the shorter paths
|
||||
long_prefix = re.compile(r'#{rack}/[0-9\\._abrc]+/(?:Frameworks/Python\\.framework/Versions/#{version.major_minor}/)?lib/python#{version.major_minor}/site-packages')
|
||||
sys.path = [long_prefix.sub('#{site_packages}', p) for p in sys.path]
|
||||
# Set the sys.executable to use the opt_prefix. Only do this if PYTHONEXECUTABLE is not
|
||||
# explicitly set and we are not in a virtualenv:
|
||||
if 'PYTHONEXECUTABLE' not in os.environ and sys.prefix == sys.base_prefix:
|
||||
sys.executable = sys._base_executable = '#{opt_bin}/python#{version.major_minor}'
|
||||
if 'PYTHONHOME' not in os.environ:
|
||||
cellar_prefix = re.compile(r'#{rack}/[0-9\\._abrc]+(?=/|$)')
|
||||
if os.path.realpath(sys.base_prefix).startswith('#{rack}'):
|
||||
new_prefix = cellar_prefix.sub('#{opt_prefix}', sys.base_prefix)
|
||||
site.PREFIXES[:] = [new_prefix if x == sys.base_prefix else x for x in site.PREFIXES]
|
||||
if sys.prefix == sys.base_prefix:
|
||||
sys.prefix = new_prefix
|
||||
sys.base_prefix = new_prefix
|
||||
if os.path.realpath(sys.base_exec_prefix).startswith('#{rack}'):
|
||||
new_exec_prefix = cellar_prefix.sub('#{opt_prefix}', sys.base_exec_prefix)
|
||||
site.PREFIXES[:] = [new_exec_prefix if x == sys.base_exec_prefix else x for x in site.PREFIXES]
|
||||
if sys.exec_prefix == sys.base_exec_prefix:
|
||||
sys.exec_prefix = new_exec_prefix
|
||||
sys.base_exec_prefix = new_exec_prefix
|
||||
# Make site.getsitepackages() return the HOMEBREW_PREFIX site-packages,
|
||||
# but only if we are outside a venv or in one with include-system-site-packages.
|
||||
if sys.base_prefix in site.PREFIXES:
|
||||
site.PREFIXES.insert(site.PREFIXES.index(sys.base_prefix), '#{HOMEBREW_PREFIX}')
|
||||
site.addsitedir('#{site_packages}')
|
||||
# Check for and add the prefix of split Python formulae.
|
||||
for split_module in ["tk", "gdbm"]:
|
||||
split_prefix = f"#{HOMEBREW_PREFIX}/opt/python-{split_module}@#{version.major_minor}/libexec"
|
||||
if os.path.isdir(split_prefix):
|
||||
sys.path.append(split_prefix)
|
||||
PYTHON
|
||||
end
|
||||
|
||||
def caveats
|
||||
dbm_is = "`dbm.gnu` is"
|
||||
on_linux do
|
||||
dbm_is = "`dbm.gnu` and `dbm.ndbm` are"
|
||||
end
|
||||
|
||||
<<~EOS
|
||||
Python is installed as
|
||||
#{HOMEBREW_PREFIX}/bin/python3
|
||||
|
||||
Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
|
||||
`python3`, `python3-config`, `pip3` etc., respectively, are installed into
|
||||
#{opt_libexec}/bin
|
||||
|
||||
`idle#{version.major_minor}` requires tkinter, which is available separately:
|
||||
brew install python-tk@#{version.major_minor}
|
||||
|
||||
#{dbm_is} available separately:
|
||||
brew install python-gdbm@#{version.major_minor}
|
||||
|
||||
For more information about Homebrew and Python, see: https://docs.brew.sh/Homebrew-and-Python
|
||||
EOS
|
||||
end
|
||||
|
||||
test do
|
||||
# Check if sqlite is ok, because we build with --enable-loadable-sqlite-extensions
|
||||
# and it can occur that building sqlite silently fails if OSX's sqlite is used.
|
||||
system python3, "-c", "import sqlite3"
|
||||
|
||||
# check to see if we can create a venv
|
||||
system python3, "-m", "venv", testpath/"myvenv"
|
||||
|
||||
# Check if some other modules import. Then the linked libs are working.
|
||||
system python3, "-c", "import _ctypes"
|
||||
system python3, "-c", "import _decimal"
|
||||
system python3, "-c", "import pyexpat"
|
||||
system python3, "-c", "import readline"
|
||||
system python3, "-c", "import zlib"
|
||||
system python3, "-c", "import _zstd"
|
||||
|
||||
# tkinter is provided in a separate formula
|
||||
assert_match "ModuleNotFoundError: No module named '_tkinter'",
|
||||
shell_output("#{python3} -Sc 'import tkinter' 2>&1", 1)
|
||||
|
||||
# gdbm is provided in a separate formula
|
||||
assert_match "ModuleNotFoundError: No module named '_gdbm'",
|
||||
shell_output("#{python3} -Sc 'import _gdbm' 2>&1", 1)
|
||||
assert_match "ModuleNotFoundError: No module named '_gdbm'",
|
||||
shell_output("#{python3} -Sc 'import dbm.gnu' 2>&1", 1)
|
||||
|
||||
# Verify that the selected DBM interface works on macOS.
|
||||
# Linux requires installing python-gdbm formula
|
||||
(testpath/"dbm_test.py").write <<~PYTHON
|
||||
import dbm
|
||||
|
||||
with dbm.ndbm.open("test", "c") as db:
|
||||
db[b"foo \\xbd"] = b"bar \\xbd"
|
||||
with dbm.ndbm.open("test", "r") as db:
|
||||
assert list(db.keys()) == [b"foo \\xbd"]
|
||||
assert b"foo \\xbd" in db
|
||||
assert db[b"foo \\xbd"] == b"bar \\xbd"
|
||||
PYTHON
|
||||
system python3, "dbm_test.py" if OS.mac?
|
||||
|
||||
system bin/"pip#{version.major_minor}", "list", "--format=columns"
|
||||
|
||||
# Check our sitecustomize.py
|
||||
assert_match HOMEBREW_CELLAR.to_s, shell_output("#{python3} -Sc 'import sys; print(sys.base_prefix)'")
|
||||
refute_match HOMEBREW_CELLAR.to_s, shell_output("#{python3} -c 'import sys; print(sys.base_prefix)'")
|
||||
refute_match site_packages_cellar.to_s, shell_output("#{python3} -c 'import sys; print(sys.path)'")
|
||||
|
||||
# Verify our sysconfig patches
|
||||
sysconfig_path = "import sysconfig; print(sysconfig.get_paths(\"osx_framework_library\")[\"data\"])"
|
||||
assert_equal HOMEBREW_PREFIX.to_s, shell_output("#{python3} -c '#{sysconfig_path}'").strip
|
||||
linkforshared_var = "import sysconfig; print(sysconfig.get_config_var(\"LINKFORSHARED\"))"
|
||||
assert_match opt_prefix.to_s, shell_output("#{python3} -c '#{linkforshared_var}'") if OS.mac?
|
||||
|
||||
# Check our externally managed marker
|
||||
assert_match "If you wish to install a Python library",
|
||||
shell_output("#{python3} -m pip install pip 2>&1", 1)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,112 @@
|
||||
class Readline < Formula
|
||||
bottle do
|
||||
root_url "https://homebrew.mirror.ygg/bottles"
|
||||
sha256 cellar: :any, arm64_tahoe: "1c6234c033c83ea742d50aa45fd60821947fa800d5cadecb0a1aa045564bb7d1"
|
||||
sha256 cellar: :any, arm64_sequoia: "2e055f7b620fcbe1f809e850a23a68daa429edcf9b484b1967f9a49d89ebed8e"
|
||||
sha256 cellar: :any, sequoia: "fd72a581442e1826e1386b8620e6ca5b75d858ded59d9fe60b9e0e9001675dc3"
|
||||
sha256 cellar: :any_skip_relocation, x86_64_linux: "ea989e13a1df95ab899b8b1d35713def4330950259e7a48053fcd7967ee316b2"
|
||||
end
|
||||
desc "Library for command-line editing"
|
||||
homepage "https://tiswww.case.edu/php/chet/readline/rltop.html"
|
||||
url "https://ftpmirror.gnu.org/gnu/readline/readline-8.3.tar.gz"
|
||||
mirror "https://ftp.gnu.org/gnu/readline/readline-8.3.tar.gz"
|
||||
version "8.3.3"
|
||||
sha256 "fe5383204467828cd495ee8d1d3c037a7eba1389c22bc6a041f627976f9061cc"
|
||||
license "GPL-3.0-or-later"
|
||||
|
||||
# Add new patches using this format:
|
||||
#
|
||||
# patch_checksum_pairs = %w[
|
||||
# 001 <checksum for <major>.<minor>.1>
|
||||
# 002 <checksum for <major>.<minor>.2>
|
||||
# ...
|
||||
# ]
|
||||
|
||||
patch_checksum_pairs = %w[
|
||||
001 21f0a03106dbe697337cd25c70eb0edbaa2bdb6d595b45f83285cdd35bac84de
|
||||
002 e27364396ba9f6debf7cbaaf1a669e2b2854241ae07f7eca74ca8a8ba0c97472
|
||||
003 72dee13601ce38f6746eb15239999a7c56f8e1ff5eb1ec8153a1f213e4acdb29
|
||||
]
|
||||
|
||||
patch_checksum_pairs.each_slice(2) do |p, checksum|
|
||||
patch :p0 do
|
||||
url "https://ftpmirror.gnu.org/gnu/readline/readline-8.3-patches/readline83-#{p}"
|
||||
mirror "https://ftp.gnu.org/gnu/readline/readline-8.3-patches/readline83-#{p}"
|
||||
sha256 checksum
|
||||
type :cherry_pick
|
||||
end
|
||||
end
|
||||
compatibility_version 1
|
||||
|
||||
# We're not using `url :stable` here because we need `url` to be a string
|
||||
# when we use it in the `strategy` block.
|
||||
livecheck do
|
||||
url :stable
|
||||
regex(/href=.*?readline[._-]v?(\d+(?:\.\d+)+)\.t/i)
|
||||
strategy :gnu do |page, regex|
|
||||
# Match versions from files
|
||||
versions = page.scan(regex)
|
||||
.flatten
|
||||
.uniq
|
||||
.map { |v| Version.new(v) }
|
||||
.sort
|
||||
next versions if versions.blank?
|
||||
|
||||
# Assume the last-sorted version is newest
|
||||
newest_version = versions.last
|
||||
|
||||
# Simply return the found versions if there isn't a patches directory
|
||||
# for the "newest" version
|
||||
patches_directory = page.match(%r{href=.*?(readline[._-]v?#{newest_version.major_minor}[._-]patches/?)["' >]}i)
|
||||
next versions if patches_directory.blank?
|
||||
|
||||
# Fetch the page for the patches directory
|
||||
patches_page = Homebrew::Livecheck::Strategy.page_content(
|
||||
"https://ftpmirror.gnu.org/gnu/readline/#{patches_directory[1]}",
|
||||
)
|
||||
next versions if patches_page[:content].blank?
|
||||
|
||||
# Generate additional major.minor.patch versions from the patch files in
|
||||
# the directory and add those to the versions array
|
||||
patches_page[:content].scan(/href=.*?readline[._-]?v?\d+(?:\.\d+)*[._-]0*(\d+)["' >]/i).each do |match|
|
||||
versions << "#{newest_version.major_minor}.#{match[0]}"
|
||||
end
|
||||
|
||||
versions
|
||||
end
|
||||
end
|
||||
|
||||
no_autobump! because: :incompatible_version_format
|
||||
|
||||
|
||||
|
||||
keg_only :shadowed_by_macos, "macOS provides BSD libedit"
|
||||
|
||||
uses_from_macos "ncurses"
|
||||
|
||||
def install
|
||||
system "./configure", "--prefix=#{prefix}", "--with-curses"
|
||||
# FIXME: Setting `SHLIB_LIBS` should not be needed, but, on Linux,
|
||||
# many dependents expect readline to link with ncurses and
|
||||
# are broken without it. Readline should be agnostic about
|
||||
# the terminfo library on Linux.
|
||||
system "make", "install", "SHLIB_LIBS=-lcurses"
|
||||
end
|
||||
|
||||
test do
|
||||
(testpath/"test.c").write <<~C
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <readline/readline.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("%s\\n", readline("test> "));
|
||||
return 0;
|
||||
}
|
||||
C
|
||||
|
||||
system ENV.cc, "-L", lib, "test.c", "-L#{lib}", "-lreadline", "-o", "test"
|
||||
assert_equal "test> Hello, World!\nHello, World!", pipe_output("./test", "Hello, World!\n").strip
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,87 @@
|
||||
class Sqlite < Formula
|
||||
bottle do
|
||||
root_url "https://homebrew.mirror.ygg/bottles"
|
||||
sha256 cellar: :any, arm64_tahoe: "e1149946e2c8c81edcb09d9a6842cc262986745513822f68f71631f4594773a9"
|
||||
sha256 cellar: :any, arm64_sequoia: "d72213dd3ac143c71b042851046aa3cc71b812c16f88c741db0550ab7d629a27"
|
||||
sha256 cellar: :any, sequoia: "fa1c1ec844206b09df111e79e137af6c73018b8ab48ba9350e8240418f696e34"
|
||||
sha256 cellar: :any, x86_64_linux: "a44eff3774c1d944e3adf975d8489eff5ec841322ba8e37a88b924e5106f4805"
|
||||
end
|
||||
desc "Command-line interface for SQLite"
|
||||
homepage "https://sqlite.org/index.html"
|
||||
url "https://www.sqlite.org/2026/sqlite-autoconf-3530400.tar.gz"
|
||||
version "3.53.4"
|
||||
sha256 "0e9483900e92cd5de8fd48d16bf9200145a61f7fd5be542a5ac81d8a9516eb9c"
|
||||
license "blessing"
|
||||
compatibility_version 1
|
||||
|
||||
livecheck do
|
||||
url :homepage
|
||||
regex(%r{href=.*?releaselog/v?(\d+(?:[._]\d+)+)\.html}i)
|
||||
strategy :page_match do |page, regex|
|
||||
page.scan(regex).map { |match| match&.first&.tr("_", ".") }
|
||||
end
|
||||
end
|
||||
|
||||
no_autobump! because: :incompatible_version_format
|
||||
|
||||
|
||||
|
||||
keg_only :provided_by_macos
|
||||
|
||||
depends_on "readline"
|
||||
|
||||
on_linux do
|
||||
depends_on "zlib-ng-compat"
|
||||
end
|
||||
|
||||
def install
|
||||
# Default value of MAX_VARIABLE_NUMBER is 999 which is too low for many
|
||||
# applications. Set to 250000 (Same value used in Debian and Ubuntu).
|
||||
ENV.append "CPPFLAGS", %w[
|
||||
-DSQLITE_ENABLE_API_ARMOR=1
|
||||
-DSQLITE_ENABLE_COLUMN_METADATA=1
|
||||
-DSQLITE_ENABLE_DBSTAT_VTAB=1
|
||||
-DSQLITE_ENABLE_FTS3=1
|
||||
-DSQLITE_ENABLE_FTS3_PARENTHESIS=1
|
||||
-DSQLITE_ENABLE_FTS5=1
|
||||
-DSQLITE_ENABLE_GEOPOLY=1
|
||||
-DSQLITE_ENABLE_JSON1=1
|
||||
-DSQLITE_ENABLE_MEMORY_MANAGEMENT=1
|
||||
-DSQLITE_ENABLE_RTREE=1
|
||||
-DSQLITE_ENABLE_STAT4=1
|
||||
-DSQLITE_ENABLE_UNLOCK_NOTIFY=1
|
||||
-DSQLITE_MAX_VARIABLE_NUMBER=250000
|
||||
-DSQLITE_USE_URI=1
|
||||
].join(" ")
|
||||
|
||||
args = [
|
||||
"--enable-readline",
|
||||
"--disable-editline",
|
||||
"--enable-session",
|
||||
"--with-readline-cflags=-I#{formula_opt_include("readline")}",
|
||||
"--with-readline-ldflags=-L#{formula_opt_lib("readline")} -lreadline",
|
||||
]
|
||||
args << "--soname=legacy" if OS.linux?
|
||||
|
||||
system "./configure", *args, *std_configure_args
|
||||
ENV.deparallelize
|
||||
system "make", "install"
|
||||
|
||||
# Avoid rebuilds of dependants that hardcode this path.
|
||||
inreplace lib/"pkgconfig/sqlite3.pc", prefix, opt_prefix
|
||||
end
|
||||
|
||||
test do
|
||||
path = testpath/"school.sql"
|
||||
path.write <<~SQL
|
||||
create table students (name text, age integer);
|
||||
insert into students (name, age) values ('Bob', 14);
|
||||
insert into students (name, age) values ('Sue', 12);
|
||||
insert into students (name, age) values ('Tim', 13);
|
||||
select name from students order by age asc;
|
||||
SQL
|
||||
|
||||
names = shell_output("#{bin}/sqlite3 < #{path}").strip.split("\n")
|
||||
assert_equal %w[Sue Tim Bob], names
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,45 @@
|
||||
class Xz < Formula
|
||||
bottle do
|
||||
root_url "https://homebrew.mirror.ygg/bottles"
|
||||
sha256 cellar: :any, arm64_tahoe: "55c891f5d47142fe923c87df0e3343d7ef2bc7d368c67892b4ad2c80e53069d5"
|
||||
sha256 cellar: :any, arm64_sequoia: "c4be907ac8459f8b3e764c06287cc88b79c1d5c16a2db1c0335e1facf4fd4dbe"
|
||||
sha256 cellar: :any, sequoia: "be9bd234f1e9ec28b25cd8ce0850ea841751cd337dffd6f104432c57cdc32c78"
|
||||
sha256 cellar: :any_skip_relocation, x86_64_linux: "61032fd340234974371a87c9908c998d9a52bebdf056b83e629ebf7aa038840f"
|
||||
end
|
||||
desc "General-purpose data compression with high compression ratio"
|
||||
homepage "https://tukaani.org/xz/"
|
||||
url "https://github.com/tukaani-project/xz/releases/download/v5.8.3/xz-5.8.3.tar.gz"
|
||||
mirror "https://downloads.sourceforge.net/project/lzmautils/xz-5.8.3.tar.gz"
|
||||
mirror "http://downloads.sourceforge.net/project/lzmautils/xz-5.8.3.tar.gz"
|
||||
sha256 "3d3a1b973af218114f4f889bbaa2f4c037deaae0c8e815eec381c3d546b974a0"
|
||||
license all_of: [
|
||||
"0BSD",
|
||||
"GPL-2.0-or-later",
|
||||
]
|
||||
version_scheme 1
|
||||
compatibility_version 1
|
||||
|
||||
|
||||
|
||||
deny_network_access!
|
||||
|
||||
def install
|
||||
system "./configure", "--disable-silent-rules", "--disable-nls", *std_configure_args
|
||||
system "make", "check"
|
||||
system "make", "install"
|
||||
end
|
||||
|
||||
test do
|
||||
path = testpath/"data.txt"
|
||||
original_contents = "." * 1000
|
||||
path.write original_contents
|
||||
|
||||
# compress: data.txt -> data.txt.xz
|
||||
system bin/"xz", path
|
||||
refute_path_exists path
|
||||
|
||||
# decompress: data.txt.xz -> data.txt
|
||||
system bin/"xz", "-d", "#{path}.xz"
|
||||
assert_equal original_contents, path.read
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,60 @@
|
||||
class ZlibNgCompat < Formula
|
||||
bottle do
|
||||
root_url "https://homebrew.mirror.ygg/bottles"
|
||||
sha256 cellar: :any, arm64_tahoe: "b54f4ab67f4956e7d0ede376704746985e5e8cfaa97ec299b311c74eb49708a6"
|
||||
sha256 cellar: :any, arm64_sequoia: "cf654aacfa54b53a5d1d3fbb73e3053fe43349253de8515f05b7070b430ba4ae"
|
||||
sha256 cellar: :any_skip_relocation, x86_64_linux: "eb72c27ca6918fb29af89b1287471e381e15156212ccd0e99661ee393bde872d"
|
||||
end
|
||||
desc "Zlib replacement with optimizations for next generation systems"
|
||||
homepage "https://github.com/zlib-ng/zlib-ng"
|
||||
url "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.3.3.tar.gz"
|
||||
mirror "http://fresh-center.net/linux/misc/zlib-ng-2.3.3.tar.gz"
|
||||
mirror "http://fresh-center.net/linux/misc/legacy/zlib-ng-2.3.3.tar.gz"
|
||||
sha256 "f9c65aa9c852eb8255b636fd9f07ce1c406f061ec19a2e7d508b318ca0c907d1"
|
||||
license "Zlib"
|
||||
revision 1
|
||||
compatibility_version 1
|
||||
head "https://github.com/zlib-ng/zlib-ng.git", branch: "develop"
|
||||
|
||||
livecheck do
|
||||
formula "zlib-ng"
|
||||
end
|
||||
|
||||
|
||||
|
||||
keg_only :shadowed_by_macos, "macOS provides zlib"
|
||||
|
||||
depends_on "cmake" => :build
|
||||
|
||||
link_overwrite "include/zconf.h", "include/zlib.h", "lib/libz.*", "lib/pkgconfig/zlib.pc"
|
||||
|
||||
def install
|
||||
ENV.runtime_cpu_detection
|
||||
args = %w[
|
||||
-DZLIB_COMPAT=ON
|
||||
-DWITH_NEW_STRATEGIES=OFF
|
||||
]
|
||||
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
|
||||
system "cmake", "--build", "build"
|
||||
system "cmake", "--install", "build"
|
||||
|
||||
# Avoid rebuilds of dependents that hardcode this path.
|
||||
inreplace lib/"pkgconfig/zlib.pc", prefix, opt_prefix
|
||||
end
|
||||
|
||||
test do
|
||||
# https://zlib.net/zlib_how.html
|
||||
resource "zpipe.c" do
|
||||
url "https://raw.githubusercontent.com/madler/zlib/3f5d21e8f573a549ffc200e17dd95321db454aa1/examples/zpipe.c"
|
||||
mirror "http://zlib.net/zpipe.c"
|
||||
sha256 "e79717cefd20043fb78d730fd3b9d9cdf8f4642307fc001879dc82ddb468509f"
|
||||
end
|
||||
|
||||
testpath.install resource("zpipe.c")
|
||||
system ENV.cc, "zpipe.c", "-I#{include}", lib/shared_library("libz"), "-o", "zpipe"
|
||||
|
||||
text = "Hello, Homebrew!"
|
||||
compressed = pipe_output("./zpipe", text, 0)
|
||||
assert_equal text, pipe_output("./zpipe -d", compressed, 0)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,76 @@
|
||||
class Zstd < Formula
|
||||
bottle do
|
||||
root_url "https://homebrew.mirror.ygg/bottles"
|
||||
sha256 cellar: :any, arm64_tahoe: "628a4ef53428d0078e3d76d297171ce8d0294f5ec1de3f20305e08c4dd333565"
|
||||
sha256 cellar: :any, arm64_sequoia: "d72adf48460a8384b256f88061cd7b9df4977df7fa2e0794051d427db754a565"
|
||||
sha256 cellar: :any, sequoia: "8b2443dfa62b9d28cf0321e0e670bb096b2680fe72739999228291f36018311f"
|
||||
sha256 cellar: :any_skip_relocation, x86_64_linux: "3d5ca8948526a2e3a487db0cd0acec9f4b415d5a4b08cffe27e2ea0c339c9dbe"
|
||||
end
|
||||
desc "Zstandard is a real-time compression algorithm"
|
||||
homepage "https://facebook.github.io/zstd/"
|
||||
url "https://github.com/facebook/zstd/archive/refs/tags/v1.5.7.tar.gz"
|
||||
mirror "http://fresh-center.net/linux/misc/zstd-1.5.7.tar.gz"
|
||||
mirror "http://fresh-center.net/linux/misc/legacy/zstd-1.5.7.tar.gz"
|
||||
sha256 "37d7284556b20954e56e1ca85b80226768902e2edabd3b649e9e72c0c9012ee3"
|
||||
license all_of: [
|
||||
{ any_of: ["BSD-3-Clause", "GPL-2.0-only"] },
|
||||
"BSD-2-Clause", # programs/zstdgrep, lib/libzstd.pc.in
|
||||
"MIT", # lib/dictBuilder/divsufsort.c
|
||||
]
|
||||
revision 1
|
||||
compatibility_version 1
|
||||
head "https://github.com/facebook/zstd.git", branch: "dev"
|
||||
|
||||
# The upstream repository contains old, one-off tags (5.5.5, 6.6.6) that are
|
||||
# higher than current versions, so we check the "latest" release instead.
|
||||
livecheck do
|
||||
url :stable
|
||||
strategy :github_latest
|
||||
end
|
||||
|
||||
|
||||
|
||||
depends_on "cmake" => :build
|
||||
depends_on "lz4"
|
||||
depends_on "xz"
|
||||
|
||||
on_linux do
|
||||
depends_on "zlib-ng-compat"
|
||||
end
|
||||
|
||||
def install
|
||||
# Legacy support is the default after
|
||||
# https://github.com/facebook/zstd/commit/db104f6e839cbef94df4df8268b5fecb58471274
|
||||
# Set it to `ON` to be explicit about the configuration.
|
||||
system "cmake", "-S", "build/cmake", "-B", "builddir",
|
||||
"-DBUILD_SHARED_LIBS=ON", # set CMake libzstd target to shared
|
||||
"-DZSTD_PROGRAMS_LINK_SHARED=ON", # link `zstd` to `libzstd`
|
||||
"-DZSTD_BUILD_CONTRIB=ON",
|
||||
"-DCMAKE_INSTALL_RPATH=#{rpath}",
|
||||
"-DZSTD_LEGACY_SUPPORT=ON",
|
||||
"-DZSTD_ZLIB_SUPPORT=ON",
|
||||
"-DZSTD_LZMA_SUPPORT=ON",
|
||||
"-DZSTD_LZ4_SUPPORT=ON",
|
||||
"-DCMAKE_CXX_STANDARD=11",
|
||||
*std_cmake_args
|
||||
system "cmake", "--build", "builddir"
|
||||
system "cmake", "--install", "builddir"
|
||||
|
||||
# Prevent dependents from relying on fragile Cellar paths.
|
||||
# https://github.com/ocaml/ocaml/issues/12431
|
||||
inreplace lib/"pkgconfig/libzstd.pc", prefix, opt_prefix
|
||||
end
|
||||
|
||||
test do
|
||||
[bin/"zstd", bin/"pzstd", "xz", "lz4", "gzip"].each do |prog|
|
||||
data = "Hello, #{prog}"
|
||||
assert_equal data, pipe_output("#{bin}/zstd -d", pipe_output(prog, data))
|
||||
if prog.to_s.end_with?("zstd")
|
||||
# `pzstd` can only decompress zstd-compressed data.
|
||||
assert_equal data, pipe_output("#{bin}/pzstd -d", pipe_output(prog, data))
|
||||
else
|
||||
assert_equal data, pipe_output("#{prog} -d", pipe_output("#{bin}/zstd --format=#{prog}", data))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,31 @@
|
||||
# tap-ygg Homebrew mirror
|
||||
|
||||
Mirrored packages from upstream Homebrew taps, served from this repository.
|
||||
|
||||
- Bottles: https://homebrew.mirror.ygg/bottles
|
||||
- Casks: https://homebrew.mirror.ygg/cask
|
||||
- Formulas mirrored: 15
|
||||
- Casks mirrored: 2
|
||||
|
||||
## Usage
|
||||
|
||||
Point Homebrew at the tap (an org/repo name is required for `brew tap`):
|
||||
|
||||
brew tap <org>/tap-ygg <tap-access-url>
|
||||
|
||||
then install normally:
|
||||
|
||||
brew install <formula>
|
||||
brew install --cask <cask>
|
||||
|
||||
Bottles are downloaded from the mirror's bottle domain. Targets that were not
|
||||
mirrored for a formula fall back to building from source.
|
||||
|
||||
Alternatively, for API-mode formula installs, set:
|
||||
|
||||
export HOMEBREW_BOTTLE_DOMAIN=https://homebrew.mirror.ygg/bottles
|
||||
export HOMEBREW_API_DOMAIN=https://homebrew.mirror.ygg/api # if you serve the API JSON
|
||||
|
||||
The external HTTP server must map:
|
||||
/bottles/... -> homebrew.mirror.ygg artifacts/bottles
|
||||
/cask/... -> artifacts/cask
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"bottle_base_url": "https://homebrew.mirror.ygg/bottles",
|
||||
"cask_base_url": "https://homebrew.mirror.ygg/cask",
|
||||
"casks": {
|
||||
"android-platform-tools": {
|
||||
"file": "platform-tools_r37.0.1-darwin.zip",
|
||||
"version": "37.0.1"
|
||||
},
|
||||
"macfuse": {
|
||||
"file": "macfuse-5.3.3.dmg",
|
||||
"version": "5.3.3"
|
||||
}
|
||||
},
|
||||
"domain": "homebrew.mirror.ygg",
|
||||
"formulas": {
|
||||
"atuin": {
|
||||
"targets": [
|
||||
"arm64_tahoe",
|
||||
"arm64_sequoia",
|
||||
"x86_64_linux"
|
||||
],
|
||||
"version": "18.19.0"
|
||||
},
|
||||
"clang-format": {
|
||||
"targets": [
|
||||
"arm64_tahoe",
|
||||
"arm64_sequoia",
|
||||
"x86_64_linux"
|
||||
],
|
||||
"version": "22.1.8"
|
||||
},
|
||||
"conan": {
|
||||
"targets": [
|
||||
"arm64_tahoe",
|
||||
"arm64_sequoia",
|
||||
"x86_64_linux"
|
||||
],
|
||||
"version": "2.31.2"
|
||||
},
|
||||
"libyaml": {
|
||||
"targets": [
|
||||
"arm64_tahoe",
|
||||
"arm64_sequoia",
|
||||
"x86_64_linux"
|
||||
],
|
||||
"version": "0.2.5"
|
||||
},
|
||||
"lz4": {
|
||||
"targets": [
|
||||
"arm64_tahoe",
|
||||
"arm64_sequoia",
|
||||
"sequoia",
|
||||
"x86_64_linux"
|
||||
],
|
||||
"version": "1.10.0"
|
||||
},
|
||||
"mpdecimal": {
|
||||
"targets": [
|
||||
"arm64_tahoe",
|
||||
"arm64_sequoia",
|
||||
"sequoia",
|
||||
"x86_64_linux"
|
||||
],
|
||||
"version": "4.0.1"
|
||||
},
|
||||
"openssl@3": {
|
||||
"targets": [
|
||||
"arm64_tahoe",
|
||||
"arm64_sequoia",
|
||||
"sequoia",
|
||||
"x86_64_linux"
|
||||
],
|
||||
"version": "3.6.3"
|
||||
},
|
||||
"python@3.14": {
|
||||
"targets": [
|
||||
"arm64_tahoe",
|
||||
"arm64_sequoia",
|
||||
"sequoia",
|
||||
"x86_64_linux"
|
||||
],
|
||||
"version": "3.14.6"
|
||||
},
|
||||
"readline": {
|
||||
"targets": [
|
||||
"arm64_tahoe",
|
||||
"arm64_sequoia",
|
||||
"sequoia",
|
||||
"x86_64_linux"
|
||||
],
|
||||
"version": "8.3.3"
|
||||
},
|
||||
"sqlite": {
|
||||
"targets": [
|
||||
"arm64_tahoe",
|
||||
"arm64_sequoia",
|
||||
"sequoia",
|
||||
"x86_64_linux"
|
||||
],
|
||||
"version": "3.53.4"
|
||||
},
|
||||
"xz": {
|
||||
"targets": [
|
||||
"arm64_tahoe",
|
||||
"arm64_sequoia",
|
||||
"sequoia",
|
||||
"x86_64_linux"
|
||||
],
|
||||
"version": "5.8.3"
|
||||
},
|
||||
"zlib-ng-compat": {
|
||||
"targets": [
|
||||
"arm64_tahoe",
|
||||
"arm64_sequoia",
|
||||
"x86_64_linux"
|
||||
],
|
||||
"version": "2.3.3"
|
||||
},
|
||||
"zstd": {
|
||||
"targets": [
|
||||
"arm64_tahoe",
|
||||
"arm64_sequoia",
|
||||
"sequoia",
|
||||
"x86_64_linux"
|
||||
],
|
||||
"version": "1.5.7"
|
||||
}
|
||||
},
|
||||
"generated": "2026-08-08T06:21:19.749391+00:00",
|
||||
"skipped": {
|
||||
"casks": [],
|
||||
"formulas": []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user