Use ENV.append_path

This commit is contained in:
Jack Nagel 2013-08-19 17:21:13 -05:00
parent b672b44cf9
commit ea8f51256b
5 changed files with 18 additions and 18 deletions

View File

@ -72,9 +72,9 @@ module Stdenv
# For Xcode 4.3 (*without* the "Command Line Tools for Xcode") compiler and tools inside of Xcode:
if not MacOS::CLT.installed? and MacOS::Xcode.installed? and MacOS::Xcode.version >= "4.3"
# Some tools (clang, etc.) are in the xctoolchain dir of Xcode
append 'PATH', "#{MacOS.xctoolchain_path}/usr/bin", File::PATH_SEPARATOR if MacOS.xctoolchain_path
append_path 'PATH', "#{MacOS.xctoolchain_path}/usr/bin" if MacOS.xctoolchain_path
# Others are now at /Applications/Xcode.app/Contents/Developer/usr/bin
append 'PATH', "#{MacOS.dev_tools_path}", File::PATH_SEPARATOR
append_path 'PATH', MacOS.dev_tools_path
end
end
@ -217,15 +217,15 @@ module Stdenv
# Extra setup to support Xcode 4.3+ without CLT.
self['SDKROOT'] = sdk
# Tell clang/gcc where system include's are:
append 'CPATH', "#{sdk}/usr/include", File::PATH_SEPARATOR
append_path 'CPATH', "#{sdk}/usr/include"
# The -isysroot is needed, too, because of the Frameworks
append_to_cflags "-isysroot #{sdk}"
append 'CPPFLAGS', "-isysroot #{sdk}"
# And the linker needs to find sdk/usr/lib
append 'LDFLAGS', "-isysroot #{sdk}"
# Needed to build cmake itself and perhaps some cmake projects:
append 'CMAKE_PREFIX_PATH', "#{sdk}/usr", File::PATH_SEPARATOR
append 'CMAKE_FRAMEWORK_PATH', "#{sdk}/System/Library/Frameworks", File::PATH_SEPARATOR
append_path 'CMAKE_PREFIX_PATH', "#{sdk}/usr"
append_path 'CMAKE_FRAMEWORK_PATH', "#{sdk}/System/Library/Frameworks"
end
end
@ -250,24 +250,24 @@ module Stdenv
def x11
# There are some config scripts here that should go in the PATH
append 'PATH', MacOS::X11.bin, File::PATH_SEPARATOR
append_path 'PATH', MacOS::X11.bin
# Append these to PKG_CONFIG_LIBDIR so they are searched
# *after* our own pkgconfig directories, as we dupe some of the
# libs in XQuartz.
append 'PKG_CONFIG_LIBDIR', MacOS::X11.lib/'pkgconfig', File::PATH_SEPARATOR
append 'PKG_CONFIG_LIBDIR', MacOS::X11.share/'pkgconfig', File::PATH_SEPARATOR
append_path 'PKG_CONFIG_LIBDIR', MacOS::X11.lib/'pkgconfig'
append_path 'PKG_CONFIG_LIBDIR', MacOS::X11.share/'pkgconfig'
append 'LDFLAGS', "-L#{MacOS::X11.lib}"
append 'CMAKE_PREFIX_PATH', MacOS::X11.prefix, File::PATH_SEPARATOR
append 'CMAKE_INCLUDE_PATH', MacOS::X11.include, File::PATH_SEPARATOR
append_path 'CMAKE_PREFIX_PATH', MacOS::X11.prefix
append_path 'CMAKE_INCLUDE_PATH', MacOS::X11.include
append 'CPPFLAGS', "-I#{MacOS::X11.include}"
append 'ACLOCAL_PATH', MacOS::X11.share/'aclocal', File::PATH_SEPARATOR
append_path 'ACLOCAL_PATH', MacOS::X11.share/'aclocal'
unless MacOS::CLT.installed?
append 'CMAKE_PREFIX_PATH', MacOS.sdk_path/'usr/X11', File::PATH_SEPARATOR
append_path 'CMAKE_PREFIX_PATH', MacOS.sdk_path/'usr/X11'
append 'CPPFLAGS', "-I#{MacOS::X11.include}/freetype2"
append 'CFLAGS', "-I#{MacOS::X11.include}"
end

View File

@ -96,7 +96,7 @@ module Superenv
# so xcrun may not be able to find it
if self['HOMEBREW_CC'] == 'gcc-4.2'
apple_gcc42 = Formula.factory('apple-gcc42') rescue nil
append('PATH', apple_gcc42.opt_prefix/'bin', File::PATH_SEPARATOR) if apple_gcc42
append_path('PATH', apple_gcc42.opt_prefix/'bin') if apple_gcc42
end
end

View File

@ -87,8 +87,8 @@ class Requirement
case o
when Pathname
self.class.env do
unless ENV["PATH"].split(":").include?(o.parent.to_s)
ENV.append("PATH", o.parent, ":")
unless ENV["PATH"].split(File::PATH_SEPARATOR).include?(o.parent.to_s)
ENV.append_path("PATH", o.parent)
end
end
end

View File

@ -254,8 +254,8 @@ class PythonInstalled < Requirement
ENV['PYTHONHOME'] = nil # to avoid fuck-ups.
ENV['PYTHONPATH'] = if brewed? then nil; else global_site_packages.to_s; end
ENV.append 'CMAKE_INCLUDE_PATH', incdir, File::PATH_SEPARATOR
ENV.append 'PKG_CONFIG_PATH', pkg_config_path, File::PATH_SEPARATOR if pkg_config_path
ENV.append_path 'CMAKE_INCLUDE_PATH', incdir
ENV.append_path 'PKG_CONFIG_PATH', pkg_config_path if pkg_config_path
# We don't set the -F#{framework} here, because if Python 2.x and 3.x are
# used, `Python.framework` is ambiguous. However, in the `python do` block
# we can set LDFLAGS+="-F#{framework}" because only one is temporarily set.

View File

@ -75,7 +75,7 @@ class RequirementTests < Test::Unit::TestCase
end.new
ENV.expects(:with_build_environment).yields.returns(which_path)
ENV.expects(:append).with("PATH", which_path.parent, ":")
ENV.expects(:append_path).with("PATH", which_path.parent)
req.satisfied?
req.modify_build_environment