Skip to content

Commit

Permalink
Merge pull request #75 from breml/fix-corefonts
Browse files Browse the repository at this point in the history
Add extraction of corefonts using cabextract
  • Loading branch information
tani authored Jan 21, 2025
2 parents c3d09e6 + c8af4ff commit 7ac4b6e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion cmd/generate-linux-fonts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
require "open-uri"
require "json"
require "tempfile"
require "uri"
require "utils/popen"

module Homebrew
Expand Down Expand Up @@ -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
Expand All @@ -176,7 +182,7 @@ class #{classname} < Formula
else
"\"#{cask["disable_reason"]}\""
end

formula += <<-EOS
disable! "#{cask["disable_date"]}", because: #{reason}
Expand All @@ -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]
Expand Down

0 comments on commit 7ac4b6e

Please sign in to comment.