commit f1fbeb487332d56846d3d4144dcf900428d6b20b Author: HyperWinX Date: Mon Jul 6 15:42:05 2026 -0700 Initial commit diff --git a/Casks/android-platform-tools.rb b/Casks/android-platform-tools.rb new file mode 100644 index 0000000..1025051 --- /dev/null +++ b/Casks/android-platform-tools.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +cask "android-platform-tools" do + os macos: "darwin", linux: "linux" + + version "37.0.0" + sha256 arm: "094a1395683c509fd4d48667da0d8b5ef4d42b2abfcd29f2e8149e2f989357c7", x86_64: "094a1395683c509fd4d48667da0d8b5ef4d42b2abfcd29f2e8149e2f989357c7", x86_64_linux: "198ae156ab285fa555987219af237b31102fefe8b9d2bc274708a8d4f2865a07", arm64_linux: "198ae156ab285fa555987219af237b31102fefe8b9d2bc274708a8d4f2865a07" + + url "https://homebrew.hyprnet/casks/android-platform-tools/android-platform-tools--platform-tools_r37.0.0-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 diff --git a/Casks/claude-code.rb b/Casks/claude-code.rb new file mode 100644 index 0000000..10f3dc7 --- /dev/null +++ b/Casks/claude-code.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +cask "claude-code" do + arch arm: "arm64", intel: "x64" + os macos: "darwin", linux: "linux" + + version "2.1.193" + sha256 arm: "86d8b820ad7eed50e50a130706d3dc5ef70696f91194de1b3897a842182afe3a", x86_64: "86d8b820ad7eed50e50a130706d3dc5ef70696f91194de1b3897a842182afe3a", arm64_linux: "341072395844b2b6d2846d8d61d551752b12a44433c920d0cc7fe6e7b5692a9b", x86_64_linux: "cf066bf360cbf7b51abeb8cb230012fc0f2fed4253b2ce305de48ccd6d49a39c" + + url "https://homebrew.hyprnet/casks/claude-code/claude-code--claude", + verified: "downloads.claude.ai/claude-code-releases/" + name "Claude Code" + desc "Terminal-based AI coding assistant" + homepage "https://claude.com/product/claude-code" + + livecheck do + url "https://downloads.claude.ai/claude-code-releases/stable" + regex(/^v?(\d+(?:\.\d+)+)$/i) + end + + binary "claude" + + zap trash: [ + "~/.cache/claude", + "~/.claude.json*", + "~/.config/claude", + "~/.local/bin/claude", + "~/.local/share/claude", + "~/.local/state/claude", + "~/Library/Caches/claude-cli-nodejs", + ], + rmdir: "~/.claude" +end diff --git a/Casks/codex.rb b/Casks/codex.rb new file mode 100644 index 0000000..f8ea720 --- /dev/null +++ b/Casks/codex.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +cask "codex" do + arch arm: "aarch64", intel: "x86_64" + os macos: "apple-darwin", linux: "unknown-linux-musl" + + version "0.142.5" + sha256 arm: "c81eaf1b4c9aee0e81e2b39dec1742a57b61be6c109f8811e7fcd41f55c2233d", intel: "c81eaf1b4c9aee0e81e2b39dec1742a57b61be6c109f8811e7fcd41f55c2233d", arm64_linux: "ec6c804d415e42dd28cc6f8c6cb5238b00c9af4bfb58b63be55e26ec4ee576c0", x86_64_linux: "48e591964d4bbaab7c0433daed41c65ea8f152fc0f1dd2334a42e3dd322a4906" + + url "https://homebrew.hyprnet/casks/codex/codex--codex-aarch64-apple-darwin.tar.gz" + name "Codex" + desc "OpenAI's coding agent that runs in your terminal" + homepage "https://github.com/openai/codex" + + livecheck do + url :url + regex(/^rust-v?(\d+(?:\.\d+)+)$/i) + strategy :github_latest + end + + depends_on formula: "ripgrep" + + binary "codex-#{arch}-#{os}", target: "codex" + + generate_completions_from_executable "codex-#{arch}-#{os}", "completion", base_name: "codex" + + zap rmdir: "~/.codex" +end diff --git a/Formula/atuin.rb b/Formula/atuin.rb new file mode 100644 index 0000000..3aee1d4 --- /dev/null +++ b/Formula/atuin.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class Atuin < Formula + desc "Improved shell history for zsh, bash, fish and nushell" + homepage "https://atuin.sh/" + url "https://homebrew.hyprnet/sources/358c49594fdce992e276d27a0f8f2aab40f671f9f089f772331aa6d40cdde689--atuin--18.16.1.x86_64_linux.bottle.1.tar.gz" + sha256 "aec5c91207f080becc4b13593d5b7edc46685e8d4dbfbaef33d31f8058191bc6" + license "MIT" + head "https://github.com/atuinsh/atuin.git", branch: "main" + + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 1 + sha256 cellar: :any_skip_relocation, arm64_tahoe: "7c0a9028714c42a158eedafd0e3c616f1e6df335f5e2fe3d4796006d8996d5db" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "aabe5a89f5f07effa9b1d93087469c60e3630bbb1f1eef4b4f3e8e63b8c1790b" + sha256 cellar: :any_skip_relocation, arm64_sonoma: "409a9e05765cda4f7271eaaa7833afb7d5ad55b71badac5b6459aa78cb85ee0e" + sha256 cellar: :any_skip_relocation, sonoma: "ebb8239444b8ce96d114812593e5781d141406097b8348bcf0d5b5ab11619fd0" + sha256 cellar: :any_skip_relocation, arm64_linux: "5edbd418eb0f9d32dedfa1c737e8e66487dd2bc81f02d31d27a807070dc6c7af" + sha256 cellar: :any_skip_relocation, x86_64_linux: "51817c931148502c0ba47dbdb24359642c402c5d1697765a482489a5eb8955d6" + end + + depends_on "protobuf" => :build + depends_on "rust" => :build + + 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 diff --git a/Formula/clang-format.rb b/Formula/clang-format.rb new file mode 100644 index 0000000..a8601c1 --- /dev/null +++ b/Formula/clang-format.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class ClangFormat < Formula + desc "Formatting tools for C, C++, Obj-C, Java, JavaScript, TypeScript" + homepage "https://clang.llvm.org/docs/ClangFormat.html" + url "https://homebrew.hyprnet/sources/c01ebc051b7d6beb690739b66d16f80c2fdd025a38ade481c57108f884e57603--clang-format--22.1.8.x86_64_linux.bottle.tar.gz" + 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 + + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "e20d0dbbf9f69f0867b35266ec5c64e2483d2ec9a5275cfe1ae2781cfeb5ad75" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "7f943e52e18ec8cfda8ab3174eb733017600af529203e53a3a49443044656f46" + sha256 cellar: :any_skip_relocation, arm64_sonoma: "33059fc48804586223ece39cdafba74d6ec600ac792e3bd65c031f760278435b" + sha256 cellar: :any_skip_relocation, sonoma: "a8dd7c9efe79e3f69b901ea1e7e3fbd0aaa4ee887e76e13bf38ab8f22058ab49" + sha256 cellar: :any, arm64_linux: "8f77d7106b7b5af26a131022ec91b1b926d6fad7fb7abb4aa322e7e3a8300b38" + sha256 cellar: :any, x86_64_linux: "442dd96bb8ecbc6a01c8c7245ecba01567511b0626dba79a349854a68897fc2f" + 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 diff --git a/Formula/docker-compose.rb b/Formula/docker-compose.rb new file mode 100644 index 0000000..89c6373 --- /dev/null +++ b/Formula/docker-compose.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class DockerCompose < Formula + desc "Isolated development environments using Docker" + homepage "https://docs.docker.com/compose/" + url "https://homebrew.hyprnet/sources/3703493f0447ff926fca8b7a93fe6597a4225f9d5862cc23466f399a08b8efff--docker-compose--5.3.0.x86_64_linux.bottle.tar.gz" + sha256 "496ee43bc6ecee6fbac28e93f6e784a7b0207baec7ae2b0ffb57cfd83bc92874" + license "Apache-2.0" + head "https://github.com/docker/compose.git", branch: "main" + + # Upstream creates releases that use a stable tag (e.g., `v1.2.3`) but are + # labeled as "pre-release" on GitHub before the version is released, so it's + # necessary to use the `GithubLatest` strategy. + livecheck do + url :stable + strategy :github_latest + end + + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "14e4c83d2f2c824af7046ca1ce532b9ff823464c1caea94d3968f3be226d8316" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "d316fa23346d9f844562ae62a63fa13d421b2037129953ca6525c2f649d56240" + sha256 cellar: :any_skip_relocation, arm64_sonoma: "c91d7781904a4228534a3eda0013a0bfa881f021e0c389ad9a7f5db6b22ee522" + sha256 cellar: :any_skip_relocation, sonoma: "1bd03d5298514055a21d30a46811f1c0fface305fd2b1fdaca7c540c0715cf16" + sha256 cellar: :any_skip_relocation, arm64_linux: "d7f2705e4e498bb3f952a06d12992638c9301281435e7c087642b83f4ccfa42c" + sha256 cellar: :any_skip_relocation, x86_64_linux: "21210f9a352d063152eab0a3b754b212e4ac2e1147f3fd413711fcb53f8c764b" + end + + depends_on "go" => :build + + conflicts_with cask: "docker-desktop" + + def install + ENV["CGO_ENABLED"] = OS.mac? ? "1" : "0" + ldflags = %W[ + -s -w + -X github.com/docker/compose/v#{version.major}/internal.Version=#{version} + ] + tags = %w[fsnotify] if OS.mac? + system "go", "build", *std_go_args(ldflags:, tags:), "./cmd" + + (lib/"docker/cli-plugins").install_symlink bin/"docker-compose" + end + + def caveats + <<~EOS + Compose is a Docker plugin. For Docker to find the plugin, add "cliPluginsExtraDirs" to ~/.docker/config.json: + "cliPluginsExtraDirs": [ + "#{HOMEBREW_PREFIX}/lib/docker/cli-plugins" + ] + EOS + end + + test do + output = shell_output("#{bin}/docker-compose up 2>&1", 1) + assert_match "no configuration file provided", output + assert_match version.to_s, shell_output("#{bin}/docker-compose version") + end +end diff --git a/Formula/helm.rb b/Formula/helm.rb new file mode 100644 index 0000000..f230961 --- /dev/null +++ b/Formula/helm.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class Helm < Formula + desc "Kubernetes package manager" + homepage "https://helm.sh/" + url "https://homebrew.hyprnet/sources/3c809b39ccaa77f3d4dbbab3faae9ad1ba7c8bce6310eccc8dae812862c24024--helm--4.2.2.x86_64_linux.bottle.tar.gz", + tag: "v4.2.2", + revision: "b05881cf967a5a09e19866799d0edfd40675803a" + license "Apache-2.0" + head "https://github.com/helm/helm.git", branch: "main" + + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "30b3d1bc580fa98befa1857963d9f11d2e47a36df41f099ea3934199871318e6" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "276000aec740958de2b7391642c29af303430b108f5e8668705642b767b5c0af" + sha256 cellar: :any_skip_relocation, arm64_sonoma: "2cbf1f084c340ed1ceac18587fda01173386ac49b8db7c6194fd27fbadabc81c" + sha256 cellar: :any_skip_relocation, sonoma: "0c3457bbe4b875e5f46f04ea44cc8e34ecb83cf8639aac687ed3cd73e1e26314" + sha256 cellar: :any_skip_relocation, arm64_linux: "110ac2ba0295e03379b5eab6bcd3d13268023489bcd88a20d708aa59f0cfb4f5" + sha256 cellar: :any_skip_relocation, x86_64_linux: "c119b6f04ec4a50e327ab6f0157da03b4706f7c2339f09d515fba36c0fbcfc4a" + end + + depends_on "go" => :build + + def install + system "make", "build" + bin.install "bin/helm" + + mkdir "man1" do + system bin/"helm", "docs", "--type", "man" + man1.install Dir["*"] + end + + generate_completions_from_executable(bin/"helm", shell_parameter_format: :cobra) + end + + test do + system bin/"helm", "create", "foo" + assert File.directory? testpath/"foo/charts" + + version_output = shell_output("#{bin}/helm version 2>&1") + assert_match "GitCommit:\"#{stable.specs[:revision]}\"", version_output + assert_match "Version:\"v#{version}\"", version_output + end +end diff --git a/Formula/kubernetes-cli.rb b/Formula/kubernetes-cli.rb new file mode 100644 index 0000000..9a32d4f --- /dev/null +++ b/Formula/kubernetes-cli.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class KubernetesCli < Formula + desc "Kubernetes command-line interface" + homepage "https://kubernetes.io/docs/reference/kubectl/" + url "https://homebrew.hyprnet/sources/7902f16cb564f74289964e1bf0f989e6f395847ea9badb9d0fda9468a692a4ad--kubernetes-cli--1.36.2.x86_64_linux.bottle.tar.gz", + tag: "v1.36.2", + revision: "24e2b02af5543d7910c2bb074c7264df5a8f0467" + license "Apache-2.0" + head "https://github.com/kubernetes/kubernetes.git", branch: "master" + + livecheck do + url :stable + regex(/^v?(\d+(?:\.\d+)+)$/i) + end + + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "91df548e1cb396ef67e3a99aa2832777e7ebcd56e0b8050a981a9dc8f1234002" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "8cf9ef220adef51db3f6835f0b4c7fe0b322f593c668753e5635566520ed06c2" + sha256 cellar: :any_skip_relocation, arm64_sonoma: "5ca5116967ba01c8abc7c03019bfc2bc6599efefe6aca4dc2a913939ecfb9082" + sha256 cellar: :any_skip_relocation, sonoma: "9c4452b0a565b7687f2c374802d19c794b2c192db0ab1da264052e9c8a5cdc11" + sha256 cellar: :any_skip_relocation, arm64_linux: "ee8cd75eacc68081c0a08b4d038c5f61fb08d16ae45574e07c870c12ad116661" + sha256 cellar: :any_skip_relocation, x86_64_linux: "85ab53660f7b8edd92dc7e851191a8474ac8bc19f6281f8f0e02a4c777d494ea" + end + + depends_on "go" => :build + + on_macos do + depends_on "bash" => :build + depends_on "coreutils" => :build + end + + def install + ENV.prepend_path "PATH", Formula["coreutils"].libexec/"gnubin" if OS.mac? # needs GNU date + ENV["FORCE_HOST_GO"] = "1" + system "make", "WHAT=cmd/kubectl" + bin.install "_output/bin/kubectl" + + generate_completions_from_executable(bin/"kubectl", shell_parameter_format: :cobra) + + # Install man pages + # Leave this step for the end as this dirties the git tree + system "hack/update-generated-docs.sh" + man1.install Dir["docs/man/man1/*.1"] + end + + test do + run_output = shell_output("#{bin}/kubectl 2>&1") + assert_match "kubectl controls the Kubernetes cluster manager.", run_output + + version_output = shell_output("#{bin}/kubectl version --client --output=yaml 2>&1") + assert_match "gitTreeState: clean", version_output + assert_match stable.specs[:revision].to_s, version_output + end +end diff --git a/Formula/mactop.rb b/Formula/mactop.rb new file mode 100644 index 0000000..8c7e47c --- /dev/null +++ b/Formula/mactop.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class Mactop < Formula + desc "Apple Silicon Monitor Top written in Go Lang" + homepage "https://github.com/metaspartan/mactop" + url "https://homebrew.hyprnet/sources/98986a2c2d16f785a8f5381537a5c4aa494d4cfabdd8d44a5babf5346d0be9d1--mactop-2.1.5.tar.gz" + sha256 "df49979c413b8a3a6e98ccfb553fafeb94fd652ec13a830205d057c8d73cace7" + license "MIT" + head "https://github.com/metaspartan/mactop.git", branch: "main" + + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "2cd8bcc67340c0f637d6345b0a6b3ca729e6237f6e322e0d90e7bd48a8580a2f" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "a022ad6a6b766891a69ee8ab26956fb0dfe5b163cb7eaefa6032ee2f9f587cfb" + sha256 cellar: :any_skip_relocation, arm64_sonoma: "c97420c5a27f470fc56fda4640f08f9dccfc3c45cecda6437ac12c2efa0f7f60" + end + + depends_on "go" => :build + depends_on arch: :arm64 + depends_on :macos + + def install + system "go", "build", *std_go_args(ldflags: "-s -w") + end + + service do + run [opt_bin/"mactop", "-p", "9101", "--headless"] + keep_alive true + log_path var/"log/mactop.log" + error_log_path var/"log/mactop.error.log" + process_type :background + nice 10 + end + + test do + test_input = "This is a test input for brew" + assert_match "Test input received: #{test_input}", shell_output("#{bin}/mactop --test '#{test_input}'") + end +end diff --git a/Formula/ncdu.rb b/Formula/ncdu.rb new file mode 100644 index 0000000..20b3745 --- /dev/null +++ b/Formula/ncdu.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class Ncdu < Formula + desc "NCurses Disk Usage" + homepage "https://dev.yorhel.nl/ncdu" + url "https://homebrew.hyprnet/sources/023b45ac32cdd77be32bff75872f4d8e4bcacc6926f1af6cbc8d6e51563d2fe4--ncdu--2.9.2.x86_64_linux.bottle.tar.gz" + sha256 "e91135281cb66569f2ca4c0bac277246991e7e52524c0ca8cba3de5c8e81cec9" + license "MIT" + head "https://g.blicky.net/ncdu.git", branch: "zig" + + livecheck do + url :homepage + regex(/href=.*?ncdu[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_tahoe: "9a08dd709b18d87d90b016b8685d56f2de8d537e437ab44cf4ed92203df7a245" + sha256 cellar: :any, arm64_sequoia: "d56b0ffa80c15fa5758a8b7b59525687a1a04ce043d540936b6db917c7c14c30" + sha256 cellar: :any, arm64_sonoma: "b86c878b672bb5a7d8644e9908c4ed1ca3fd942095becec43ceff480340d2a2b" + sha256 cellar: :any, sonoma: "768ace20bc54c22b86ddce63d51bd8488cb04816e28e330286a2685047d5484e" + sha256 cellar: :any_skip_relocation, arm64_linux: "2a2d143126f866ae7a7f0aeecc2d12282bde98542e1ece1203d821a8d499343b" + sha256 cellar: :any_skip_relocation, x86_64_linux: "762c13f508d0699c363f0a3a0741a19cbd14d1ef8a86fdd1d70aeaaf2f7bd851" + end + + depends_on "pkgconf" => :build + depends_on "zig@0.15" => :build + # Without this, `ncdu` is unusable when `TERM=tmux-256color`. + depends_on "ncurses" + depends_on "zstd" + + def install + args = [] + args << "-Dpie=true" if OS.mac? + + # Workaround for https://github.com/Homebrew/homebrew-core/pull/141453#discussion_r1320821081 + # Remove this workaround when the same is removed in `zig.rb`. + if OS.linux? + ENV["NIX_LDFLAGS"] = ENV["HOMEBREW_RPATH_PATHS"].split(":") + .map { |p| "-rpath #{p}" } + .join(" ") + end + + # Avoid the Makefile for now so that we can pass `-Dcpu` to `zig build`. + # https://code.blicky.net/yorhel/ncdu/issues/185 + system "zig", "build", *args, *std_zig_args + man1.install "ncdu.1" + end + + test do + assert_match version.to_s, shell_output("#{bin}/ncdu -v") + system bin/"ncdu", "-o", "test" + output = JSON.parse((testpath/"test").read) + assert_equal "ncdu", output[2]["progname"] + assert_equal version.to_s, output[2]["progver"] + assert_equal Pathname.pwd.size, output[3][0]["asize"] + end +end diff --git a/Formula/neovim.rb b/Formula/neovim.rb new file mode 100644 index 0000000..1488f76 --- /dev/null +++ b/Formula/neovim.rb @@ -0,0 +1,177 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class Neovim < Formula + desc "Ambitious Vim-fork focused on extensibility and agility" + homepage "https://neovim.io/" + license "Apache-2.0" + compatibility_version 1 + head "https://github.com/neovim/neovim.git", branch: "master" + + stable do + url "https://homebrew.hyprnet/sources/d6e52c537914b924519eb5d74ded1ab922378c2efb1147037e6300dabbdfe5a9--neovim--0.12.4.x86_64_linux.bottle.tar.gz" + sha256 "2727da95d2b8b809bc7c71e085452e47dfe1d8aa7cfaa15c68004e23f6f0a6dd" + + # Keep resources updated according to: + # https://github.com/neovim/neovim/blob/v#{version}/cmake.deps/deps.txt + + # TODO: Consider shipping these as separate formulae instead. See discussion at + # https://github.com/orgs/Homebrew/discussions/3611 + # NOTE: The `install` method assumes that the parser name follows the final `-`. + # Please name the resources accordingly. + resource "tree-sitter-c" do + url "https://github.com/tree-sitter/tree-sitter-c/archive/refs/tags/v0.24.1.tar.gz" + sha256 "25dd4bb3dec770769a407e0fc803f424ce02c494a56ce95fedc525316dcf9b48" + + livecheck do + url "https://raw.githubusercontent.com/neovim/neovim/refs/tags/v#{LATEST_VERSION}/cmake.deps/deps.txt" + regex(%r{https://github\.com/tree-sitter/tree-sitter-c/archive/v?(\d+(?:\.\d+)+)\.tar\.gz}i) + end + end + + resource "tree-sitter-lua" do + url "https://github.com/tree-sitter-grammars/tree-sitter-lua/archive/refs/tags/v0.5.0.tar.gz" + sha256 "cf01b93f4b61b96a6d27942cf28eeda4cbce7d503c3bef773a8930b3d778a2d9" + + livecheck do + url "https://raw.githubusercontent.com/neovim/neovim/refs/tags/v#{LATEST_VERSION}/cmake.deps/deps.txt" + regex(%r{https://github\.com/tree-sitter-grammars/tree-sitter-lua/archive/v?(\d+(?:\.\d+)+)\.tar\.gz}i) + end + end + + resource "tree-sitter-vim" do + url "https://github.com/tree-sitter-grammars/tree-sitter-vim/archive/refs/tags/v0.8.1.tar.gz" + sha256 "93cafb9a0269420362454ace725a118ff1c3e08dcdfdc228aa86334b54d53c2a" + + livecheck do + url "https://raw.githubusercontent.com/neovim/neovim/refs/tags/v#{LATEST_VERSION}/cmake.deps/deps.txt" + regex(%r{https://github\.com/tree-sitter-grammars/tree-sitter-vim/archive/v?(\d+(?:\.\d+)+)\.tar\.gz}i) + end + end + + resource "tree-sitter-vimdoc" do + url "https://github.com/neovim/tree-sitter-vimdoc/archive/refs/tags/v4.1.0.tar.gz" + sha256 "020e8f117f648c8697fca967995c342e92dbd81dab137a115cc7555207fbc84f" + + livecheck do + url "https://raw.githubusercontent.com/neovim/neovim/refs/tags/v#{LATEST_VERSION}/cmake.deps/deps.txt" + regex(%r{https://github\.com/neovim/tree-sitter-vimdoc/archive/v?(\d+(?:\.\d+)+)\.tar\.gz}i) + end + end + + resource "tree-sitter-query" do + url "https://github.com/tree-sitter-grammars/tree-sitter-query/archive/refs/tags/v0.8.0.tar.gz" + sha256 "c2b23b9a54cffcc999ded4a5d3949daf338bebb7945dece229f832332e6e6a7d" + + livecheck do + url "https://raw.githubusercontent.com/neovim/neovim/refs/tags/v#{LATEST_VERSION}/cmake.deps/deps.txt" + regex(%r{https://github\.com/tree-sitter-grammars/tree-sitter-query/archive/v?(\d+(?:\.\d+)+)\.tar\.gz}i) + end + end + + resource "tree-sitter-markdown" do + url "https://github.com/tree-sitter-grammars/tree-sitter-markdown/archive/refs/tags/v0.5.3.tar.gz" + sha256 "df845b1ab7c7c163ec57d7fa17170c92b04be199bddab02523636efec5224ab6" + + livecheck do + url "https://raw.githubusercontent.com/neovim/neovim/refs/tags/v#{LATEST_VERSION}/cmake.deps/deps.txt" + regex(%r{https://github\.com/tree-sitter-grammars/tree-sitter-markdown/archive/v?(\d+(?:\.\d+)+)\.tar\.gz}i) + end + end + end + + livecheck do + url :stable + regex(/^v?(\d+(?:\.\d+)+)$/i) + end + + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 arm64_tahoe: "c481e54d74d8e258e00448d44bc25ffc76ff4a982dcde22e8eb0c4ffc30a66b5" + sha256 arm64_sequoia: "0f9d1ace756e7a05ecd2544a4efa7056a2a2faf4f50aad393815d2edb5b39ded" + sha256 arm64_sonoma: "634a72f6b29708b658c3fdeeea4560cd17460244076beee5f38550c10057b02f" + sha256 sonoma: "c36007e42477e4e50c05f43e416052263442bc2ffad5458867b445d2ad33aadf" + sha256 arm64_linux: "c78c28cd3186bd0f415fdba66de7cf795e309ef6dd95e12f79dccb75e7fb1606" + sha256 x86_64_linux: "7027be32c4847a23775a92c23e5bdcebf1a76ea1d8a8697b2659f46c0f4fd4c1" + end + + depends_on "cmake" => :build + depends_on "gettext" => :build + depends_on "libuv" + depends_on "lpeg" + depends_on "luajit" + depends_on "luv" + depends_on "tree-sitter" + depends_on "unibilium" + depends_on "utf8proc" + + on_macos do + depends_on "gettext" + end + + def install + if build.head? + cmake_deps = (buildpath/"cmake.deps/deps.txt").read.lines + cmake_deps.each do |line| + next unless line.match?(/TREESITTER_[^_]+_URL/) + + parser, parser_url = line.split + parser_name = parser.delete_suffix("_URL") + parser_sha256 = cmake_deps.find { |l| l.include?("#{parser_name}_SHA256") }.split.last + parser_name = parser_name.downcase.tr("_", "-") + + resource parser_name do + url parser_url + sha256 parser_sha256 + end + end + end + + resources.each do |r| + source_directory = buildpath/"deps-build/build/src"/r.name + build_directory = buildpath/"deps-build/build"/r.name + + parser_name = r.name.split("-").last + cmakelists = case parser_name + when "markdown" then "MarkdownParserCMakeLists.txt" + else "TreesitterParserCMakeLists.txt" + end + + r.stage(source_directory) + cp buildpath/"cmake.deps/cmake"/cmakelists, source_directory/"CMakeLists.txt" + + system "cmake", "-S", source_directory, "-B", build_directory, "-DPARSERLANG=#{parser_name}", *std_cmake_args + system "cmake", "--build", build_directory + system "cmake", "--install", build_directory + end + + # Point system locations inside `HOMEBREW_PREFIX`. + inreplace "src/nvim/os/stdpaths.c" do |s| + s.gsub! "/etc/xdg/", "#{etc}/xdg/:\\0" + + if HOMEBREW_PREFIX.to_s != HOMEBREW_DEFAULT_PREFIX + s.gsub! "/usr/local/share/:/usr/share/", "#{HOMEBREW_PREFIX}/share/:\\0" + end + end + + # Replace `-dirty` suffix in `--version` output with `-Homebrew`. + inreplace "cmake/GenerateVersion.cmake", "--dirty", "--dirty=-Homebrew" + + args = [ + "-DLUV_LIBRARY=#{formula_opt_lib("luv")/shared_library("libluv")}", + "-DLIBUV_LIBRARY=#{formula_opt_lib("libuv")/shared_library("libuv")}", + "-DLPEG_LIBRARY=#{formula_opt_lib("lpeg")/shared_library("liblpeg")}", + ] + system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + refute_match "dirty", shell_output("#{bin}/nvim --version") + (testpath/"test.txt").write("Hello World from Vim!!") + system bin/"nvim", "--headless", "-i", "NONE", "-u", "NONE", + "+s/Vim/Neovim/g", "+wq", "test.txt" + assert_equal "Hello World from Neovim!!", (testpath/"test.txt").read.chomp + end +end diff --git a/Formula/node.rb b/Formula/node.rb new file mode 100644 index 0000000..b844276 --- /dev/null +++ b/Formula/node.rb @@ -0,0 +1,326 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class Node < Formula + desc "Open-source, cross-platform JavaScript runtime environment" + homepage "https://nodejs.org/" + url "https://homebrew.hyprnet/sources/5d33401fe9f7bdf3f2fdec919770e11cf63b8c3693dd1cd5c6da40b16ee78850--node--26.4.0.x86_64_linux.bottle.tar.gz" + sha256 "9eceb3621024069d91035b5471d2ebe86aa04d22dbeba72a782eaf36ff9183ac" + license "MIT" + compatibility_version 1 + head "https://github.com/nodejs/node.git", branch: "main" + + livecheck do + url "https://nodejs.org/dist/" + regex(%r{href=["']?v?(\d+(?:\.\d+)+)/?["' >]}i) + end + + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 arm64_tahoe: "bbac60159fbed617a409fc241113a7d4824e115c6193df2661c9be6b6ed3f59f" + sha256 arm64_sequoia: "99cef8119eebd10eeedd277f9abd5ef22e1dabb7ee497c99fa4409c201ac9f4d" + sha256 arm64_sonoma: "c8797fda23595d84fa8a8e68cedd62c63c5ff50228ac8a9fa3f6528da83a9e65" + sha256 sonoma: "49a0dba0e9620845c2fb4a4eaec604ac90d013773e4e02945eca9e167d7e3be9" + sha256 arm64_linux: "3cf5b744223b997a37f12a87a5cdaf09308c0575ffe245af1b1ebb9cdfb80f28" + sha256 x86_64_linux: "4553aa69ff2ed12259d799b995fce3922861cf181db9c7ab51a868fe3fcefcef" + end + + depends_on "pkgconf" => :build + depends_on "python@3.14" => :build + depends_on "ada-url" + depends_on "brotli" + depends_on "c-ares" + depends_on "hdrhistogram_c" + depends_on "icu4c@78" + depends_on "libffi" # System `libffi` is missing some definitions used by node + depends_on "libnghttp2" + depends_on "libnghttp3" + depends_on "libngtcp2" + depends_on "libuv" + depends_on "llhttp" + depends_on "merve" + depends_on "nbytes" + depends_on "openssl@3" + depends_on "simdjson" + depends_on "sqlite" # Fails with macOS sqlite. + depends_on "uvwasi" + depends_on "zstd" + + uses_from_macos "python" + + on_macos do + depends_on "llvm" => :build if DevelopmentTools.clang_build_version <= 1699 + end + + on_linux do + depends_on "zlib-ng-compat" + end + + link_overwrite "bin/npm", "bin/npx" + + # https://github.com/swiftlang/llvm-project/commit/078651b6de4b767b91e3e6a51e5df11a06d7bc4f + fails_with :clang do + build 1699 + cause "needs SFINAE-friendly std::pointer_traits" + end + + # https://github.com/nodejs/node/blob/main/BUILDING.md#supported-toolchains + # https://github.com/ada-url/ada?tab=readme-ov-file#requirements + fails_with :gcc do + version "12" + cause "needs GCC 13 or newer" + end + + # We track major/minor from upstream Node releases. + # We will accept *important* npm patch releases when necessary. + resource "npm" do + url "https://registry.npmjs.org/npm/-/npm-11.17.0.tgz" + sha256 "b290bbb35b9e72c3ef84edbe041f28c4479c4d9ee79f555817b8caafe7ce4bba" + + livecheck do + url "https://raw.githubusercontent.com/nodejs/node/refs/tags/v#{LATEST_VERSION}/deps/npm/package.json" + strategy :json do |json| + json["version"] + end + end + end + + deny_network_access! [:build, :postinstall] + + def install + # Backport fix for bundled LIEF's bundled spdlog's bundled fmt. + # Should be fixed when new LIEF version with following commit is released and used by node: + # https://github.com/lief-project/LIEF/commit/710637216b1f6f19569002d62e43fca201b9d91c + inreplace "deps/LIEF/third-party/spdlog/include/spdlog/fmt/bundled/format.h", + "#ifndef FMT_MODULE\n# include ", + "#ifndef FMT_MODULE\n# include \n# include " + + # make sure subprocesses spawned by make are using our Python 3 + ENV["PYTHON"] = which("python3.14") + + # Ensure Homebrew deps are used + rm_r(["deps/icu-small", "deps/npm"]) + + # Never install the bundled "npm", always prefer our + # installation from tarball for better packaging control. + args = %W[ + --prefix=#{prefix} + --without-npm + --with-intl=system-icu + --shared + --openssl-use-def-ca-store + ] + args << "--tag=head" if build.head? + + # Devendor libraries available as formulae. The following maps the name + # used in configure (e.g. `--shared-`) to the bundled subdirectory + # and corresponding formula name as these can all differ. + { + # flag name sub-directory formula name + "ada" => ["ada", "ada-url"], + "brotli" => ["brotli", "brotli"], + "cares" => ["cares", "c-ares"], + "ffi" => ["libffi", "libffi"], + "hdr-histogram" => ["histogram", "hdrhistogram_c"], + "http-parser" => ["llhttp", "llhttp"], + "libuv" => ["uv", "libuv"], + "merve" => ["merve", "merve"], + "nbytes" => ["nbytes", "nbytes"], + "nghttp2" => ["nghttp2", "libnghttp2"], + "nghttp3" => ["ngtcp2/nghttp3", "libnghttp3"], + "ngtcp2" => ["ngtcp2", "libngtcp2"], + "openssl" => ["openssl/openssl", "openssl@3"], + "simdjson" => ["simdjson", "simdjson"], + "sqlite" => ["sqlite", "sqlite"], + "uvwasi" => ["uvwasi", "uvwasi"], + "zlib" => ["zlib", ("zlib-ng-compat" unless OS.mac?)], + "zstd" => ["zstd", "zstd"], + }.each do |flag, (subdir, formula)| + rm_r(buildpath/"deps"/subdir) + args << "--shared-#{flag}" + if formula + args << "--shared-#{flag}-includes=#{Formula[formula].include}" + args << "--shared-#{flag}-libpath=#{Formula[formula].lib}" + end + end + + # TODO: Try to devendor these libraries. + # - `--shared-gtest` is only used for building the test suite, which we don't run here. + # - `--shared-simdutf` seems to result in build failures. + # - `--shared-temporal_capi` is only used when building with `--v8-enable-temporal-support` + # - `--shared-lief` is not available as dependency in Homebrew. + ignored_shared_flags = %w[ + gtest + simdutf + temporal_capi + lief + ].map { |library| "--shared-#{library}" } + + configure_help = Utils.safe_popen_read("./configure", "--help") + shared_flag_regex = /\[(--shared-[^ \]]+)\]/ + configure_help.scan(shared_flag_regex) do |matches| + matches.each do |flag| + next if args.include?(flag) || ignored_shared_flags.include?(flag) + + message = "Unused `--shared-*` flag: #{flag}" + if build.head? + opoo message + else + odie message + end + end + end + + # Enabling LTO errors on Linux with: + # terminate called after throwing an instance of 'std::out_of_range' + # macOS also can't build with LTO when using LLVM Clang + # LTO is unpleasant if you have to build from source. + # FIXME: re-enable me, currently crashes sequoia runner after 6 hours + # args << "--enable-lto" if OS.mac? && DevelopmentTools.clang_build_version > 1699 && build.bottle? + + system "./configure", *args + system "make", "install" + + # Allow npm to find Node before installation has completed. + ENV.prepend_path "PATH", bin + + bootstrap = buildpath/"npm_bootstrap" + bootstrap.install resource("npm") + # These dirs must exists before npm install. + mkdir_p libexec/"lib" + system "node", bootstrap/"bin/npm-cli.js", "install", "-ddd", "--global", + "--prefix=#{libexec}", resource("npm").cached_download + + # The `package.json` stores integrity information about the above passed + # in `cached_download` npm resource, which breaks `npm -g outdated npm`. + # This copies back over the vanilla `package.json` to fix this issue. + cp bootstrap/"package.json", libexec/"lib/node_modules/npm" + + # These symlinks are never used & they've caused issues in the past. + rm_r libexec/"share" if (libexec/"share").exist? + + # Create temporary npm and npx symlinks until post_install is done. + ln_s libexec/"lib/node_modules/npm/bin/npm-cli.js", bin/"npm" + ln_s libexec/"lib/node_modules/npm/bin/npx-cli.js", bin/"npx" + + # Use the _npm completion included in Zsh rather than generating broken completion + generate_completions_from_executable(bin/"npm", "completion", shells: [:bash], shell_parameter_format: :none) + end + + def post_install + node_modules = HOMEBREW_PREFIX/"lib/node_modules" + node_modules.mkpath + # Remove npm but preserve all other modules across node updates/upgrades. + rm_r node_modules/"npm" if (node_modules/"npm").exist? + + cp_r libexec/"lib/node_modules/npm", node_modules + # This symlink doesn't hop into homebrew_prefix/bin automatically so + # we make our own. This is a small consequence of our + # bottle-npm-and-retain-a-private-copy-in-libexec setup + # All other installs **do** symlink to homebrew_prefix/bin correctly. + # We ln rather than cp this because doing so mimics npm's normal install. + ln_sf node_modules/"npm/bin/npm-cli.js", bin/"npm" + ln_sf node_modules/"npm/bin/npx-cli.js", bin/"npx" + ln_sf bin/"npm", HOMEBREW_PREFIX/"bin/npm" + ln_sf bin/"npx", HOMEBREW_PREFIX/"bin/npx" + + # Create manpage symlinks (or overwrite the old ones) + %w[man1 man5 man7].each do |man| + # Dirs must exist first: https://github.com/Homebrew/legacy-homebrew/issues/35969 + mkdir_p HOMEBREW_PREFIX/"share/man/#{man}" + # still needed to migrate from copied file manpages to symlink manpages + rm(Dir[HOMEBREW_PREFIX/"share/man/#{man}/{npm.,npm-,npmrc.,package.json.,npx.}*"]) + ln_sf Dir[node_modules/"npm/man/#{man}/{npm,package-,shrinkwrap-,npx}*"], HOMEBREW_PREFIX/"share/man/#{man}" + end + + (node_modules/"npm/npmrc").atomic_write("prefix = #{HOMEBREW_PREFIX}\n") + end + + test do + path = testpath/"test.js" + path.write "console.log('hello');" + + output = shell_output("#{bin}/node #{path}").strip + assert_equal "hello", output + output = shell_output("#{bin}/node -e 'console.log(new Intl.NumberFormat(\"en-EN\").format(1234.56))'").strip + assert_equal "1,234.56", output + + output = shell_output("#{bin}/node -e 'console.log(new Intl.NumberFormat(\"de-DE\").format(1234.56))'").strip + assert_equal "1.234,56", output + + # make sure npm can find node + ENV.prepend_path "PATH", opt_bin + ENV.delete "NVM_NODEJS_ORG_MIRROR" + assert_equal which("node"), opt_bin/"node" + assert_path_exists HOMEBREW_PREFIX/"bin/npm", "npm must exist" + assert_predicate HOMEBREW_PREFIX/"bin/npm", :executable?, "npm must be executable" + npm_args = ["-ddd", "--cache=#{HOMEBREW_CACHE}/npm_cache", "--build-from-source"] + system HOMEBREW_PREFIX/"bin/npm", *npm_args, "install", "npm@latest" + system HOMEBREW_PREFIX/"bin/npm", *npm_args, "install", "nan" + assert_path_exists HOMEBREW_PREFIX/"bin/npx", "npx must exist" + assert_predicate HOMEBREW_PREFIX/"bin/npx", :executable?, "npx must be executable" + assert_match "< hello >", shell_output("#{HOMEBREW_PREFIX}/bin/npx --yes cowsay hello") + + # Test `uvwasi` is linked correctly + (testpath/"wasi-smoke-test.mjs").write <<~JAVASCRIPT + import { WASI } from 'node:wasi'; + + // Minimal WASM that: + // - imports wasi proc_exit(i32)->() + // - exports memory (required by Node's WASI binding) + // - exports _start which calls proc_exit(42) + const wasmBytes = new Uint8Array([ + // \0asm + version + 0x00,0x61,0x73,0x6d, 0x01,0x00,0x00,0x00, + + // Type section: 2 types: (i32)->() and ()->() + 0x01,0x08, 0x02, + 0x60,0x01,0x7f,0x00, + 0x60,0x00,0x00, + + // Import section: wasi_snapshot_preview1.proc_exit : func(type 0) + 0x02,0x24, 0x01, + 0x16, // module name len = 22 + 0x77,0x61,0x73,0x69,0x5f,0x73,0x6e,0x61,0x70,0x73,0x68,0x6f,0x74,0x5f,0x70,0x72,0x65,0x76,0x69,0x65,0x77,0x31, + 0x09, // name len = 9 + 0x70,0x72,0x6f,0x63,0x5f,0x65,0x78,0x69,0x74, + 0x00, // import kind = func + 0x00, // type index 0 + + // Function section: 1 function (type index 1 = ()->()) + 0x03,0x02, 0x01, 0x01, + + // Memory section: one memory with min=1 page; export later + 0x05,0x03, 0x01, 0x00, 0x01, + + // Export section: export "_start" (func 1) and "memory" (mem 0) + 0x07,0x13, 0x02, + 0x06, 0x5f,0x73,0x74,0x61,0x72,0x74, 0x00, 0x01, + 0x06, 0x6d,0x65,0x6d,0x6f,0x72,0x79, 0x02, 0x00, + + // Code section: body for func 1: i32.const 42; call 0; end + 0x0a,0x08, 0x01, + 0x06, 0x00, 0x41,0x2a, 0x10,0x00, 0x0b + ]); + + const wasi = new WASI({ + version: 'preview1', + returnOnExit: true + }); + + const { instance } = await WebAssembly.instantiate(wasmBytes, wasi.getImportObject()); + + // This should return 42 if uvwasi is correctly linked & wired. + const rc = wasi.start(instance); + if (rc === 42) { + console.log('PASS: uvwasi proc_exit(42) worked (exitCode=42)'); + process.exit(0); + } else { + console.error('FAIL: unexpected return', rc); + process.exit(2); + } + JAVASCRIPT + + system bin/"node", "wasi-smoke-test.mjs" + end +end diff --git a/Formula/opencode.rb b/Formula/opencode.rb new file mode 100644 index 0000000..fef3aef --- /dev/null +++ b/Formula/opencode.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class Opencode < Formula + desc "AI coding agent, built for the terminal" + homepage "https://opencode.ai" + url "https://homebrew.hyprnet/sources/43a8ae643c9e1f6a0a519ae80647d6fc3f2289b43797b3ce2791629ea8ad4877--opencode--1.17.10.x86_64_linux.bottle.tar.gz" + sha256 "55213528242c373b3772a04b37ac031e928b96807111f7a6f65869675fa30daa" + license "MIT" + + livecheck do + throttle 5 + end + + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 arm64_tahoe: "4a1f34ef60590a02f899c3eed7ce650dc220220f87446d9f53450246ecc66086" + sha256 arm64_sequoia: "4a1f34ef60590a02f899c3eed7ce650dc220220f87446d9f53450246ecc66086" + sha256 arm64_sonoma: "4a1f34ef60590a02f899c3eed7ce650dc220220f87446d9f53450246ecc66086" + sha256 cellar: :any_skip_relocation, sonoma: "8c2889004e0e489e26c7192dc74a5c7c75997a9ecd51fbf873037f5819294ba3" + sha256 cellar: :any_skip_relocation, arm64_linux: "1fb4569ae37a2e6eb9e9c15039ad3c523fcb07fc91e36d887b53a190647a5d61" + sha256 cellar: :any_skip_relocation, x86_64_linux: "1b96967328fb2e9869343be2d7ff24b830d40b85ea28d15490b22652656aaaaf" + end + + depends_on "node" + depends_on "ripgrep" + + def install + system "npm", "install", *std_npm_args(ignore_scripts: false) + bin.install_symlink libexec.glob("bin/*") + + # Remove binaries for other architectures, `-musl`, `-baseline`, and `-baseline-musl` + arch = Hardware::CPU.arm? ? "arm64" : "x64" + os = OS.linux? ? "linux" : "darwin" + (libexec/"lib/node_modules/opencode-ai/node_modules").children.each do |d| + next unless d.directory? + + rm_r d if d.basename.to_s != "opencode-#{os}-#{arch}" + end + + generate_completions_from_executable(bin/"opencode", "completion", shell_parameter_format: :none, shells: [:zsh]) + end + + test do + assert_match version.to_s, shell_output("#{bin}/opencode --version") + assert_match "opencode", shell_output("#{bin}/opencode models") + end +end diff --git a/Formula/pkgconf.rb b/Formula/pkgconf.rb new file mode 100644 index 0000000..1336372 --- /dev/null +++ b/Formula/pkgconf.rb @@ -0,0 +1,147 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class Pkgconf < Formula + desc "Package compiler and linker metadata toolkit" + homepage "https://github.com/pkgconf/pkgconf" + url "https://homebrew.hyprnet/sources/325cb439c33323ba98a33e8a620cdca8190b3256dfdd768e8bd0a98387970f82--pkgconf--2.5.1.x86_64_linux.bottle.tar.gz" + mirror "https://fossies.org/linux/misc/pkgconf-2.5.1.tar.xz" + mirror "http://fresh-center.net/linux/misc/pkgconf-2.5.1.tar.xz" + sha256 "cd05c9589b9f86ecf044c10a2269822bc9eb001eced2582cfffd658b0a50c243" + license "ISC" + compatibility_version 1 + + livecheck do + url "https://distfiles.ariadne.space/pkgconf/" + regex(/href=.*?pkgconf[._-]v?(\d+\.\d+(?:\.[1-8]?\d(?:\.\d+)*)?)\.t/i) + end + + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 arm64_tahoe: "84f26aae5e27d846e00a9fb741dfe3b02a14cb2f81ca4a4246617379cda99fc0" + sha256 arm64_sequoia: "6fabdc3d0a656e2d505aec4e39b2f8e354601ee141469554fa71eabc3386e18f" + sha256 arm64_sonoma: "bc7f9963756598248220da128a5f06ea0e6685aa7cd965a5ce357fcfaad2cdec" + sha256 arm64_ventura: "8d53ac0deb003f8866315c4c27a1aa4767467c9fa13c912f52cb29e37fbe7916" + sha256 tahoe: "ab1a7c8edaffa3a27400174deb4845140bdd56942d9ab2a7bccdf30f7ef74d91" + sha256 sequoia: "a074f871aa476dec1101c13b4fcfbb9354a8b35bcb6e056f8411463913632071" + sha256 sonoma: "439e8e638986c4423f430719f28cd7c62e8d9a1b87ac658c069fd5da939784f8" + sha256 ventura: "e38acbfd930c9588f4d1eabe061b956948aaff32cccb30c457430779c1e4f7f5" + sha256 arm64_linux: "abdf9fbefab1d7b7219a619fb5bd44b58c00a71146a43cb24b71700c2ead369e" + sha256 x86_64_linux: "9df0ce4d9ebae822b763a9c18565d1596a40b2a2e5849c743e768a99f554f24b" + end + + head do + url "https://github.com/pkgconf/pkgconf.git", branch: "master" + + # Using a resource to avoiding dependency tree from brew `meson` or `muon`. + # The version should align to available HTTP mirror rather than latest. + resource "muon" do + url "https://muon.build/releases/v0.5.0/muon-v0.5.0.tar.gz" + mirror "https://deb.debian.org/debian/pool/main/m/muon-meson/muon-meson_0.5.0.orig.tar.gz" + mirror "http://deb.debian.org/debian/pool/main/m/muon-meson/muon-meson_0.5.0.orig.tar.gz" + sha256 "24aa4d29ed272893f6e6d355b1ec4ef20647438454e88161bdb9defd7c6faf77" + + livecheck do + url "https://deb.debian.org/debian/pool/main/m/muon-meson/" + regex(/href=.*?muon-meson[._-]v?(\d+(?:\.\d+)+)\.orig\.t/i) + end + end + end + + def install + pc_path = %W[ + #{HOMEBREW_PREFIX}/lib/pkgconfig + #{HOMEBREW_PREFIX}/share/pkgconfig + ] + pc_path += if OS.mac? + %W[ + /usr/local/lib/pkgconfig + /usr/lib/pkgconfig + #{HOMEBREW_LIBRARY}/Homebrew/os/mac/pkgconfig/#{MacOS.version} + ] + else + ["#{HOMEBREW_LIBRARY}/Homebrew/os/linux/pkgconfig"] + end + + if build.head? + # Autotools build is planned for removal in pkgconf 3.1 + resource("muon").stage do + args = ["-Dauto_features=disabled"] + system "./bootstrap.sh", "build" + system "build/muon-bootstrap", "meson", "setup", "build", *args, *std_meson_args(prefix: buildpath/"muon") + system "build/muon-bootstrap", "-C", "build", "samu" + system "build/muon", "-C", "build", "install" + ENV.prepend_path "PATH", buildpath/"muon/bin" + end + + args = %W[ + -Dwith-pkg-config-dir=#{pc_path.uniq.join(File::PATH_SEPARATOR)} + -Dwith-system-includedir=#{MacOS.sdk_path if OS.mac?}/usr/include + -Dwith-system-libdir=/usr/lib + ] + + system "muon", "meson", "setup", "build", *args, *std_meson_args + system "muon", "-C", "build", "samu" + system "muon", "-C", "build", "install" + else + args = %W[ + --disable-silent-rules + --with-pkg-config-dir=#{pc_path.uniq.join(File::PATH_SEPARATOR)} + --with-system-includedir=#{MacOS.sdk_path if OS.mac?}/usr/include + --with-system-libdir=/usr/lib + ] + + system "./configure", *args, *std_configure_args + system "make" + system "make", "install" + end + + # Make `pkgconf` a drop-in replacement for `pkg-config` by adding symlink[^1]. + # Similar to Debian[^2], Fedora, ArchLinux and MacPorts. + # + # [^1]: https://github.com/pkgconf/pkgconf/#pkg-config-symlink + # [^2]: https://salsa.debian.org/debian/pkgconf/-/blob/debian/unstable/debian/pkgconf.links?ref_type=heads + bin.install_symlink "pkgconf" => "pkg-config" + man1.install_symlink "pkgconf.1" => "pkg-config.1" + end + + test do + (testpath/"foo.pc").write <<~PC + prefix=/usr + exec_prefix=${prefix} + includedir=${prefix}/include + libdir=${exec_prefix}/lib + + Name: foo + Description: The foo library + Version: 1.0.0 + Cflags: -I${includedir}/foo + Libs: -L${libdir} -lfoo + PC + + ENV["PKG_CONFIG_LIBDIR"] = testpath + system bin/"pkgconf", "--validate", "foo" + assert_equal "1.0.0", shell_output("#{bin}/pkgconf --modversion foo").strip + assert_equal "-lfoo", shell_output("#{bin}/pkgconf --libs-only-l foo").strip + assert_equal "-I/usr/include/foo", shell_output("#{bin}/pkgconf --cflags foo").strip + + (testpath/"test.c").write <<~C + #include + #include + + int main(void) { + assert(pkgconf_compare_version(LIBPKGCONF_VERSION_STR, LIBPKGCONF_VERSION_STR) == 0); + return 0; + } + C + + system ENV.cc, "test.c", "-I#{include}/pkgconf", "-L#{lib}", "-lpkgconf" + system "./a.out" + + # Make sure system-libdir is removed as it can cause problems in superenv + if OS.mac? + ENV.delete "PKG_CONFIG_LIBDIR" + refute_match "-L/usr/lib", shell_output("#{bin}/pkgconf --libs libcurl") + end + end +end diff --git a/Formula/python@3.12.rb b/Formula/python@3.12.rb new file mode 100644 index 0000000..1410604 --- /dev/null +++ b/Formula/python@3.12.rb @@ -0,0 +1,536 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class PythonAT312 < Formula + desc "Interpreted, interactive, object-oriented programming language" + homepage "https://www.python.org/" + url "https://homebrew.hyprnet/sources/cfa99215f876a1a0e713cdffb92f478801ba165f707dd1ebb1f7e03069065d54--python@3.12--3.12.13_4.x86_64_linux.bottle.1.tar.gz" + sha256 "0816c4761c97ecdb3f50a3924de0a93fd78cb63ee8e6c04201ddfaedca500b0b" + license "Python-2.0" + revision 4 + compatibility_version 1 + + livecheck do + url "https://www.python.org/downloads/source/" + regex(%r{href=.*?/Python[._-]v?(3\.12(?:\.\d+)*)\.t}i) + end + + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 1 + sha256 arm64_tahoe: "4b2cf1174957cdfb7f95dacb9135ef47c57a7cc52f2ac590a9f7284cdfea0e63" + sha256 arm64_sequoia: "4f06f0e4e2b57b84574e69acb259a999cea8973aab52dff12efd7362edf8fa23" + sha256 arm64_sonoma: "d9028cedd1255cff9178ce3d999a32da15d56c297367c9f7c51d5f913bdfce1d" + sha256 tahoe: "3c17a3059af9efd973bfa165ab137a6918df1e03de0bde427ef8d192064d5277" + sha256 sequoia: "afc9e76b23fb712f8cec447fdf2d6e470e064cb0470d82a4b3eac6f367b84666" + sha256 sonoma: "552d3ad743dbce80ef456f042c7d58297fa05a5e46e4cd2fe0bd2f3ef305cfb0" + sha256 arm64_linux: "2f6ffdbeb1c72207efa2644c2ac26ac11f1ab8b514165cba67c9a89c48ba54cb" + sha256 x86_64_linux: "6d8adc5a6ad3c7d0085c87892a2ffb571e71739d5199b87413bb4db046eed266" + end + + depends_on "pkgconf" => :build + depends_on "mpdecimal" + depends_on "openssl@3" + depends_on "sqlite" + depends_on "xz" + + uses_from_macos "bzip2" + uses_from_macos "expat", since: :sequoia + uses_from_macos "libedit" + uses_from_macos "libffi" + uses_from_macos "libxcrypt" + uses_from_macos "ncurses" + + on_linux do + depends_on "libnsl" + depends_on "libtirpc" + depends_on "zlib-ng-compat" + end + + link_overwrite "lib/python3.12/site-packages/pip*" + link_overwrite "lib/python3.12/site-packages/wheel*" + + 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 (https://bugs.python.org/issue43976). + # We (ab)use osx_framework_library to exploit pip behaviour to allow --prefix to still work. + patch do + file "Patches/python/3.11-sysconfig.diff" + 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}" + + 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 + + if OS.linux? + # Python's configure adds the system ncurses include entry to CPPFLAGS + # when doing curses header check. The check may fail when there exists + # a 32-bit system ncurses (conflicts with the brewed 64-bit one). + # See https://github.com/Homebrew/linuxbrew-core/pull/22307#issuecomment-781896552 + # We want our ncurses! Override system ncurses includes! + inreplace "configure", 'CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"', + "CPPFLAGS=\"$CPPFLAGS -I#{formula_opt_include("ncurses")}\"" + 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/"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: + INI + 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! + # + 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/python#{version.major_minor} + + Unversioned and major-versioned symlinks `python`, `python3`, `python-config`, `python3-config`, `pip`, `pip3`, etc. pointing to + `python#{version.major_minor}`, `python#{version.major_minor}-config`, `pip#{version.major_minor}` etc., respectively, are installed into + #{opt_libexec}/bin + + If you do not need a specific version of Python, and always want Homebrew's `python3` in your PATH: + brew install python3 + + `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" + + # 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 diff --git a/Formula/python@3.13.rb b/Formula/python@3.13.rb new file mode 100644 index 0000000..7282756 --- /dev/null +++ b/Formula/python@3.13.rb @@ -0,0 +1,522 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class PythonAT313 < Formula + desc "Interpreted, interactive, object-oriented programming language" + homepage "https://www.python.org/" + url "https://homebrew.hyprnet/sources/e9b4d009367750dcdca7526dc58f3567c67150376b1e5e426975d951a837797e--python@3.13--3.13.14.x86_64_linux.bottle.1.tar.gz" + sha256 "5ae535a36af0ebca6fca176ecb8197f5db9c1cb8c8f0cd12cdf1787046db1f41" + license "Python-2.0" + compatibility_version 1 + + livecheck do + url "https://www.python.org/downloads/source/" + regex(%r{href=.*?/Python[._-]v?(3\.13(?:\.\d+)*)\.t}i) + end + + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 1 + sha256 arm64_tahoe: "7d5422ac58b5f2b258a4d966065567b0e7dece4b296756a4baf7cd9f4d705499" + sha256 arm64_sequoia: "c89d435b09b9a20f300f5a4e529efc8301923233c494f9de35061ddb716fa5ca" + sha256 arm64_sonoma: "9169c3bb2f8708931bb4915294dd992039b8a5445ce033d9e7e44192e58dfe73" + sha256 tahoe: "43aeb92286751c4034162f23ca0a14914b8caae565fbe99045678555fd75e4c7" + sha256 sequoia: "b0eb3efd68405d871e319156774b89bc59674d725c984f18cc45d40b25cd55e9" + sha256 sonoma: "dfec2880df6d6511c01b2709a6edcb050c6f076ce3040f6dd8cb90edb01c6a56" + sha256 arm64_linux: "1dfcc9263858f1998908aa91992f5a69434dc57bc065e9934ccd766a76bd19a3" + sha256 x86_64_linux: "f7178618a83933cd7ec6154cb04f01ccf8cc1b53ac9ea6990ae119123c939dd7" + end + + depends_on "pkgconf" => :build + depends_on "mpdecimal" + depends_on "openssl@3" + depends_on "sqlite" + depends_on "xz" + + 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 "lib/python3.13/site-packages/pip*" + link_overwrite "lib/python3.13/site-packages/wheel*" + + 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/73/7e/d2b04004e1068ad4fdfa2f227b839b5d03e602e47cdbbf49de71137c9546/pip-26.1.tar.gz" + sha256 "81e13ebcca3ffa8cc85e4deff5c27e1ee26dea0aa7fc2f294a073ac208806ff3" + 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 (https://bugs.python.org/issue43976). + # 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" + 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}" + + 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/"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: + INI + 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! + # + 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/python#{version.major_minor} + + Unversioned and major-versioned symlinks `python`, `python3`, `python-config`, `python3-config`, `pip`, `pip3`, etc. pointing to + `python#{version.major_minor}`, `python#{version.major_minor}-config`, `pip#{version.major_minor}` etc., respectively, are installed into + #{opt_libexec}/bin + + If you do not need a specific version of Python, and always want Homebrew's `python3` in your PATH: + brew install python3 + + `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" + + # 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 diff --git a/Formula/python@3.14.rb b/Formula/python@3.14.rb new file mode 100644 index 0000000..090f5d0 --- /dev/null +++ b/Formula/python@3.14.rb @@ -0,0 +1,537 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class PythonAT314 < Formula + desc "Interpreted, interactive, object-oriented programming language" + homepage "https://www.python.org/" + url "https://homebrew.hyprnet/sources/2b4e7dff0f6a16963a67a23ebc57091b355497b33c7cff55596b5349c23a6b56--python@3.14--3.14.6.x86_64_linux.bottle.tar.gz" + 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 + + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 arm64_tahoe: "92810d5e3f7e47b9b49c1bca6fb4d9f3cefbb90c77669f4e6785d0babcc1c1b9" + sha256 arm64_sequoia: "76505a94aa16b62f002671c0a81c64b4704adcdf05411f3e0a386b3c8610c477" + sha256 arm64_sonoma: "41f0fac6d489a149fd99687d96832a9b2b3948a1924140cec812a98752584109" + sha256 tahoe: "82e86b7276eeaf4cf1f336d2732be2ab8915bb92b71ee63609b9cb3a022f9a93" + sha256 sequoia: "7e04ab45b53a87720413627558e8c72ee44aa6991a300903b6b600a49b793c17" + sha256 sonoma: "564b57b5759f74940b826353d37b9e0c0767ff0a663d321330a673e0138b136a" + sha256 arm64_linux: "c7bc359fda22b9bd1083e2b23b2a0e5f235a7ee71aa02751d2d11287d423cd33" + sha256 x86_64_linux: "4bdc2a2fda5f6c7c5307a3bb9d8d33d5fb79d5d1c72c79a7fb1b32a53e68bd1b" + end + + 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 (https://bugs.python.org/issue43976). + # 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" + 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: + INI + 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! + # + 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 diff --git a/Formula/qwen-code.rb b/Formula/qwen-code.rb new file mode 100644 index 0000000..f91e4bf --- /dev/null +++ b/Formula/qwen-code.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class QwenCode < Formula + desc "AI-powered command-line workflow tool for developers" + homepage "https://github.com/QwenLM/qwen-code" + url "https://homebrew.hyprnet/sources/f64f0dad78cc03324512059defc9d8ee2664eecc2305cf9a3601f0f259a4f29a--qwen-code--0.19.6.x86_64_linux.bottle.tar.gz" + sha256 "fd04f660b7552841eb08dba567df4ca76ca9c269cca40cf78f96798d3751403c" + license "Apache-2.0" + + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_tahoe: "a784bd67d3b230bf47418c7f0c7144ded6b7e674828e4d43dd50a3fbf7f18df3" + sha256 cellar: :any, arm64_sequoia: "25a7964b52cfa562af5b89fc91fa0863db34025eff06086edbe82fc66b0fec71" + sha256 cellar: :any, arm64_sonoma: "25a7964b52cfa562af5b89fc91fa0863db34025eff06086edbe82fc66b0fec71" + sha256 cellar: :any, sonoma: "5db8eca7a0de06e326d148f1c972a60b6ae45291e2efed875719dbce7cb0d0cb" + sha256 cellar: :any_skip_relocation, arm64_linux: "12662448af77b37348db14139129206633e7c4b5a04e6b53e11bf33db88a253f" + sha256 cellar: :any_skip_relocation, x86_64_linux: "6201c6ddf6a4040e87ad66d7d6dab86b12712f595acfb26951a2980884965b15" + end + + depends_on "node" + depends_on "ripgrep" + + def install + system "npm", "install", *std_npm_args + bin.install_symlink libexec.glob("bin/*") + + qwen_code = libexec/"lib/node_modules/@qwen-code/qwen-code" + + # Remove incompatible pre-built binaries + rm_r(qwen_code/"vendor/ripgrep") + + os = OS.mac? ? "darwin" : "linux" + arch = Hardware::CPU.intel? ? "x64" : "arm64" + (qwen_code/"node_modules/node-pty/prebuilds").glob("*").each do |dir| + rm_r(dir) if dir.basename.to_s != "#{os}-#{arch}" + end + + qwen_code.glob("node_modules/@qwen-code/audio-capture/prebuilds/*").each do |dir| + rm_r(dir) if dir.basename.to_s != "#{os}-#{arch}" + end + end + + test do + assert_match version.to_s, shell_output("#{bin}/qwen --version") + assert_match "No MCP servers configured.", shell_output("#{bin}/qwen mcp list") + end +end diff --git a/Formula/samba.rb b/Formula/samba.rb new file mode 100644 index 0000000..db99e7a --- /dev/null +++ b/Formula/samba.rb @@ -0,0 +1,197 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class Samba < Formula + # Samba can be used to share directories with the guest in QEMU user-mode + # (SLIRP) networking with the `-net nic -net user,smb=/share/this/with/guest` + # option. The shared folder appears in the guest as "\\10.0.2.4\qemu". + desc "SMB/CIFS file, print, and login server for UNIX" + homepage "https://www.samba.org/" + url "https://homebrew.hyprnet/sources/7d1fdfb253720df5749d34185cf3b8cf5871c7d7f4f94e017646669e543e583b--samba--4.24.4.x86_64_linux.bottle.tar.gz" + sha256 "df2c51ab4361ec626ab9988e5946efcca8465bc7afae834291d5558468265ff8" + license "GPL-3.0-or-later" + compatibility_version 2 + + livecheck do + url "https://www.samba.org/samba/download/" + regex(/href=.*?samba[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 arm64_tahoe: "020aa14f10556645df8a245efe04d5b0cfbe500775ef44e917128e1e6ef01ecc" + sha256 arm64_sequoia: "aa5b0d49e67a434004c08cc4d8193d518a6d6e471ad3acfdac8d1bc0116f1617" + sha256 arm64_sonoma: "7fc12352b4930c666a5d7aa7f1c093e7944f6f68583f8e024426e9881852c1c8" + sha256 sonoma: "8c4d6e86481998d673e38a970f7e9bd172c60f0bd247f9a5ff639f7f28bfe011" + sha256 arm64_linux: "d23f699d3852538106abfd5ccb5e829f265ea0a2f73e9b21e1993c6528b118dc" + sha256 x86_64_linux: "f77689d5460341a5c86d20bd39a6eac65e93976b58c30bd654556cffe5390249" + end + + depends_on "bison" => :build + depends_on "cmocka" => :build + depends_on "pkgconf" => :build + depends_on "gnutls" + # icu4c can get linked if detected by pkg-config and there isn't a way to force disable + # without disabling spotlight support. So we just enable the feature for all systems. + depends_on "icu4c@78" + depends_on "krb5" + depends_on "libtasn1" + depends_on "libxcrypt" + depends_on "lmdb" + depends_on "popt" + depends_on "readline" + depends_on "talloc" + depends_on "tdb" + depends_on "tevent" + + uses_from_macos "flex" => :build + uses_from_macos "perl" => :build + uses_from_macos "python" => :build # configure requires python3 binary + uses_from_macos "libxcrypt" + + on_macos do + depends_on "gettext" + depends_on "openssl@3" + end + + on_linux do + depends_on "libtirpc" + depends_on "zlib-ng-compat" + end + + conflicts_with "jena", because: "both install `tdbbackup` binaries" + conflicts_with "puzzles", because: "both install `net` binaries" + + resource "Parse::Yapp" do + url "https://cpan.metacpan.org/authors/id/W/WB/WBRASWELL/Parse-Yapp-1.21.tar.gz" + sha256 "3810e998308fba2e0f4f26043035032b027ce51ce5c8a52a8b8e340ca65f13e5" + end + + # upstream bug report, https://bugzilla.samba.org/show_bug.cgi?id=10791 + # https://bugzilla.samba.org/show_bug.cgi?id=10626 + # https://bugzilla.samba.org/show_bug.cgi?id=9665 + # upstream pr ref, https://gitlab.com/samba-team/samba/-/merge_requests/3902 + patch do + url "https://gitlab.com/samba-team/samba/-/commit/a2736fe78a4e75e71b9bc53dc24c36d71b911d2a.diff" + sha256 "7d1bf9eb26211e2ab9e3e67ae32308a3704ff9904ab2369e5d863e079ea8a03f" + end + + def install + # Skip building test that fails on ARM with error: initializer element is not a compile-time constant + inreplace "lib/ldb/wscript", /\('test_ldb_comparison_fold',$/, "\\0 enabled=False," if Hardware::CPU.arm? + + # avoid `perl module "Parse::Yapp::Driver" not found` error on macOS 10.xx (not required on 11) + if !OS.mac? || MacOS.version < :big_sur + ENV.prepend_create_path "PERL5LIB", buildpath/"lib/perl5" + ENV.prepend_path "PATH", buildpath/"bin" + resource("Parse::Yapp").stage do + system "perl", "Makefile.PL", "INSTALL_BASE=#{buildpath}" + system "make" + system "make", "install" + end + end + ENV.append "LDFLAGS", "-Wl,-rpath,#{lib}/private" if OS.linux? + + bundled_libs_list = [] + # Upstream (https://github.com/lxin/quic) has no tagged releases, so we would have to add an arbitrary + # commit as a resource. That's not really better than just using the vendored copy. Consider breaking + # it out into a resource or formula once tagged releases become available. + bundled_libs_list << "libquic" if OS.linux? + bundled_libs = bundled_libs_list.empty? ? "NONE" : bundled_libs_list.join(",") + + system "./configure", + "--bundled-libraries=#{bundled_libs}", + "--private-libraries=!ldb", + "--disable-cephfs", + "--disable-cups", + "--disable-iprint", + "--disable-glusterfs", + "--disable-python", + "--without-acl-support", + "--without-ad-dc", + "--without-ads", + "--without-ldap", + "--without-libarchive", + "--without-json", + "--without-pam", + "--without-regedit", + "--without-syslog", + "--without-utmp", + "--without-winbind", + "--with-shared-modules=!vfs_snapper", + "--with-system-mitkrb5", + "--prefix=#{prefix}", + "--libdir=#{lib}", + "--sysconfdir=#{etc}", + "--localstatedir=#{var}" + system "make" + system "make", "install" + return unless OS.mac? + + # macOS has its own SMB daemon as /usr/sbin/smbd, so rename our smbd to samba-dot-org-smbd to avoid conflict. + # samba-dot-org-smbd is used by qemu.rb . + # Rename profiles as well to avoid conflicting with /usr/bin/profiles + mv sbin/"smbd", sbin/"samba-dot-org-smbd" + mv bin/"profiles", bin/"samba-dot-org-profiles" + end + + def caveats + on_macos do + <<~EOS + To avoid conflicting with macOS system binaries, some files were installed with non-standard name: + - smbd: #{HOMEBREW_PREFIX}/sbin/samba-dot-org-smbd + - profiles: #{HOMEBREW_PREFIX}/bin/samba-dot-org-profiles + EOS + end + end + + test do + smbd = if OS.mac? + sbin/"samba-dot-org-smbd" + else + sbin/"smbd" + end + + system smbd, "--build-options", "--configfile=/dev/null" + system smbd, "--version" + + mkdir_p "samba/state" + mkdir_p "samba/data" + (testpath/"samba/data/hello").write "hello" + + # mimic smb.conf generated by qemu + # https://github.com/qemu/qemu/blob/v6.0.0/net/slirp.c#L862 + (testpath/"smb.conf").write <<~CONF + [global] + private dir=#{testpath}/samba/state + interfaces=127.0.0.1 + bind interfaces only=yes + pid directory=#{testpath}/samba/state + lock directory=#{testpath}/samba/state + state directory=#{testpath}/samba/state + cache directory=#{testpath}/samba/state + ncalrpc dir=#{testpath}/samba/state/ncalrpc + log file=#{testpath}/samba/state/log.smbd + smb passwd file=#{testpath}/samba/state/smbpasswd + security = user + map to guest = Bad User + load printers = no + printing = bsd + disable spoolss = yes + usershare max shares = 0 + [test] + path=#{testpath}/samba/data + read only=no + guest ok=yes + force user=#{ENV["USER"]} + CONF + + port = free_port + spawn smbd, "--debug-stdout", "-F", "--configfile=smb.conf", "--port=#{port}", "--debuglevel=4", in: "/dev/null" + + sleep 5 + mkdir_p "got" + system bin/"smbclient", "-p", port.to_s, "-N", "//127.0.0.1/test", "-c", "get hello #{testpath}/got/hello" + assert_equal "hello", (testpath/"got/hello").read + end +end diff --git a/Formula/wget.rb b/Formula/wget.rb new file mode 100644 index 0000000..7649b43 --- /dev/null +++ b/Formula/wget.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class Wget < Formula + desc "Internet file retriever" + homepage "https://www.gnu.org/software/wget/" + url "https://homebrew.hyprnet/sources/1626775a218d5ab742add9f45026a65b09f405f45d8a4b08bbde3a9859fe04de--wget--1.25.0.x86_64_linux.bottle.2.tar.gz" + sha256 "766e48423e79359ea31e41db9e5c289675947a7fcf2efdcedb726ac9d0da3784" + license "GPL-3.0-or-later" + compatibility_version 1 + + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 2 + sha256 arm64_tahoe: "27e15ca14afaaa7c2016bba7a098452cf66d1d8a74330ed6195a0b6ae7a4dada" + sha256 arm64_sequoia: "aa19cf5de262d5b67631af8288cce233a075c251c68050a1e73699314a911e7b" + sha256 arm64_sonoma: "ebac9bd5e93603af8d3dcf3cfed9924f773e0fa5f8a827c12c69ad07cc80a6de" + sha256 sonoma: "32e76ca0ef4b26d7022dd1cad7621e8cd9bccca7677b7d4646d30d2fa009f413" + sha256 arm64_linux: "f6e698ad339b9d9398f9769ad46ffa999809e9e07ab0e6d9a1537ec136dbaf01" + sha256 x86_64_linux: "8f58b44e7482ee12e910df582cf43a4dadb808e4db70bfc760aaf258942652a5" + end + + head do + url "https://git.savannah.gnu.org/git/wget.git", branch: "master" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "xz" => :build + end + + depends_on "pkgconf" => :build + depends_on "libidn2" + depends_on "libpsl" + depends_on "openssl@3" + + on_macos do + depends_on "gettext" + depends_on "libunistring" + end + + on_linux do + depends_on "util-linux" + depends_on "zlib-ng-compat" + end + + def install + system "./bootstrap", "--skip-po" if build.head? + system "./configure", "--prefix=#{prefix}", + "--sysconfdir=#{etc}", + "--with-ssl=openssl", + "--with-libssl-prefix=#{formula_opt_prefix("openssl@3")}", + "--disable-pcre", + "--disable-pcre2", + "--with-libpsl", + "--without-included-regex" + system "make", "install" + end + + test do + system bin/"wget", "-O", File::NULL, "https://google.com" + + # Verify PSL support is built in via libpsl + assert_match "+psl", shell_output("#{bin}/wget --version") + end +end diff --git a/Formula/zoxide.rb b/Formula/zoxide.rb new file mode 100644 index 0000000..19906de --- /dev/null +++ b/Formula/zoxide.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true +# Generated by generate_tap.py for local/mirror + +class Zoxide < Formula + desc "Shell extension to navigate your filesystem faster" + homepage "https://github.com/ajeetdsouza/zoxide" + url "https://homebrew.hyprnet/sources/a2980a7ff0ba7a747635d2ad348fd2ec568822ffa8f8803db6896ddfbf07540a--zoxide--0.10.0.x86_64_linux.bottle.tar.gz" + sha256 "4fcd4272b013a10b637dbcc299c58a9924b94470a9042677ca1a204cc2e9150e" + license "MIT" + + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "dc0c0099a4fa529d296ccb9e295e1816ded39a89ab816ba7fccec2e739f46974" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "9547dc2a1830e3900f7915b47ac7fa42a3d2d5ee9b125007e7e860920d0e899f" + sha256 cellar: :any_skip_relocation, arm64_sonoma: "0d7fbfa1e878ceefbc5fd0c3d97b8e9c1ae54f81ff79354fa792b59875391818" + sha256 cellar: :any_skip_relocation, sonoma: "d3c9b69ac0b3d814619be69d32acfd5416d9e082ef5cddf21c698a5e0ae90ecb" + sha256 cellar: :any, arm64_linux: "e49cb48600200939509b9d1171c041e36f9d93a5b49559b80ae6279940c14861" + sha256 cellar: :any, x86_64_linux: "2c8a3b3c72267d9ecc0ba764e9338ce6da34dd8eaeb828743f025c9d1c94befa" + end + + depends_on "rust" => :build + + def install + system "cargo", "install", *std_cargo_args + bash_completion.install "contrib/completions/zoxide.bash" => "zoxide" + zsh_completion.install "contrib/completions/_zoxide" + fish_completion.install "contrib/completions/zoxide.fish" + share.install "man" + end + + test do + assert_empty shell_output("#{bin}/zoxide add /").strip + assert_equal "/", shell_output("#{bin}/zoxide query").strip + end +end diff --git a/README.md b/README.md new file mode 100644 index 0000000..78c270b --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# local/mirror + +Generated tap repository. + +Formulae live in `Formula/` and casks live in `Casks/`. +Artifacts are expected under `https://homebrew.hyprnet/sources`, `https://homebrew.hyprnet/bottles`, and `https://homebrew.hyprnet/casks`. diff --git a/tap-manifest.json b/tap-manifest.json new file mode 100644 index 0000000..9a6c309 --- /dev/null +++ b/tap-manifest.json @@ -0,0 +1,141 @@ +{ + "tap_name": "local/mirror", + "mirror_base_url": "https://homebrew.hyprnet", + "formulae": [ + { + "name": "atuin", + "source_url": "https://homebrew.hyprnet/sources/358c49594fdce992e276d27a0f8f2aab40f671f9f089f772331aa6d40cdde689--atuin--18.16.1.x86_64_linux.bottle.1.tar.gz", + "bottles": [] + }, + { + "name": "clang-format", + "source_url": "https://homebrew.hyprnet/sources/c01ebc051b7d6beb690739b66d16f80c2fdd025a38ade481c57108f884e57603--clang-format--22.1.8.x86_64_linux.bottle.tar.gz", + "bottles": [] + }, + { + "name": "docker-compose", + "source_url": "https://homebrew.hyprnet/sources/3703493f0447ff926fca8b7a93fe6597a4225f9d5862cc23466f399a08b8efff--docker-compose--5.3.0.x86_64_linux.bottle.tar.gz", + "bottles": [] + }, + { + "name": "helm", + "source_url": "https://homebrew.hyprnet/sources/3c809b39ccaa77f3d4dbbab3faae9ad1ba7c8bce6310eccc8dae812862c24024--helm--4.2.2.x86_64_linux.bottle.tar.gz", + "bottles": [] + }, + { + "name": "kubernetes-cli", + "source_url": "https://homebrew.hyprnet/sources/7902f16cb564f74289964e1bf0f989e6f395847ea9badb9d0fda9468a692a4ad--kubernetes-cli--1.36.2.x86_64_linux.bottle.tar.gz", + "bottles": [] + }, + { + "name": "mactop", + "source_url": "https://homebrew.hyprnet/sources/98986a2c2d16f785a8f5381537a5c4aa494d4cfabdd8d44a5babf5346d0be9d1--mactop-2.1.5.tar.gz", + "bottles": [] + }, + { + "name": "ncdu", + "source_url": "https://homebrew.hyprnet/sources/023b45ac32cdd77be32bff75872f4d8e4bcacc6926f1af6cbc8d6e51563d2fe4--ncdu--2.9.2.x86_64_linux.bottle.tar.gz", + "bottles": [] + }, + { + "name": "neovim", + "source_url": "https://homebrew.hyprnet/sources/d6e52c537914b924519eb5d74ded1ab922378c2efb1147037e6300dabbdfe5a9--neovim--0.12.4.x86_64_linux.bottle.tar.gz", + "bottles": [] + }, + { + "name": "node", + "source_url": "https://homebrew.hyprnet/sources/5d33401fe9f7bdf3f2fdec919770e11cf63b8c3693dd1cd5c6da40b16ee78850--node--26.4.0.x86_64_linux.bottle.tar.gz", + "bottles": [] + }, + { + "name": "opencode", + "source_url": "https://homebrew.hyprnet/sources/43a8ae643c9e1f6a0a519ae80647d6fc3f2289b43797b3ce2791629ea8ad4877--opencode--1.17.10.x86_64_linux.bottle.tar.gz", + "bottles": [] + }, + { + "name": "pkgconf", + "source_url": "https://homebrew.hyprnet/sources/325cb439c33323ba98a33e8a620cdca8190b3256dfdd768e8bd0a98387970f82--pkgconf--2.5.1.x86_64_linux.bottle.tar.gz", + "bottles": [] + }, + { + "name": "python@3.12", + "source_url": "https://homebrew.hyprnet/sources/cfa99215f876a1a0e713cdffb92f478801ba165f707dd1ebb1f7e03069065d54--python@3.12--3.12.13_4.x86_64_linux.bottle.1.tar.gz", + "bottles": [] + }, + { + "name": "python@3.13", + "source_url": "https://homebrew.hyprnet/sources/e9b4d009367750dcdca7526dc58f3567c67150376b1e5e426975d951a837797e--python@3.13--3.13.14.x86_64_linux.bottle.1.tar.gz", + "bottles": [] + }, + { + "name": "python@3.14", + "source_url": "https://homebrew.hyprnet/sources/2b4e7dff0f6a16963a67a23ebc57091b355497b33c7cff55596b5349c23a6b56--python@3.14--3.14.6.x86_64_linux.bottle.tar.gz", + "bottles": [] + }, + { + "name": "qwen-code", + "source_url": "https://homebrew.hyprnet/sources/f64f0dad78cc03324512059defc9d8ee2664eecc2305cf9a3601f0f259a4f29a--qwen-code--0.19.6.x86_64_linux.bottle.tar.gz", + "bottles": [] + }, + { + "name": "samba", + "source_url": "https://homebrew.hyprnet/sources/7d1fdfb253720df5749d34185cf3b8cf5871c7d7f4f94e017646669e543e583b--samba--4.24.4.x86_64_linux.bottle.tar.gz", + "bottles": [] + }, + { + "name": "wget", + "source_url": "https://homebrew.hyprnet/sources/1626775a218d5ab742add9f45026a65b09f405f45d8a4b08bbde3a9859fe04de--wget--1.25.0.x86_64_linux.bottle.2.tar.gz", + "bottles": [] + }, + { + "name": "zoxide", + "source_url": "https://homebrew.hyprnet/sources/a2980a7ff0ba7a747635d2ad348fd2ec568822ffa8f8803db6896ddfbf07540a--zoxide--0.10.0.x86_64_linux.bottle.tar.gz", + "bottles": [] + } + ], + "casks": [ + { + "name": "android-platform-tools", + "url": "https://homebrew.hyprnet/casks/android-platform-tools/android-platform-tools--platform-tools_r37.0.0-darwin.zip", + "variations": { + "": "https://homebrew.hyprnet/casks/android-platform-tools/android-platform-tools--platform-tools_r37.0.0-darwin.zip", + "x86_64_linux": "https://homebrew.hyprnet/casks/android-platform-tools/android-platform-tools--x86_64_linux--platform-tools_r37.0.0-linux.zip", + "arm64_linux": "https://homebrew.hyprnet/casks/android-platform-tools/android-platform-tools--arm64_linux--platform-tools_r37.0.0-linux.zip" + } + }, + { + "name": "claude-code", + "url": "https://homebrew.hyprnet/casks/claude-code/claude-code--claude", + "variations": { + "": "https://homebrew.hyprnet/casks/claude-code/claude-code--claude", + "golden_gate": "https://homebrew.hyprnet/casks/claude-code/claude-code--golden_gate--claude", + "tahoe": "https://homebrew.hyprnet/casks/claude-code/claude-code--tahoe--claude", + "sequoia": "https://homebrew.hyprnet/casks/claude-code/claude-code--sequoia--claude", + "sonoma": "https://homebrew.hyprnet/casks/claude-code/claude-code--sonoma--claude", + "ventura": "https://homebrew.hyprnet/casks/claude-code/claude-code--ventura--claude", + "monterey": "https://homebrew.hyprnet/casks/claude-code/claude-code--monterey--claude", + "big_sur": "https://homebrew.hyprnet/casks/claude-code/claude-code--big_sur--claude", + "catalina": "https://homebrew.hyprnet/casks/claude-code/claude-code--catalina--claude", + "x86_64_linux": "https://homebrew.hyprnet/casks/claude-code/claude-code--x86_64_linux--claude", + "arm64_linux": "https://homebrew.hyprnet/casks/claude-code/claude-code--arm64_linux--claude" + } + }, + { + "name": "codex", + "url": "https://homebrew.hyprnet/casks/codex/codex--codex-aarch64-apple-darwin.tar.gz", + "variations": { + "": "https://homebrew.hyprnet/casks/codex/codex--codex-aarch64-apple-darwin.tar.gz", + "golden_gate": "https://homebrew.hyprnet/casks/codex/codex--golden_gate--codex-x86_64-apple-darwin.tar.gz", + "tahoe": "https://homebrew.hyprnet/casks/codex/codex--tahoe--codex-x86_64-apple-darwin.tar.gz", + "sequoia": "https://homebrew.hyprnet/casks/codex/codex--sequoia--codex-x86_64-apple-darwin.tar.gz", + "sonoma": "https://homebrew.hyprnet/casks/codex/codex--sonoma--codex-x86_64-apple-darwin.tar.gz", + "ventura": "https://homebrew.hyprnet/casks/codex/codex--ventura--codex-x86_64-apple-darwin.tar.gz", + "monterey": "https://homebrew.hyprnet/casks/codex/codex--monterey--codex-x86_64-apple-darwin.tar.gz", + "big_sur": "https://homebrew.hyprnet/casks/codex/codex--big_sur--codex-x86_64-apple-darwin.tar.gz", + "catalina": "https://homebrew.hyprnet/casks/codex/codex--catalina--codex-x86_64-apple-darwin.tar.gz", + "x86_64_linux": "https://homebrew.hyprnet/casks/codex/codex--x86_64_linux--codex-x86_64-unknown-linux-musl.tar.gz", + "arm64_linux": "https://homebrew.hyprnet/casks/codex/codex--arm64_linux--codex-aarch64-unknown-linux-musl.tar.gz" + } + } + ] +}