15
0
forked from pool/python-Rtree
Files
python-Rtree/Rtree-opensuse-noarch.patch

96 lines
3.3 KiB
Diff

diff -ur Rtree-0.9.7/setup.py Rtree-0.9.7.p/setup.py
--- Rtree-0.9.7/setup.py 2020-12-24 16:38:19.000000000 +0100
+++ Rtree-0.9.7.p/setup.py 2021-05-18 00:48:04.350602925 +0200
@@ -6,7 +6,6 @@
from setuptools.dist import Distribution
from setuptools.command.install import install
-from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
# Get text from README.txt
@@ -21,74 +20,6 @@
# current working directory of this setup.py file
_cwd = os.path.abspath(os.path.split(__file__)[0])
-
-class bdist_wheel(_bdist_wheel):
- def finalize_options(self):
- _bdist_wheel.finalize_options(self)
- self.root_is_pure = False
-
-
-class BinaryDistribution(Distribution):
- """Distribution which always forces a binary package with platform name"""
- def has_ext_modules(foo):
- return True
-
-
-class InstallPlatlib(install):
- def finalize_options(self):
- """
- Copy the shared libraries into the wheel. Note that this
- will *only* check in `rtree/lib` rather than anywhere on
- the system so if you are building a wheel you *must* copy or
- symlink the `.so`/`.dll`/`.dylib` files into `rtree/lib`.
- """
- # use for checking extension types
- from fnmatch import fnmatch
-
- install.finalize_options(self)
- if self.distribution.has_ext_modules():
- self.install_lib = self.install_platlib
- # now copy over libspatialindex
- # get the location of the shared library on the filesystem
-
- # where we're putting the shared library in the build directory
- target_dir = os.path.join(self.build_lib, 'rtree', 'lib')
- # where are we checking for shared libraries
- source_dir = os.path.join(_cwd, 'rtree', 'lib')
-
- # what patterns represent shared libraries
- patterns = {'*.so',
- 'libspatialindex*dylib',
- '*.dll'}
-
- if not os.path.isdir(source_dir):
- # no copying of binary parts to library
- # this is so `pip install .` works even
- # if `rtree/lib` isn't populated
- return
-
- for file_name in os.listdir(source_dir):
- # make sure file name is lower case
- check = file_name.lower()
- # use filename pattern matching to see if it is
- # a shared library format file
- if not any(fnmatch(check, p) for p in patterns):
- continue
-
- # if the source isn't a file skip it
- if not os.path.isfile(os.path.join(source_dir, file_name)):
- continue
-
- # make build directory if it doesn't exist yet
- if not os.path.isdir(target_dir):
- os.makedirs(target_dir)
-
- # copy the source file to the target directory
- self.copy_file(
- os.path.join(source_dir, file_name),
- os.path.join(target_dir, file_name))
-
-
setup(
name='Rtree',
version=__version__,
@@ -105,8 +36,6 @@
package_data={"rtree": ['lib']},
zip_safe=False,
include_package_data=True,
- distclass=BinaryDistribution,
- cmdclass={'bdist_wheel': bdist_wheel, 'install': InstallPlatlib},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',