1 # Licensed under the Apache License, Version 2.0 (the "License");
2 # you may not use this file except in compliance with the License.
3 # You may obtain a copy of the License at
5 # http://www.apache.org/licenses/LICENSE-2.0
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS,
9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 # See the License for the specific language governing permissions and
11 # limitations under the License.
16 def patch_st_dir(patch_version, st_egg, jccdir):
19 Shared mode is disabled, setuptools patch.43.%s must be applied to enable it
20 or the NO_SHARED environment variable must be set to turn off this error.
22 sudo patch -d %s -Nup0 < %s/jcc/patches/patch.43.%s
24 See %s/INSTALL for more information about shared mode.
25 ''' %(patch_version, st_egg, jccdir, patch_version, jccdir)
28 def patch_st_zip(patch_version, st_egg, jccdir):
31 Shared mode is disabled, setuptools patch.43.%s must be applied to enable it
32 or the NO_SHARED environment variable must be set to turn off this error.
37 patch -Nup0 < %s/jcc/patches/patch.43.%s
42 See %s/INSTALL for more information about shared mode.
43 ''' %(patch_version, st_egg, jccdir, patch_version, st_egg, jccdir)
46 def patch_setuptools(with_setuptools):
48 with_setuptools_c11 = ('00000000', '00000006', '*c', '00000011', '*final')
51 from setuptools.command.build_ext import sh_link_shared_object
52 enable_shared = True # jcc/patches/patch.43 was applied
55 jccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
56 st_egg = os.path.dirname(setuptools.__path__[0])
57 if with_setuptools < with_setuptools_c11:
58 patch_version = '0.6c7'
60 patch_version = '0.6c11'
62 if os.path.isdir(st_egg):
63 raise NotImplementedError, patch_st_dir(patch_version, st_egg,
66 raise NotImplementedError, patch_st_zip(patch_version, st_egg,