<commit_before>class Librsvg < Formula
  desc "Library to render SVG files using Cairo"
  homepage "https://wiki.gnome.org/Projects/LibRsvg"
  url "https://download.gnome.org/sources/librsvg/2.48/librsvg-2.48.4.tar.xz"
  sha256 "28b63af85ced557383d3d3ece6e1f6938720dee1ecfa40d926bf1de4747c956e"

  bottle do
    sha256 "c8e5a0f2ad09479b8cee52d47c9fa040702be19971e0cdab0078193944142b39" => :catalina
    sha256 "fd169a74136443adc6e5f66869abea18d2ae881a009548a60a38ae9892dee2ac" => :mojave
    sha256 "9403a885723c59eb499b0cad2be97c2745b499b83ef14b674c1c0f646a9e552c" => :high_sierra
  end

  depends_on "gobject-introspection" => :build
  depends_on "pkg-config" => :build
  depends_on "rust" => :build
  depends_on "cairo"
  depends_on "gdk-pixbuf"
  depends_on "glib"
  depends_on "libcroco"
  depends_on "pango"

  def install
    # https://gitlab.gnome.org/GNOME/librsvg/issues/545#note_753842
    ENV.append "LDFLAGS", "-lobjc"

    args = %W[
      --disable-dependency-tracking
      --prefix=#{prefix}
      --disable-Bsymbolic
      --enable-tools=yes
      --enable-pixbuf-loader=yes
      --enable-introspection=yes
    ]

    system "./configure", *args

    # disable updating gdk-pixbuf cache, we will do this manually in post_install
    # https://github.com/Homebrew/homebrew/issues/40833
    inreplace "gdk-pixbuf-loader/Makefile",
              "$(GDK_PIXBUF_QUERYLOADERS) > $(DESTDIR)$(gdk_pixbuf_cache_file) ;",
              ""<commit_msg>librsvg: remove unused libcroco dependency<commit_after>class Librsvg < Formula
  desc "Library to render SVG files using Cairo"
  homepage "https://wiki.gnome.org/Projects/LibRsvg"
  url "https://download.gnome.org/sources/librsvg/2.48/librsvg-2.48.4.tar.xz"
  sha256 "28b63af85ced557383d3d3ece6e1f6938720dee1ecfa40d926bf1de4747c956e"

  bottle do
    sha256 "c8e5a0f2ad09479b8cee52d47c9fa040702be19971e0cdab0078193944142b39" => :catalina
    sha256 "fd169a74136443adc6e5f66869abea18d2ae881a009548a60a38ae9892dee2ac" => :mojave
    sha256 "9403a885723c59eb499b0cad2be97c2745b499b83ef14b674c1c0f646a9e552c" => :high_sierra
  end

  depends_on "gobject-introspection" => :build
  depends_on "pkg-config" => :build
  depends_on "rust" => :build
  depends_on "cairo"
  depends_on "gdk-pixbuf"
  depends_on "glib"
  depends_on "pango"

  def install
    # https://gitlab.gnome.org/GNOME/librsvg/issues/545#note_753842
    ENV.append "LDFLAGS", "-lobjc"

    args = %W[
      --disable-dependency-tracking
      --prefix=#{prefix}
      --disable-Bsymbolic
      --enable-tools=yes
      --enable-pixbuf-loader=yes
      --enable-introspection=yes
    ]

    system "./configure", *args

    # disable updating gdk-pixbuf cache, we will do this manually in post_install
    # https://github.com/Homebrew/homebrew/issues/40833
    inreplace "gdk-pixbuf-loader/Makefile",
              "$(GDK_PIXBUF_QUERYLOADERS) > $(DESTDIR)$(gdk_pixbuf_cache_file) ;",
              ""
{'fraction_non_alphanumeric': 0.1125555935682518, 'fraction_numerical': 0.13205610673965104, 'mean_word_length': 3.8013136288998357, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5958933', 'n_tokens_mistral': 1384, 'n_tokens_neox': 1168, 'n_words': 164}