]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[Jython patch #1578658] Make distutils work for Jython, at least for
authorAndrew M. Kuchling <amk@amk.ca>
Sun, 10 Dec 2006 00:35:20 +0000 (00:35 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Sun, 10 Dec 2006 00:35:20 +0000 (00:35 +0000)
pure-Python distributions.

Patch by Supreet Sethi, slightly modified by adding the change
to sysconfig.py.

Lib/distutils/command/install.py
Lib/distutils/dist.py
Lib/distutils/sysconfig.py

index 2f8cc3363662483bf1415a49738d3055b4ee336b..363a9399d5b20dea6e1fb1e884ccbde7fb8553e0 100644 (file)
@@ -55,7 +55,14 @@ INSTALL_SCHEMES = {
         'headers': '$base/Include/$dist_name',
         'scripts': '$base/Scripts',
         'data'   : '$base',
-        }
+        },
+    'java': {
+        'purelib': '$base/Lib',
+        'platlib': '$base/Lib',
+        'headers': '$base/Include/$dist_name',
+        'scripts': '$base/Scripts',
+        'data'   : '$base',
+        },
     }
 
 # The keys to an installation scheme; if any new types of files are to be
index 8a10fc5abc2b15d9d2a944b1598964b0e2c48bd8..576f6edb66fdda8773903043d5d9555f8bc40de7 100644 (file)
@@ -130,7 +130,8 @@ class Distribution:
         self.metadata = DistributionMetadata()
         for basename in self.metadata._METHOD_BASENAMES:
             method_name = "get_" + basename
-            setattr(self, method_name, getattr(self.metadata, method_name))
+            if hasattr(self.metadata, method_name):
+                setattr(self, method_name, getattr(self.metadata, method_name))
 
         # 'cmdclass' maps command names to class objects, so we
         # can 1) quickly figure out which class to instantiate when
index 7c16d51a3ea5bb681e7895467e46bac8207b43c3..c72913acfffca070824003029f055fb7d7eea2a3 100644 (file)
@@ -119,6 +119,11 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
                 return os.path.join(prefix, "Lib")
             else:
                 return os.path.join(prefix, "Lib", "site-packages")
+    elif os.name == "java":
+        if standard_lib:
+            return os.path.join(prefix, "Lib")
+        else:
+            return os.path.join(prefix, "Lib", "site-packages")
     else:
         raise DistutilsPlatformError(
             "I don't know where Python installs its library "