-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
feat: allow font install on linux #18874
base: master
Are you sure you want to change the base?
Conversation
801829e
to
e5c2c8c
Compare
e5c2c8c
to
d1b5f68
Compare
Installing fonts now works, although it is still installing in the macOS location. I can't get the DEFAULTS to work. |
99e0454
to
ed30ba7
Compare
ed30ba7
to
378ff7c
Compare
}.freeze, T::Hash[Symbol, T.nilable(String)]) | ||
|
||
sig { returns(T::Hash[Symbol, T.untyped]) } | ||
def self.defaults |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Homebrew/brew I can't get the code to pick up this extended version, no matter what I try. Does anyone have a suggestion how to do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dduugg may know!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, guilty 😬
prepend
ing (like include
) only affects instance methods. If I understand what you're trying to do here, you'll want to write this as an instance method in a submodule (e.g. ClassMethods
) which is then prepended to the singleton class. See Keg
for an example of this dual-prepend
approach, specifically:
brew/Library/Homebrew/extend/os/mac/keg.rb
Lines 130 to 131 in e23d079
Keg.singleton_class.prepend(OS::Mac::Keg::ClassMethods) | |
Keg.prepend(OS::Mac::Keg) |
(I'm entirely to blame for this convoluted mess, and I'm open to alternatives. It's probably useful to document this for others, maybe in Typechecking.md
, though it has discoverability issues.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't look all that bad, I wouldn't have guessed that this was type check related though, so I probably wouldn't have found it in the documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done this now, but it somehow doesn't get invoked when I run brew install --cask font-<something>
. And I have no idea why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To (hopefully) ask the obvious, you're running that command on Linux, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, was running it in a codespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will fix you up (I know it's confusing…): https://github.com/Homebrew/brew/pull/18874/files#r1909348690
198387f
to
6e8fc52
Compare
6e8fc52
to
75ac2b5
Compare
}.freeze, T::Hash[Symbol, T.nilable(String)]) | ||
|
||
sig { returns(T::Hash[Symbol, T.untyped]) } | ||
def self.defaults |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be an instance method for prepend
to work:
def self.defaults | |
def defaults |
(It will become a class method once prepended to the singleton class 🤷 🤕 )
end | ||
|
||
Cask::Config.singleton_class.prepend(OS::Linux::Cask::Config::ClassMethods) | ||
Cask::Config.prepend(OS::Linux::Cask::Config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is necessary
Cask::Config.prepend(OS::Linux::Cask::Config) |
extend T::Helpers | ||
|
||
requires_ancestor { ::Cask::Config } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be necessary:
extend T::Helpers | |
requires_ancestor { ::Cask::Config } |
}.freeze, T::Hash[Symbol, T.nilable(String)]) | ||
|
||
sig { returns(T::Hash[Symbol, T.untyped]) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to tighten up the types:
}.freeze, T::Hash[Symbol, T.nilable(String)]) | |
sig { returns(T::Hash[Symbol, T.untyped]) } | |
}.freeze, T::Hash[Symbol, String]) | |
sig { returns(T::Hash[Symbol, String]) } |
# frozen_string_literal: true | ||
|
||
require "extend/os/mac/cask/artifact/moved" if OS.mac? | ||
require "extend/os/linux/cask/artifact/moved" if OS.linux? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not something to take on in this PR, but I wonder if we should have a single require file for all of an OS's extensions, rather than introduce three more require files here. 🤔
def self.check_quarantine_support | ||
:linux | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def self.check_quarantine_support | |
:linux | |
end | |
def self.check_quarantine_support = :linux |
Thanks for the pointers @dduugg ! |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?This should disable quarantine on Linux, allow installing fonts and set a location for the fonts. Marking this as draft until I've had a moment to test it.
Waiting for #18808 to be merged