class SharedMimeInfo < Formula desc "Database of common MIME types" homepage "https://wiki.freedesktop.org/www/Software/shared-mime-info" url "https://gitlab.freedesktop.org/xdg/shared-mime-info/uploads/80c7f1afbcad2769f38aeb9ba6317a51/shared-mime-info-1.12.tar.xz" sha256 "18b2f0fe07ed0d6f81951a5fd5ece44de9c8aeb4dc5bb20d4f595f6cc6bd403e" bottle do cellar :any sha256 "a7fb52d858dfbd75c6c5553b0cf688dd982b9aa49b60569a44a0a1ea270b52c4" => :mojave sha256 "97b2ec767496ccab0c890c4310ddfd03d0ba318a494f88556a47a69a87a14bdd" => :high_sierra sha256 "3ee458bfa61d4517eafaa2fa24e03044c7c695acbbdf84eb28566bc3be4495c2" => :sierra end head do url "https://gitlab.freedesktop.org/xdg/shared-mime-info.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "intltool" => :build end depends_on "intltool" => :build depends_on "pkg-config" => :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