homebrew-core/Formula/shared-mime-info.rb
2017-09-19 18:31:32 +02:00

54 lines
1.6 KiB
Ruby

class SharedMimeInfo < Formula
desc "Database of common MIME types"
homepage "https://wiki.freedesktop.org/www/Software/shared-mime-info"
url "https://freedesktop.org/~hadess/shared-mime-info-1.9.tar.xz"
sha256 "5c0133ec4e228e41bdf52f726d271a2d821499c2ab97afd3aa3d6cf43efcdc83"
bottle do
cellar :any
sha256 "d9874846a89ac41dcc2b95f1c35c4d566ae02ae287b213500c02acd141a9c0bf" => :high_sierra
sha256 "a20f07e05094e370bb70ed36eeb1f570a466d8b4b12267659b99bc382cb995cf" => :sierra
sha256 "4c81754ed0ea158e77f4f2de100515c4fc4f6f3204e3bf8baf95f8b37f0d7a29" => :el_capitan
end
head do
url "https://anongit.freedesktop.org/git/xdg/shared-mime-info.git"
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "intltool" => :build
end
depends_on "pkg-config" => :build
depends_on "intltool" => :build
depends_on "gettext"
depends_on "glib"
def install
# Disable the post-install update-mimedb due to crash
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
--disable-update-mimedb
]
if build.head?
system "./autogen.sh", *args
else
system "./configure", *args
end
system "make", "install"
pkgshare.install share/"mime/packages"
rmdir share/"mime"
end
def post_install
ln_sf HOMEBREW_PREFIX/"share/mime", share/"mime"
(HOMEBREW_PREFIX/"share/mime/packages").mkpath
cp (pkgshare/"packages").children, HOMEBREW_PREFIX/"share/mime/packages"
system bin/"update-mime-database", HOMEBREW_PREFIX/"share/mime"
end
test do
cp_r share/"mime", testpath
system bin/"update-mime-database", testpath/"mime"
end
end