homebrew-core/Formula/vapoursynth-sub.rb

50 lines
1.9 KiB
Ruby

class VapoursynthSub < Formula
desc "VapourSynth filters - Subtitling filter"
homepage "http://www.vapoursynth.com"
url "https://github.com/vapoursynth/vapoursynth/archive/R52.tar.gz"
sha256 "4d5dc7950f4357da695d29708bc98013bc3e0bd72fc5d697f8c91ce3c4a4b2ac"
license "ISC"
revision 1
head "https://github.com/vapoursynth/vapoursynth.git"
bottle do
rebuild 1
sha256 cellar: :any, arm64_big_sur: "f839dc3e4798aed76186c3b120196fc1a68bc834cbbbb400431e4c508ed3323e"
sha256 cellar: :any, big_sur: "f35a87fae9d63140f78a33f901599cbd86590bb2da555af4f3e3340d9dfda48c"
sha256 cellar: :any, catalina: "502317a7a2b4c831d2ae2e581db7f58bf214baf86fa016245c4a279a3041f287"
sha256 cellar: :any, mojave: "ec16cf11157f1adf26cbf9b0439f7d7cc9504d345b68714c14f148cde27795f5"
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "nasm" => :build
depends_on "pkg-config" => :build
depends_on "ffmpeg"
depends_on "libass"
depends_on "vapoursynth"
def install
system "./autogen.sh"
inreplace "Makefile.in", "pkglibdir = $(libdir)", "pkglibdir = $(exec_prefix)"
system "./configure", "--prefix=#{prefix}",
"--disable-core",
"--disable-vsscript",
"--disable-plugins",
"--enable-subtext"
system "make", "install"
rm prefix/"vapoursynth/libsubtext.la"
end
def post_install
(HOMEBREW_PREFIX/"lib/vapoursynth").mkpath
(HOMEBREW_PREFIX/"lib/vapoursynth").install_symlink prefix/"vapoursynth/libsubtext.dylib" => "libsubtext.dylib"
end
test do
xy = Language::Python.major_minor_version Formula["python@3.9"].opt_bin/"python3"
ENV.prepend_path "PYTHONPATH", lib/"python#{xy}/site-packages"
system Formula["python@3.9"].opt_bin/"python3", "-c", "from vapoursynth import core; core.sub"
end
end