class Freetype < Formula desc "Software library to render fonts" homepage "https://www.freetype.org/" url "https://downloads.sourceforge.net/project/freetype/freetype2/2.13.3/freetype-2.13.3.tar.xz" mirror "https://download.savannah.gnu.org/releases/freetype/freetype-2.13.3.tar.xz" sha256 "0550350666d427c74daeb85d5ac7bb353acba5f76956395995311a9c6f063289" license "FTL" livecheck do url :stable regex(/url=.*?freetype[._-]v?(\d+(?:\.\d+)+)\.t/i) end depends_on "pkg-config" => :build depends_on "libpng" uses_from_macos "bzip2" uses_from_macos "zlib" def install # This file will be installed to bindir, so we want to avoid embedding the # absolute path to the pkg-config shim. inreplace "builds/unix/freetype-config.in", "%PKG_CONFIG%", "pkg-config" system "./configure", "--prefix=#{prefix}", "--enable-freetype-config", "--without-harfbuzz" system "make" system "make", "install" inreplace [bin/"freetype-config", lib/"pkgconfig/freetype2.pc"], prefix, opt_prefix end test do system bin/"freetype-config", "--cflags", "--libs", "--ftversion", "--exec-prefix", "--prefix" end end