Michka Popoff 955bca6574 formule: add generic shared-lib methods
We have strings containing hardcoded ".dylib" extensions in homebrew-core.
To be able to bring linuxbrew-core and homebrew-core closer together,
I am introducing a new generic attribute that can be used in formulae.
2020-06-20 23:14:18 +02:00

18 lines
263 B
Ruby

# frozen_string_literal: true
class Formula
undef shared_library
def shared_library(name, version = nil)
"#{name}.so#{"." unless version.nil?}#{version}"
end
class << self
undef on_linux
def on_linux(&_block)
yield
end
end
end