From c8af4ff3824aba4fc2a273fbaf639f6680a7bf6f Mon Sep 17 00:00:00 2001 From: Lucas Bremgartner Date: Fri, 17 Jan 2025 21:50:25 +0100 Subject: [PATCH] Add extraction of corefonts using cabextract --- cmd/generate-linux-fonts.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cmd/generate-linux-fonts.rb b/cmd/generate-linux-fonts.rb index 4bcd2a2a8..d00f8a27f 100755 --- a/cmd/generate-linux-fonts.rb +++ b/cmd/generate-linux-fonts.rb @@ -5,6 +5,7 @@ require "open-uri" require "json" require "tempfile" +require "uri" require "utils/popen" module Homebrew @@ -161,6 +162,11 @@ class #{classname} < Formula end formula += format_stanza :head, cask["url"], cask["url_specs"] if cask["version"] == "latest" + if cask["url"].end_with?(".exe") + formula += <<-EOS + depends_on "cabextract" => :build + EOS + end paths = get_font_paths(cask) if paths.count < 1 @@ -176,7 +182,7 @@ class #{classname} < Formula else "\"#{cask["disable_reason"]}\"" end - + formula += <<-EOS disable! "#{cask["disable_date"]}", because: #{reason} @@ -199,6 +205,13 @@ class #{classname} < Formula def install EOS + if cask["url"].end_with?(".exe") + file = URI(cask["url"]).path.split('/').last + formula += <<-EOS + system "cabextract", "#{file}" + EOS + end + paths.sort.each do |path| formula += <<-EOS (share/"fonts").install Dir.glob("#{path}")[0]