Files
chromebrew/lib/package_helpers.rb
Satadru Pramanik e492f28081 patchelf option during package creation, revamp of boolean symbol processing (#6661)
* initial commit of using patchelf during package creation

* requested changes

* simplify symbols

* suggested change

* switch sh to bash + suggested changes

* WIP changes to elf detection and property detection

* make boolean symbols dynamic in package.rb

* remove some debug code

* report file being patched when libraries are not found

* Add rubocop cleanups

* crew rubocop adjustments

* remove debug code

* bump version

* add is_musl? musl.rb loading

* suggested changes

* requested change
2022-02-03 08:12:58 -06:00

31 lines
826 B
Ruby

class InstallError < RuntimeError; end
def create_placeholder(*functions)
# create_placeholder: create a placeholder for functions that will be used by crew later
functions.each do |func|
class_eval("def self.#{func}; end", __FILE__, __LINE__)
end
end
def property(*properties)
# property: like attr_accessor, but `=` is not needed to define a value
# Examples:
# {prop_name}('example') # set {prop_name} to 'example'
# {prop_name} # return the value of {prop_name}
properties.each do |prop|
class_eval <<~EOT, __FILE__, __LINE__ + 1
def self.#{prop} (#{prop} = nil)
@#{prop} = #{prop} if #{prop}
@#{prop}
end
EOT
end
end
def reload_constants
warn_level = $VERBOSE
$VERBOSE = nil
load "#{CREW_LIB_PATH}lib/const.rb"
$VERBOSE = warn_level
end