Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #7414: fixed setup.py on OSX 10.5. Thanks, ajs.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8019 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f28474547be843055474f0ecd05850eaed3c6d3a 1 parent 4f1cbaa
Jacob Kaplan-Moss authored July 21, 2008

Showing 2 changed files with 21 additions and 0 deletions. Show diff stats Hide diff stats

  1. 1  AUTHORS
  2. 20  setup.py
1  AUTHORS
@@ -41,6 +41,7 @@ And here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS --
41 41
 people who have submitted patches, reported bugs, added translations, helped
42 42
 answer newbie questions, and generally made Django that much better:
43 43
 
  44
+    ajs <adi@sieker.info>
44 45
     alang@bright-green.com
45 46
     Marty Alchin <gulopine@gamemusic.org>
46 47
     atlithorn <atlithorn@gmail.com>
20  setup.py
... ...
@@ -1,8 +1,27 @@
1 1
 from distutils.core import setup
  2
+from distutils.command.install_data import install_data
2 3
 from distutils.command.install import INSTALL_SCHEMES
3 4
 import os
4 5
 import sys
5 6
 
  7
+class osx_install_data(install_data):
  8
+    # On MacOS the plattform specific lib dir is /System/Library/Framework/Python/.../
  9
+    # which is wrong. Python 2.5 supplied with MacOS 10.5 has an Aplle specific fix
  10
+    # for this in distutils.command.install_data#306 It fixes install_lib but not
  11
+    # install_data, which is why we roll our own install_data class.
  12
+
  13
+    def finalize_options (self):
  14
+        # By the time finalize_options is called install.install_lib is set to the
  15
+        # fixed directory. so we set the installdir for to install_lib, the
  16
+        # install_data class uses ('install_data', 'install_dir') instead.
  17
+        self.set_undefined_options('install', ('install_lib', 'install_dir'))
  18
+        install_data.finalize_options(self)
  19
+
  20
+if sys.platform == "darwin": 
  21
+    cmdclasses = {'install_data': osx_install_data } 
  22
+else: 
  23
+    cmdclasses = {'install_data': install_data } 
  24
+
6 25
 def fullsplit(path, result=None):
7 26
     """
8 27
     Split a pathname into components (the opposite of os.path.join) in a
@@ -55,6 +74,7 @@ def fullsplit(path, result=None):
55 74
     author_email = 'foundation@djangoproject.com',
56 75
     description = 'A high-level Python Web framework that encourages rapid development and clean, pragmatic design.',
57 76
     packages = packages,
  77
+    cmdclass = cmdclasses,
58 78
     data_files = data_files,
59 79
     scripts = ['django/bin/django-admin.py'],
60 80
 )

0 notes on commit f284745

Please sign in to comment.
Something went wrong with that request. Please try again.