diff --git a/Library/Homebrew/dev-cmd/generate-formula-api.rb b/Library/Homebrew/dev-cmd/generate-formula-api.rb index a3fe69de0d..c87dc2a798 100644 --- a/Library/Homebrew/dev-cmd/generate-formula-api.rb +++ b/Library/Homebrew/dev-cmd/generate-formula-api.rb @@ -60,8 +60,6 @@ module Homebrew raise end - homebrew_core_tap_json = JSON.generate(tap.to_internal_api_hash) - File.write("api/internal/v3/homebrew-core.json", homebrew_core_tap_json) unless args.dry_run? canonical_json = JSON.pretty_generate(tap.formula_renames.merge(tap.alias_table)) File.write("_data/formula_canonical.json", "#{canonical_json}\n") unless args.dry_run? end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 4dbd9124f1..889b6b6f58 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -2572,85 +2572,8 @@ class Formula hsh end - def to_internal_api_hash - api_hash = { - "desc" => desc, - "license" => SPDX.license_expression_to_string(license), - "homepage" => homepage, - "urls" => urls_hash.transform_values(&:compact), - "post_install_defined" => post_install_defined?, - "ruby_source_path" => ruby_source_path, - "ruby_source_sha256" => ruby_source_checksum&.hexdigest, - } - - # Exclude default values. - api_hash["revision"] = revision unless revision.zero? - api_hash["version_scheme"] = version_scheme unless version_scheme.zero? - - # Optional values. - api_hash["keg_only_reason"] = keg_only_reason.to_hash if keg_only_reason - api_hash["pour_bottle_only_if"] = self.class.pour_bottle_only_if.to_s if self.class.pour_bottle_only_if - api_hash["link_overwrite"] = self.class.link_overwrite_paths.to_a if self.class.link_overwrite_paths.present? - api_hash["caveats"] = caveats_with_placeholders if caveats - api_hash["service"] = service.to_hash if service? - - if stable - api_hash["version"] = stable&.version&.to_s - api_hash["bottle"] = bottle_hash(compact_for_api: true) if bottle_defined? - end - - if (versioned_formulae_list = versioned_formulae.presence) - # Could we just use `versioned_formulae_names` here instead? - api_hash["versioned_formulae"] = versioned_formulae_list.map(&:name) - end - - if (dependencies = internal_dependencies_hash(:stable).presence) - api_hash["dependencies"] = dependencies - end - - if (head_dependencies = internal_dependencies_hash(:head).presence) - api_hash["head_dependencies"] = head_dependencies - end - - if (requirements_array = serialized_requirements.presence) - api_hash["requirements"] = requirements_array - end - - if conflicts.present? - api_hash["conflicts_with"] = conflicts.map(&:name) - api_hash["conflicts_with_reasons"] = conflicts.map(&:reason) - end - - if deprecation_date - api_hash["deprecation_date"] = deprecation_date - api_hash["deprecation_reason"] = deprecation_reason - api_hash["deprecation_replacement"] = deprecation_replacement - end - - if disable_date - api_hash["disable_date"] = disable_date - api_hash["disable_reason"] = disable_reason - api_hash["disable_replacement"] = disable_replacement - end - - api_hash - end - - def to_hash_with_variations(hash_method: :to_hash) - if loaded_from_api? && hash_method == :to_internal_api_hash - raise ArgumentError, "API Hash must be generated from Ruby source files" - end - - namespace_prefix = case hash_method - when :to_hash - "Variations" - when :to_internal_api_hash - "APIVariations" - else - raise ArgumentError, "Unknown hash method #{hash_method.inspect}" - end - - hash = public_send(hash_method) + def to_hash_with_variations + hash = to_hash # Take from API, merging in local install status. if loaded_from_api? && !Homebrew::EnvConfig.no_install_from_api? @@ -2669,13 +2592,13 @@ class Formula next unless bottle_tag.valid_combination? Homebrew::SimulateSystem.with(os:, arch:) do - variations_namespace = Formulary.class_s("#{namespace_prefix}#{bottle_tag.to_sym.capitalize}") + variations_namespace = Formulary.class_s("Variations#{bottle_tag.to_sym.capitalize}") variations_formula_class = Formulary.load_formula(name, path, formula_contents, variations_namespace, flags: self.class.build_flags, ignore_errors: true) variations_formula = variations_formula_class.new(name, path, :stable, alias_path:, force_bottle:) - variations_formula.public_send(hash_method).each do |key, value| + variations_formula.to_hash.each do |key, value| next if value.to_s == hash[key].to_s variations[bottle_tag.to_sym] ||= {} @@ -2685,12 +2608,12 @@ class Formula end end - hash["variations"] = variations if hash_method != :to_internal_api_hash || variations.present? + hash["variations"] = variations hash end # Returns the bottle information for a formula. - def bottle_hash(compact_for_api: false) + def bottle_hash hash = {} stable_spec = stable return hash unless stable_spec @@ -2698,8 +2621,8 @@ class Formula bottle_spec = stable_spec.bottle_specification - hash["rebuild"] = bottle_spec.rebuild if !compact_for_api || !bottle_spec.rebuild.zero? - hash["root_url"] = bottle_spec.root_url unless compact_for_api + hash["rebuild"] = bottle_spec.rebuild + hash["root_url"] = bottle_spec.root_url hash["files"] = {} bottle_spec.collector.each_tag do |tag| @@ -2710,11 +2633,9 @@ class Formula file_hash = {} file_hash["cellar"] = os_cellar - unless compact_for_api - filename = Bottle::Filename.create(self, tag, bottle_spec.rebuild) - path, = Utils::Bottles.path_resolved_basename(bottle_spec.root_url, name, checksum, filename) - file_hash["url"] = "#{bottle_spec.root_url}/#{path}" - end + filename = Bottle::Filename.create(self, tag, bottle_spec.rebuild) + path, = Utils::Bottles.path_resolved_basename(bottle_spec.root_url, name, checksum, filename) + file_hash["url"] = "#{bottle_spec.root_url}/#{path}" file_hash["sha256"] = checksum hash["files"][tag.to_sym] = file_hash diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index 340f9c71a5..40b3ebec8e 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -1400,23 +1400,6 @@ class CoreTap < AbstractCoreTap end end end - - sig { returns(T::Hash[String, T.untyped]) } - def to_internal_api_hash - formulae_api_hash = formula_names.to_h do |name| - formula = Formulary.factory(name) - formula_hash = formula.to_hash_with_variations(hash_method: :to_internal_api_hash) - [name, formula_hash] - end - - { - "tap_git_head" => git_head, - "aliases" => alias_table, - "renames" => formula_renames, - "tap_migrations" => tap_migrations, - "formulae" => formulae_api_hash, - } - end end # A specialized {Tap} class for homebrew-cask. diff --git a/Library/Homebrew/test/api/internal_tap_json/formula_spec.rb b/Library/Homebrew/test/api/internal_tap_json/formula_spec.rb deleted file mode 100644 index 6e79402e99..0000000000 --- a/Library/Homebrew/test/api/internal_tap_json/formula_spec.rb +++ /dev/null @@ -1,170 +0,0 @@ -# frozen_string_literal: true - -RSpec.describe "Internal Tap JSON -- Formula", type: :system do - include FileUtils - - let(:internal_tap_json) { File.read(TEST_FIXTURE_DIR/"internal_tap_json/homebrew-core.json").chomp } - let(:tap_git_head) { "9977471165641744a829d3e494fa563407503297" } - - context "when generating JSON", :needs_macos do - before do - cp_r(TEST_FIXTURE_DIR/"internal_tap_json/homebrew-core", HOMEBREW_TAP_DIRECTORY/"homebrew") - - # NOTE: Symlinks can't be copied recursively so we create them manually here. - (HOMEBREW_TAP_DIRECTORY/"homebrew/homebrew-core").tap do |core_tap| - mkdir(core_tap/"Aliases") - ln_s(core_tap/"Formula/f/fennel.rb", core_tap/"Aliases/fennel-lang") - ln_s(core_tap/"Formula/p/ponyc.rb", core_tap/"Aliases/ponyc-lang") - end - end - - it "creates the expected hash" do - api_hash = CoreTap.instance.to_internal_api_hash - api_hash["tap_git_head"] = tap_git_head # tricky to mock - - expect(JSON.pretty_generate(api_hash)).to eq(internal_tap_json) - end - end - - context "when loading JSON" do - before do - ENV["HOMEBREW_INTERNAL_JSON_V3"] = "1" - ENV.delete("HOMEBREW_NO_INSTALL_FROM_API") - - allow(Homebrew::API).to receive(:fetch_json_api_file) - .with("internal/v3/homebrew-core.jws.json") - .and_return([JSON.parse(internal_tap_json, freeze: true), false]) - - # `Tap.tap_migration_oldnames` looks for renames in every - # tap so `CoreCaskTap.tap_migrations` gets called and tries to - # fetch stuff from the API. This just avoids errors. - allow(Homebrew::API).to receive(:fetch_json_api_file) - .with("cask_tap_migrations.jws.json", anything) - .and_return([{}, false]) - - # To allow `formula_names.txt` to be written to the cache. - (HOMEBREW_CACHE/"api").mkdir - end - - it "loads tap aliases" do - expect(CoreTap.instance.alias_table).to eq({ - "fennel-lang" => "fennel", - "ponyc-lang" => "ponyc", - }) - end - - it "loads formula renames" do - expect(CoreTap.instance.formula_renames).to eq({ - "advancemenu" => "advancemame", - "amtk" => "libgedit-amtk", - "annie" => "lux", - "antlr2" => "antlr@2", - "romanesco" => "fennel", - }) - end - - it "loads tap migrations" do - expect(CoreTap.instance.tap_migrations).to eq({ - "adobe-air-sdk" => "homebrew/cask", - "android-ndk" => "homebrew/cask", - "android-platform-tools" => "homebrew/cask", - "android-sdk" => "homebrew/cask", - "app-engine-go-32" => "homebrew/cask/google-cloud-sdk", - }) - end - - it "loads tap git head" do - expect(Homebrew::API::Formula.tap_git_head) - .to eq(tap_git_head) - end - - context "when loading formulae" do - let(:fennel_metadata) do - { - "dependencies" => ["lua"], - "desc" => "Lua Lisp Language", - "full_name" => "fennel", - "homepage" => "https://fennel-lang.org", - "license" => "MIT", - "name" => "fennel", - "ruby_source_path" => "Formula/f/fennel.rb", - "tap" => "homebrew/core", - "tap_git_head" => tap_git_head, - "versions" => { "bottle"=>true, "head"=>nil, "stable"=>"1.4.0" }, - "ruby_source_checksum" => { - "sha256" => "5856e655fd1cea11496d67bc27fb14fee5cfbdea63c697c3773c7f247581197d", - }, - } - end - - let(:ponyc_metadata) do - { - "desc" => "Object-oriented, actor-model, capabilities-secure programming language", - "full_name" => "ponyc", - "homepage" => "https://www.ponylang.io/", - "license" => "BSD-2-Clause", - "name" => "ponyc", - "ruby_source_path" => "Formula/p/ponyc.rb", - "tap" => "homebrew/core", - "tap_git_head" => tap_git_head, - "uses_from_macos" => [{ "llvm"=>[:build, :test] }, "zlib"], - "uses_from_macos_bounds" => [{}, {}], - "versions" => { "bottle"=>true, "head"=>nil, "stable"=>"0.58.1" }, - "ruby_source_checksum" => { - "sha256" => "81d51c25d18710191beb62f9f380bae3d878aad815a65ec1ee2a3b132c1fadb3", - }, - } - end - - let(:inko_metadata) do - { - "desc" => "Safe and concurrent object-oriented programming language", - "full_name" => "inko", - "homepage" => "https://inko-lang.org/", - "license" => "MPL-2.0", - "name" => "inko", - "ruby_source_path" => "Formula/i/inko.rb", - "tap" => "homebrew/core", - "tap_git_head" => tap_git_head, - "dependencies" => ["llvm@15", "zstd"], - "uses_from_macos" => ["libffi", "ruby"], - "uses_from_macos_bounds" => [{ since: :catalina }, { since: :sierra }], - "versions" => { "bottle"=>true, "head"=>"HEAD", "stable"=>"0.14.0" }, - "ruby_source_checksum" => { - "sha256" => "843f6b5652483b971c83876201d68c95d5f32e67e55a75ac7c95d68c4350aa1c", - }, - } - end - - it "loads fennel" do - fennel = Formulary.factory("fennel") - expect(fennel.to_hash).to include(**fennel_metadata) - end - - it "loads fennel from rename" do - fennel = Formulary.factory("romanesco") - expect(fennel.to_hash).to include(**fennel_metadata) - end - - it "loads fennel from alias" do - fennel = Formulary.factory("fennel-lang") - expect(fennel.to_hash).to include(**fennel_metadata) - end - - it "loads ponyc" do - ponyc = Formulary.factory("ponyc") - expect(ponyc.to_hash).to include(**ponyc_metadata) - end - - it "loads ponyc from alias" do - ponyc = Formulary.factory("ponyc-lang") - expect(ponyc.to_hash).to include(**ponyc_metadata) - end - - it "loads ink" do - inko = Formulary.factory("inko") - expect(inko.to_hash).to include(**inko_metadata) - end - end - end -end diff --git a/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core.json b/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core.json deleted file mode 100644 index b704184417..0000000000 --- a/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core.json +++ /dev/null @@ -1,218 +0,0 @@ -{ - "tap_git_head": "9977471165641744a829d3e494fa563407503297", - "aliases": { - "fennel-lang": "fennel", - "ponyc-lang": "ponyc" - }, - "renames": { - "advancemenu": "advancemame", - "amtk": "libgedit-amtk", - "annie": "lux", - "antlr2": "antlr@2", - "romanesco": "fennel" - }, - "tap_migrations": { - "adobe-air-sdk": "homebrew/cask", - "android-ndk": "homebrew/cask", - "android-platform-tools": "homebrew/cask", - "android-sdk": "homebrew/cask", - "app-engine-go-32": "homebrew/cask/google-cloud-sdk" - }, - "formulae": { - "fennel": { - "desc": "Lua Lisp Language", - "license": "MIT", - "homepage": "https://fennel-lang.org", - "urls": { - "stable": { - "url": "https://github.com/bakpakin/Fennel/archive/refs/tags/1.4.0.tar.gz", - "checksum": "161eb7f17f86e95de09070214d042fb25372f71ad266f451431f3109e87965c7" - } - }, - "post_install_defined": false, - "ruby_source_path": "Formula/f/fennel.rb", - "ruby_source_sha256": "5856e655fd1cea11496d67bc27fb14fee5cfbdea63c697c3773c7f247581197d", - "version": "1.4.0", - "bottle": { - "files": { - "all": { - "cellar": ":any_skip_relocation", - "sha256": "f46028597883cbc38864c61bd3fa402da9cb90ce97415d51a7b5279bc17f7bd0" - } - } - }, - "dependencies": { - "lua": null - } - }, - "inko": { - "desc": "Safe and concurrent object-oriented programming language", - "license": "MPL-2.0", - "homepage": "https://inko-lang.org/", - "urls": { - "stable": { - "url": "https://releases.inko-lang.org/0.14.0.tar.gz", - "checksum": "4e2c82911d6026f76c42ccc164dc45b1b5e331db2e9557460d9319d682668e65" - }, - "head": { - "url": "https://github.com/inko-lang/inko.git", - "branch": "main" - } - }, - "post_install_defined": false, - "ruby_source_path": "Formula/i/inko.rb", - "ruby_source_sha256": "843f6b5652483b971c83876201d68c95d5f32e67e55a75ac7c95d68c4350aa1c", - "version": "0.14.0", - "bottle": { - "files": { - "arm64_sonoma": { - "cellar": ":any", - "sha256": "f6ff66fdfb3aac69263c32a8a29d13e9d28a80ae33807f34460e55d8c1b228c6" - }, - "arm64_ventura": { - "cellar": ":any", - "sha256": "be59d916d29d85bb8bc4474eb1c7d42a56236835c3c21b0e36fb9e9df0a25e6e" - }, - "arm64_monterey": { - "cellar": ":any", - "sha256": "9522c1f89b997dedaa3167ce4dbfa4a2d8c660acddecd32a99a515922e851b52" - }, - "sonoma": { - "cellar": ":any", - "sha256": "8e32d823ce9712ae2d5a2b9cbe0c9b727223098b3e66b003da087032be9f6818" - }, - "ventura": { - "cellar": ":any", - "sha256": "178865db1e2b60b4085a2465e8a3879794030a6d22c99b58c95e4bdf5418ef1b" - }, - "monterey": { - "cellar": ":any", - "sha256": "6ef924939c42d7bb2ec4e0d65cf293147a593f829619928d2580b419ec19b26c" - }, - "x86_64_linux": { - "cellar": ":any_skip_relocation", - "sha256": "14a02c119990d6a17062290439ac74e6667b41dcb90b18cd90b36d2a09715e10" - } - } - }, - "dependencies": { - "coreutils": { - "tags": [ - "build" - ] - }, - "rust": { - "tags": [ - "build" - ] - }, - "llvm@15": null, - "zstd": null, - "libffi": { - "uses_from_macos": { - "since": "catalina" - } - }, - "ruby": { - "uses_from_macos": { - "since": "sierra" - } - } - }, - "head_dependencies": { - "coreutils": { - "tags": [ - "build" - ] - }, - "rust": { - "tags": [ - "build" - ] - }, - "llvm@15": null, - "zstd": null, - "libffi": { - "uses_from_macos": { - "since": "catalina" - } - }, - "ruby": { - "uses_from_macos": { - "since": "sierra" - } - } - } - }, - "ponyc": { - "desc": "Object-oriented, actor-model, capabilities-secure programming language", - "license": "BSD-2-Clause", - "homepage": "https://www.ponylang.io/", - "urls": { - "stable": { - "url": "https://github.com/ponylang/ponyc.git", - "tag": "0.58.1", - "revision": "fe3895eb4af494bf36d7690641bdfb5755db8350" - } - }, - "post_install_defined": false, - "ruby_source_path": "Formula/p/ponyc.rb", - "ruby_source_sha256": "81d51c25d18710191beb62f9f380bae3d878aad815a65ec1ee2a3b132c1fadb3", - "version": "0.58.1", - "bottle": { - "files": { - "arm64_sonoma": { - "cellar": ":any_skip_relocation", - "sha256": "e3aecfcf02aea56d53d82691e2ad7a780f771023d7070271bfce96b17439a34d" - }, - "arm64_ventura": { - "cellar": ":any_skip_relocation", - "sha256": "6ff83717191e16e4f852fb3be8f838afba312cc39e601bb5cebd2a618a328658" - }, - "arm64_monterey": { - "cellar": ":any_skip_relocation", - "sha256": "25c91bce200583a96f4cea34f31393c8f10eadcab363cc7d4d864d15f5f97e25" - }, - "sonoma": { - "cellar": ":any_skip_relocation", - "sha256": "5f4c550ce33e2970e0ada18a409755fa62936181289a21c15582ff80343866b6" - }, - "ventura": { - "cellar": ":any_skip_relocation", - "sha256": "f26c799f45013685da779bf2008ebe1907f9b3a93d5f260ce271a3f3b628da50" - }, - "monterey": { - "cellar": ":any_skip_relocation", - "sha256": "1cff10d068b36b18b253d235424c4f5aef71ff9ee44f2522c4b041dd4383ec30" - }, - "x86_64_linux": { - "cellar": ":any_skip_relocation", - "sha256": "ab49318d75eed3ee932c8e5add22f252ec0c852aad94945022877f926e93899f" - } - } - }, - "dependencies": { - "cmake": { - "tags": [ - "build" - ] - }, - "python@3.12": { - "tags": [ - "build" - ] - }, - "llvm": { - "tags": [ - "build", - "test" - ], - "uses_from_macos": null - }, - "zlib": { - "uses_from_macos": null - } - } - } - } -} diff --git a/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core/Formula/f/fennel.rb b/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core/Formula/f/fennel.rb deleted file mode 100644 index c98a3f26c2..0000000000 --- a/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core/Formula/f/fennel.rb +++ /dev/null @@ -1,25 +0,0 @@ -class Fennel < Formula - desc "Lua Lisp Language" - homepage "https://fennel-lang.org" - url "https://github.com/bakpakin/Fennel/archive/refs/tags/1.4.0.tar.gz" - sha256 "161eb7f17f86e95de09070214d042fb25372f71ad266f451431f3109e87965c7" - license "MIT" - - bottle do - sha256 cellar: :any_skip_relocation, all: "f46028597883cbc38864c61bd3fa402da9cb90ce97415d51a7b5279bc17f7bd0" - end - - depends_on "lua" - - def install - system "make" - bin.install "fennel" - - lua = Formula["lua"] - (share/"lua"/lua.version.major_minor).install "fennel.lua" - end - - test do - assert_match "hello, world!", shell_output("#{bin}/fennel -e '(print \"hello, world!\")'") - end -end diff --git a/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core/Formula/i/inko.rb b/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core/Formula/i/inko.rb deleted file mode 100644 index 9f56b2d0f4..0000000000 --- a/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core/Formula/i/inko.rb +++ /dev/null @@ -1,45 +0,0 @@ -class Inko < Formula - desc "Safe and concurrent object-oriented programming language" - homepage "https://inko-lang.org/" - url "https://releases.inko-lang.org/0.14.0.tar.gz" - sha256 "4e2c82911d6026f76c42ccc164dc45b1b5e331db2e9557460d9319d682668e65" - license "MPL-2.0" - head "https://github.com/inko-lang/inko.git", branch: "main" - - bottle do - sha256 cellar: :any, arm64_sonoma: "f6ff66fdfb3aac69263c32a8a29d13e9d28a80ae33807f34460e55d8c1b228c6" - sha256 cellar: :any, arm64_ventura: "be59d916d29d85bb8bc4474eb1c7d42a56236835c3c21b0e36fb9e9df0a25e6e" - sha256 cellar: :any, arm64_monterey: "9522c1f89b997dedaa3167ce4dbfa4a2d8c660acddecd32a99a515922e851b52" - sha256 cellar: :any, sonoma: "8e32d823ce9712ae2d5a2b9cbe0c9b727223098b3e66b003da087032be9f6818" - sha256 cellar: :any, ventura: "178865db1e2b60b4085a2465e8a3879794030a6d22c99b58c95e4bdf5418ef1b" - sha256 cellar: :any, monterey: "6ef924939c42d7bb2ec4e0d65cf293147a593f829619928d2580b419ec19b26c" - sha256 cellar: :any_skip_relocation, x86_64_linux: "14a02c119990d6a17062290439ac74e6667b41dcb90b18cd90b36d2a09715e10" - end - - depends_on "coreutils" => :build - depends_on "rust" => :build - depends_on "llvm@15" - depends_on "zstd" - - uses_from_macos "libffi", since: :catalina - uses_from_macos "ruby", since: :sierra - - def install - ENV.prepend_path "PATH", Formula["coreutils"].opt_libexec/"gnubin" - system "make", "build", "PREFIX=#{prefix}" - system "make", "install", "PREFIX=#{prefix}" - end - - test do - (testpath/"hello.inko").write <<~EOS - import std.stdio.STDOUT - - class async Main { - fn async main { - STDOUT.new.print('Hello, world!') - } - } - EOS - assert_equal "Hello, world!\n", shell_output("#{bin}/inko run hello.inko") - end -end diff --git a/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core/Formula/p/ponyc.rb b/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core/Formula/p/ponyc.rb deleted file mode 100644 index 63ad8bdfab..0000000000 --- a/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core/Formula/p/ponyc.rb +++ /dev/null @@ -1,60 +0,0 @@ -class Ponyc < Formula - desc "Object-oriented, actor-model, capabilities-secure programming language" - homepage "https://www.ponylang.io/" - url "https://github.com/ponylang/ponyc.git", - tag: "0.58.1", - revision: "fe3895eb4af494bf36d7690641bdfb5755db8350" - license "BSD-2-Clause" - - bottle do - sha256 cellar: :any_skip_relocation, arm64_sonoma: "e3aecfcf02aea56d53d82691e2ad7a780f771023d7070271bfce96b17439a34d" - sha256 cellar: :any_skip_relocation, arm64_ventura: "6ff83717191e16e4f852fb3be8f838afba312cc39e601bb5cebd2a618a328658" - sha256 cellar: :any_skip_relocation, arm64_monterey: "25c91bce200583a96f4cea34f31393c8f10eadcab363cc7d4d864d15f5f97e25" - sha256 cellar: :any_skip_relocation, sonoma: "5f4c550ce33e2970e0ada18a409755fa62936181289a21c15582ff80343866b6" - sha256 cellar: :any_skip_relocation, ventura: "f26c799f45013685da779bf2008ebe1907f9b3a93d5f260ce271a3f3b628da50" - sha256 cellar: :any_skip_relocation, monterey: "1cff10d068b36b18b253d235424c4f5aef71ff9ee44f2522c4b041dd4383ec30" - sha256 cellar: :any_skip_relocation, x86_64_linux: "ab49318d75eed3ee932c8e5add22f252ec0c852aad94945022877f926e93899f" - end - - depends_on "cmake" => :build - depends_on "python@3.12" => :build - - uses_from_macos "llvm" => [:build, :test] - uses_from_macos "zlib" - - # We use LLVM to work around an error while building bundled `google-benchmark` with GCC - fails_with :gcc do - cause <<-EOS - .../src/gbenchmark/src/thread_manager.h:50:31: error: expected ')' before '(' token - 50 | GUARDED_BY(GetBenchmarkMutex()) Result results; - | ^ - EOS - end - - def install - inreplace "CMakeLists.txt", "PONY_COMPILER=\"${CMAKE_C_COMPILER}\"", "PONY_COMPILER=\"#{ENV.cc}\"" if OS.linux? - - ENV["CMAKE_FLAGS"] = "-DCMAKE_OSX_SYSROOT=#{MacOS.sdk_path}" if OS.mac? - ENV["MAKEFLAGS"] = "build_flags=-j#{ENV.make_jobs}" - - system "make", "libs" - system "make", "configure" - system "make", "build" - system "make", "install", "DESTDIR=#{prefix}" - end - - test do - # ENV["CC"] returns llvm_clang, which does not work in a test block. - ENV.clang - - system "#{bin}/ponyc", "-rexpr", "#{prefix}/packages/stdlib" - - (testpath/"test/main.pony").write <<~EOS - actor Main - new create(env: Env) => - env.out.print("Hello World!") - EOS - system "#{bin}/ponyc", "test" - assert_equal "Hello World!", shell_output("./test1").strip - end -end diff --git a/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core/formula_renames.json b/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core/formula_renames.json deleted file mode 100644 index ff923dc297..0000000000 --- a/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core/formula_renames.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "advancemenu": "advancemame", - "amtk": "libgedit-amtk", - "annie": "lux", - "antlr2": "antlr@2", - "romanesco": "fennel" -} diff --git a/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core/tap_migrations.json b/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core/tap_migrations.json deleted file mode 100644 index 2bdd3fd5c6..0000000000 --- a/Library/Homebrew/test/support/fixtures/internal_tap_json/homebrew-core/tap_migrations.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "adobe-air-sdk": "homebrew/cask", - "android-ndk": "homebrew/cask", - "android-platform-tools": "homebrew/cask", - "android-sdk": "homebrew/cask", - "app-engine-go-32": "homebrew/cask/google-cloud-sdk" -}