homebrew-core/Formula/gstreamer.rb

67 lines
2.3 KiB
Ruby

class Gstreamer < Formula
desc "Development framework for multimedia applications"
homepage "https://gstreamer.freedesktop.org/"
url "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.18.3.tar.xz"
sha256 "0c2e09e18f2df69a99b5cb3bd53c597b3cc2e35cf6c98043bb86a66f3d312100"
license "LGPL-2.0-or-later"
head "https://gitlab.freedesktop.org/gstreamer/gstreamer.git"
livecheck do
url "https://gstreamer.freedesktop.org/src/gstreamer/"
regex(/href=.*?gstreamer[._-]v?(\d+\.\d*[02468](?:\.\d+)*)\.t/i)
end
bottle do
sha256 arm64_big_sur: "760ba2b158b164beb570455fdca6540957ccbde2b2eab5a37ed430ae63ec1150"
sha256 big_sur: "f5ddbdbbee54212f4a7ea77df78f7444591416290de476b1241955d258b1da19"
sha256 catalina: "bc7d7022010b0208963c624b9310814b3be2c87fea16f567091a4517c771bfda"
sha256 mojave: "b073cef5157e71dc3c7ff1ada4296dd64ac1e81ec2b94a5095e7135f9c1333f5"
end
depends_on "bison" => :build
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "gettext"
depends_on "glib"
uses_from_macos "flex" => :build
def install
# Ban trying to chown to root.
# https://bugzilla.gnome.org/show_bug.cgi?id=750367
args = std_meson_args + %w[
-Dintrospection=enabled
-Dptp-helper-permissions=none
]
# Look for plugins in HOMEBREW_PREFIX/lib/gstreamer-1.0 instead of
# HOMEBREW_PREFIX/Cellar/gstreamer/1.0/lib/gstreamer-1.0, so we'll find
# plugins installed by other packages without setting GST_PLUGIN_PATH in
# the environment.
inreplace "meson.build",
"cdata.set_quoted('PLUGINDIR', join_paths(get_option('prefix'), get_option('libdir'), 'gstreamer-1.0'))",
"cdata.set_quoted('PLUGINDIR', '#{HOMEBREW_PREFIX}/lib/gstreamer-1.0')"
mkdir "build" do
system "meson", *args, ".."
system "ninja", "-v"
system "ninja", "install", "-v"
end
end
def caveats
<<~EOS
Consider also installing gst-plugins-base and gst-plugins-good.
The gst-plugins-* packages contain gstreamer-video-1.0, gstreamer-audio-1.0,
and other components needed by most gstreamer applications.
EOS
end
test do
system bin/"gst-inspect-1.0"
end
end