homebrew-core/Formula/vapoursynth.rb

77 lines
2.9 KiB
Ruby

class Vapoursynth < Formula
desc "Video processing framework with simplicity in mind"
homepage "http://www.vapoursynth.com"
url "https://github.com/vapoursynth/vapoursynth/archive/R52.tar.gz"
sha256 "4d5dc7950f4357da695d29708bc98013bc3e0bd72fc5d697f8c91ce3c4a4b2ac"
license "LGPL-2.1-or-later"
head "https://github.com/vapoursynth/vapoursynth.git"
livecheck do
url :head
regex(/^R(\d+(?:\.\d+)*?)$/i)
end
bottle do
cellar :any
sha256 "3c71ee0d92d3187ddab6500dac2a36597268efa50cee90c854ffb69d75d5e6e7" => :big_sur
sha256 "4e4668fb68c7df01857472c070dfcf562fd392c48200204f637856a1368181b8" => :catalina
sha256 "3d1e521272e5b5cff323d6678ff56f959945b9756f938c5ad46a797a345959c1" => :mojave
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cython" => :build
depends_on "libtool" => :build
depends_on "nasm" => :build
depends_on "pkg-config" => :build
depends_on macos: :el_capitan # due to zimg dependency
depends_on "python@3.9"
depends_on "zimg"
def install
system "./autogen.sh"
inreplace "Makefile.in", "pkglibdir = $(libdir)", "pkglibdir = $(exec_prefix)"
system "./configure", "--prefix=#{prefix}",
"--disable-silent-rules",
"--disable-dependency-tracking",
"--with-cython=#{Formula["cython"].bin}/cython",
"--with-plugindir=#{HOMEBREW_PREFIX}/lib/vapoursynth"
system "make", "install"
%w[eedi3 miscfilters morpho removegrain vinverse vivtc].each do |filter|
rm prefix/"vapoursynth/lib#{filter}.la"
end
end
def post_install
(HOMEBREW_PREFIX/"lib/vapoursynth").mkpath
%w[eedi3 miscfilters morpho removegrain vinverse vivtc].each do |filter|
(HOMEBREW_PREFIX/"lib/vapoursynth").install_symlink \
prefix/"vapoursynth/lib#{filter}.dylib" => "lib#{filter}.dylib"
end
end
def caveats
<<~EOS
This formula does not contain optional filters that require extra dependencies.
To use \x1B[3m\x1B[1mvapoursynth.core.sub\x1B[0m, execute:
brew install vapoursynth-sub
To use \x1B[3m\x1B[1mvapoursynth.core.ocr\x1B[0m, execute:
brew install vapoursynth-ocr
To use \x1B[3m\x1B[1mvapoursynth.core.imwri\x1B[0m, execute:
brew install vapoursynth-imwri
To use \x1B[3m\x1B[1mvapoursynth.core.ffms2\x1B[0m, execute the following:
brew install ffms2
ln -s "../libffms2.dylib" "#{HOMEBREW_PREFIX}/lib/vapoursynth/libffms2.dylib"
For more information regarding plugins, please visit:
\x1B[4mhttp://www.vapoursynth.com/doc/plugins.html\x1B[0m
EOS
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", "import vapoursynth"
system bin/"vspipe", "--version"
end
end