52 lines
2.2 KiB
Ruby
52 lines
2.2 KiB
Ruby
class Movgrab < Formula
|
|
desc "Downloader for youtube, dailymotion, and other video websites"
|
|
homepage "https://sites.google.com/site/columscode/home/movgrab"
|
|
url "https://github.com/ColumPaget/Movgrab/archive/3.1.2.tar.gz"
|
|
sha256 "30be6057ddbd9ac32f6e3d5456145b09526cc6bd5e3f3fb3999cc05283457529"
|
|
revision 1
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "957654b8124f982a4cb8001f1ade80de1f145af16b49982267e2867573633cbd" => :catalina
|
|
sha256 "4ee0f911dfa7c740de7299ec27f3015bb8543a70bba6cc2ebe5bc8a500b5932b" => :mojave
|
|
sha256 "b93b158f7774abed4d3ba760afb185798782bf10b257ffbf09954f131387137b" => :high_sierra
|
|
end
|
|
|
|
depends_on "libressl"
|
|
|
|
# Fixes an incompatibility between Linux's getxattr and macOS's.
|
|
# Reported upstream; half of this is already committed, and there's
|
|
# a PR for the other half.
|
|
# https://github.com/ColumPaget/libUseful/issues/1
|
|
# https://github.com/ColumPaget/libUseful/pull/2
|
|
patch do
|
|
url "https://github.com/Homebrew/formula-patches/raw/936597e74d22ab8cf421bcc9c3a936cdae0f0d96/movgrab/libUseful_xattr_backport.diff"
|
|
sha256 "d77c6661386f1a6d361c32f375b05bfdb4ac42804076922a4c0748da891367c2"
|
|
end
|
|
|
|
def install
|
|
# Can you believe this? A forgotten semicolon! Probably got missed because it's
|
|
# behind a conditional #ifdef.
|
|
# Fixed upstream: https://github.com/ColumPaget/libUseful/commit/6c71f8b123fd45caf747828a9685929ab63794d7
|
|
inreplace "libUseful-2.8/FileSystem.c", "result=-1", "result=-1;"
|
|
|
|
# Later versions of libUseful handle the fact that setresuid is Linux-only, but
|
|
# this one does not. https://github.com/ColumPaget/Movgrab/blob/master/libUseful/Process.c#L95-L99
|
|
inreplace "libUseful-2.8/Process.c", "setresuid(uid,uid,uid)", "setreuid(uid,uid)"
|
|
|
|
system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking", "--enable-ssl"
|
|
system "make"
|
|
|
|
# because case-insensitivity is sadly a thing and while the movgrab
|
|
# Makefile itself doesn't declare INSTALL as a phony target, we
|
|
# just remove the INSTALL instructions file so we can actually
|
|
# just make install
|
|
rm "INSTALL"
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/movgrab", "--version"
|
|
end
|
|
end
|