Skip to content

Commit

Permalink
Add frameworks helper to formula
Browse files Browse the repository at this point in the history
  • Loading branch information
adamv committed May 3, 2013
1 parent c4e995d commit 11bf38b
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Library/Formula/bullet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def install

if build.include? "framework"
args << "-DBUILD_SHARED_LIBS=ON" << "-DFRAMEWORK=ON"
args << "-DCMAKE_INSTALL_PREFIX=#{prefix}/Frameworks"
args << "-DCMAKE_INSTALL_NAME_DIR=#{prefix}/Frameworks"
args << "-DCMAKE_INSTALL_PREFIX=#{frameworks}"
args << "-DCMAKE_INSTALL_NAME_DIR=#{frameworks}"
else
args << "-DBUILD_SHARED_LIBS=ON" if build.include? "shared"
args << "-DCMAKE_INSTALL_PREFIX=#{prefix}"
Expand Down
6 changes: 3 additions & 3 deletions Library/Formula/jstalk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ def install
cd 'build/Release' do
bin.install 'jstalk'
prefix.install "JSTalk Editor.app"
(prefix+'Frameworks').install 'JSTalk.framework'
frameworks.install 'JSTalk.framework'
end
end

def caveats; <<-EOS.undent
Framework JSTalk was installed to:
#{prefix}/Frameworks/JSTalk.framework
#{frameworks}/JSTalk.framework
You may want to symlink this Framework to a standard OS X location,
such as:
mkdir ~/Frameworks
ln -s "#{prefix}/Frameworks/JSTalk.framework" ~/Frameworks
ln -s "#{frameworks}/JSTalk.framework" ~/Frameworks
JSTalk Editor.app was installed in:
#{prefix}
Expand Down
10 changes: 5 additions & 5 deletions Library/Formula/nu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ def install
arch = :x86_64 if arch == :i386 && Hardware.is_64_bit?
s.sub!(/^;;\(set @arch '\("i386"\)\)$/, "(set @arch '(\"#{arch}\"))") unless arch.nil?
s.gsub!('(SH "sudo ', '(SH "') # don't use sudo to install
s.gsub!('#{@destdir}/Library/Frameworks', '#{@prefix}/Library/Frameworks')
s.gsub!('#{@destdir}/Library/Frameworks', '#{@frameworks}')
s.sub! /^;; source files$/, <<-EOS
;; source files
(set @framework_install_path "#{prefix}/Library/Frameworks")
(set @framework_install_path "#{frameworks}")
EOS
end
system "make"
Expand All @@ -66,14 +66,14 @@ def install
end

def caveats
if self.installed? and File.exists? prefix+"Library/Frameworks/Nu.framework"
if self.installed? and File.exists? frameworks+"Nu.framework"
return <<-EOS.undent
Nu.framework was installed to:
#{prefix}/Library/Frameworks/Nu.framework
#{frameworks}/Nu.framework
You may want to symlink this Framework to a standard OS X location,
such as:
ln -s "#{prefix}/Library/Frameworks/Nu.framework" /Library/Frameworks
ln -s "#{frameworks}/Nu.framework" /Library/Frameworks
EOS
end
return nil
Expand Down
4 changes: 2 additions & 2 deletions Library/Formula/pyside.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ def install
# unless the folder containing those frameworks is added to the compiler
# search path.
qt = Formula.factory 'qt'
ENV.append_to_cflags "-F#{qt.prefix}/Frameworks"
ENV.append_to_cflags "-F#{qt.frameworks}"

# Also need `ALTERNATIVE_QT_INCLUDE_DIR` to prevent "missing file" errors.
# Add out of tree build because one of its deps, shiboken, itself needs an
# out of tree build in shiboken.rb.
args = std_cmake_args + %W[
-DALTERNATIVE_QT_INCLUDE_DIR=#{qt.prefix}/Frameworks
-DALTERNATIVE_QT_INCLUDE_DIR=#{qt.frameworks}
-DSITE_PACKAGE=lib/#{which_python}/site-packages
-DBUILD_TESTS=NO
..
Expand Down
4 changes: 1 addition & 3 deletions Library/Formula/qt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,8 @@ def install
(prefix+'q3porting.xml').unlink

# Some config scripts will only find Qt in a "Frameworks" folder
# VirtualBox is an example of where this is needed
# See: https://github.com/mxcl/homebrew/issues/issue/745
cd prefix do
ln_s lib, prefix + "Frameworks"
ln_s lib, frameworks
end

# The pkg-config files installed suggest that headers can be found in the
Expand Down
4 changes: 1 addition & 3 deletions Library/Formula/qt5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ def install
(bin+'qhelpconverter.app').rmtree

# Some config scripts will only find Qt in a "Frameworks" folder
# VirtualBox is an example of where this is needed
# See: https://github.com/mxcl/homebrew/issues/issue/745
cd prefix do
ln_s lib, prefix + "Frameworks"
ln_s lib, frameworks
end

# The pkg-config files installed suggest that headers can be found in the
Expand Down
4 changes: 2 additions & 2 deletions Library/Formula/unar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def install
bin.install "./Release/unar", "./Release/lsar"

lib.install "./Release/libXADMaster.a"
(prefix/'Frameworks').install "./Release/XADMaster.framework"
(include/'libXADMaster').install_symlink Dir["#{prefix}/Frameworks/XADMaster.framework/Headers/*"]
frameworks.install "./Release/XADMaster.framework"
(include/'libXADMaster').install_symlink Dir["#{frameworks}/XADMaster.framework/Headers/*"]

cd "./Extra" do
man1.install "lsar.1", "unar.1"
Expand Down
1 change: 1 addition & 0 deletions Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ def man8; man+'man8' end
def sbin; prefix+'sbin' end
def share; prefix+'share' end

def frameworks; prefix+'Frameworks' end
def kext_prefix; prefix+'Library/Extensions' end

# configuration needs to be preserved past upgrades
Expand Down

0 comments on commit 11bf38b

Please sign in to comment.