2020-10-10 14:16:11 +02:00
|
|
|
# typed: false
|
2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2017-04-21 09:32:30 -07:00
|
|
|
module Stdenv
|
2020-12-17 18:30:03 -05:00
|
|
|
def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, testing_formula: false)
|
2021-02-26 05:10:32 +00:00
|
|
|
generic_setup_build_environment(
|
|
|
|
|
formula: formula, cc: cc, build_bottle: build_bottle,
|
|
|
|
|
bottle_arch: bottle_arch, testing_formula: testing_formula
|
|
|
|
|
)
|
2018-12-17 11:44:09 -08:00
|
|
|
|
|
|
|
|
prepend_path "CPATH", HOMEBREW_PREFIX/"include"
|
|
|
|
|
prepend_path "LIBRARY_PATH", HOMEBREW_PREFIX/"lib"
|
|
|
|
|
prepend_path "LD_RUN_PATH", HOMEBREW_PREFIX/"lib"
|
2020-07-28 02:04:50 +02:00
|
|
|
|
|
|
|
|
return unless @formula
|
2018-12-17 11:44:09 -08:00
|
|
|
|
2020-07-27 21:41:03 -04:00
|
|
|
prepend_path "CPATH", @formula.include
|
2020-07-28 02:04:50 +02:00
|
|
|
prepend_path "LIBRARY_PATH", @formula.lib
|
|
|
|
|
prepend_path "LD_RUN_PATH", @formula.lib
|
2018-12-17 11:44:09 -08:00
|
|
|
end
|
|
|
|
|
|
2017-04-21 09:32:30 -07:00
|
|
|
def libxml2
|
|
|
|
|
append "CPPFLAGS", "-I#{Formula["libxml2"].include/"libxml2"}"
|
|
|
|
|
rescue FormulaUnavailableError
|
|
|
|
|
nil
|
|
|
|
|
end
|
|
|
|
|
end
|