Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Install python3 apps to the Cellar

The python3 Makefile checks the Framework install prefix for
"Library/Frameworks" and only then installs the apps in a folder
relative to the prefix.

A side effect of this is that the Frameworks folder is moved within a
Library folder in the Cellar.

Fixes #11521
  • Loading branch information...
commit 93763e37954e8637475b8e1958de93416c73f441 1 parent 30813c8
@paxswill authored
Showing with 16 additions and 4 deletions.
  1. +16 −4 Library/Formula/python3.rb
View
20 Library/Formula/python3.rb
@@ -64,7 +64,8 @@ def install
end
if build_framework?
- args << "--enable-framework=#{prefix}/Frameworks"
+ # */Library/Frameworks is a special path that triggers */Applications
+ args << "--enable-framework=#{prefix}/Library/Frameworks"
else
args << "--enable-shared" unless ARGV.include? '--static'
end
@@ -74,6 +75,17 @@ def install
ENV.j1 # Installs must be serialized
system "make install"
+ if as_framework?
+ # Move the apps and add the version suffix.
+ # Normally they're in a versioned folder, but linkapps does not preserve
+ # folder names or structure when linking.
+ python_vers = "3.2"
+ ['IDLE', 'Python Launcher'].each do |a|
+ mv(prefix+"Applications/Python 3.2/#{a}.app", prefix+"#{a} (3.2).app")
+ end
+ (prefix+'Applications').rmtree
+ end
+
# Post-install, fix up the site-packages and install-scripts folders
# so that user-installed Python software survives minor updates, such
# as going from 3.2.2 to 3.2.3.
@@ -117,7 +129,7 @@ def caveats
You may want to symlink this Framework to a standard OS X location,
such as:
mkdir ~/Frameworks
- ln -s "#{prefix}/Frameworks/Python.framework" ~/Frameworks
+ ln -s "#{prefix}/Library/Frameworks/Python.framework" ~/Frameworks
EOS
general_caveats = <<-EOS.undent
@@ -149,7 +161,7 @@ def caveats
# lib folder,taking into account whether we are a Framework build or not
def effective_lib
# If we're installed or installing as a Framework, then use that location.
- return prefix+"Frameworks/Python.framework/Versions/3.2/lib" if as_framework?
+ return prefix+"Library/Frameworks/Python.framework/Versions/3.2/lib" if as_framework?
# Otherwise use just 'lib'
return lib
end
@@ -157,7 +169,7 @@ def effective_lib
# include folder,taking into account whether we are a Framework build or not
def effective_include
# If we're installed or installing as a Framework, then use that location.
- return prefix+"Frameworks/Python.framework/Versions/3.2/include" if as_framework?
+ return prefix+"Library/Frameworks/Python.framework/Versions/3.2/include" if as_framework?
# Otherwise use just 'include'
return include
end
Please sign in to comment.
Something went wrong with that request. Please try again.