homebrew-core/Formula/vapoursynth.rb

79 lines
3.3 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/R54.tar.gz"
sha256 "ad0c446adcb3877c253dc8c1372a053ad35022bcf42600889b927d2797c5330b"
license "LGPL-2.1-or-later"
head "https://github.com/vapoursynth/vapoursynth.git", branch: "master"
livecheck do
url :stable
regex(/^R(\d+(?:\.\d+)*?)$/i)
end
bottle do
sha256 cellar: :any, arm64_big_sur: "a346ffbc942c5d1fe4e10aad19fc48cffd3970def632f39fafee5be53236331c"
sha256 cellar: :any, big_sur: "4c69d45c71838171fba6d4c2e9a95eff286767266d41f836459c9c5fd5ecc1b4"
sha256 cellar: :any, catalina: "39aa1f2a6b6d761deeda877ebc140b4f71036ba1b6e59e4a891ac6b9b035fb51"
sha256 cellar: :any, mojave: "231df154fd7cb7d282ba9ac35e15e15f1045d290e0791cd11023735534d5052f"
sha256 cellar: :any_skip_relocation, x86_64_linux: "2ff863d1d5ac1684c53467d1360fdc330f22bdecc48ac43992ef7f59e040f3bb"
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 "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",
"--with-python_prefix=#{prefix}",
"--with-python_exec_prefix=#{prefix}"
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