Files

36 lines
1.1 KiB
Ruby

class Pycparser < Formula
desc "C parser in Python"
homepage "https://github.com/eliben/pycparser"
url "https://files.pythonhosted.org/packages/1b/7d/92392ff7815c21062bea51aa7b87d45576f649f16458d78b7cf94b9ab2e6/pycparser-3.0.tar.gz"
sha256 "600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29"
license "BSD-3-Clause"
compatibility_version 1
bottle do
sha256 cellar: :any_skip_relocation, all: "2c10120dc7d0f6e19f7ceaa82bf41195df1541f3971a69367611f04121babec8"
end
depends_on "python@3.13" => [:build, :test]
depends_on "python@3.14" => [:build, :test]
def pythons
deps.map(&:to_formula)
.select { |f| f.name.start_with?("python@") }
.map { |f| f.opt_libexec/"bin/python" }
end
def install
pythons.each do |python|
system python, "-m", "pip", "install", *std_pip_args(build_isolation: true), "."
end
pkgshare.install "examples"
end
test do
examples = pkgshare/"examples"
pythons.each do |python|
system python, examples/"c-to-c.py", examples/"c_files/basic.c"
end
end
end