Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extraction of corefonts using cabextract #75

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading