File pylerc-use-syslib.patch of Package lerc
diff -ur lerc-4.1.0.orig/OtherLanguages/Python/lerc/_lerc.py lerc-4.1.0/OtherLanguages/Python/lerc/_lerc.py
--- lerc-4.1.0.orig/OtherLanguages/Python/lerc/_lerc.py 2026-03-15 12:29:27.160819309 +0100
+++ lerc-4.1.0/OtherLanguages/Python/lerc/_lerc.py 2026-03-15 12:32:07.898969816 +0100
@@ -115,24 +115,10 @@
import numpy as np
import ctypes as ct
from timeit import default_timer as timer
-import platform
-import os
def _get_lib():
- dir_path = os.path.dirname(os.path.realpath(__file__))
-
- if platform.system() == "Windows":
- lib = os.path.join(dir_path, 'Lerc.dll')
- elif platform.system() == "Linux":
- lib = os.path.join(dir_path, 'libLerc.so.4')
- elif platform.system() == "Darwin":
- lib = os.path.join(dir_path, 'libLerc.dylib')
- else:
- lib = None
-
- if not lib or not os.path.exists(lib):
- import ctypes.util
- lib = ctypes.util.find_library('Lerc')
+ import ctypes.util
+ lib = ctypes.util.find_library('Lerc')
return lib
diff -ur lerc-4.1.0.orig/OtherLanguages/Python/setup.py lerc-4.1.0/OtherLanguages/Python/setup.py
--- lerc-4.1.0.orig/OtherLanguages/Python/setup.py 2026-03-15 12:29:27.161382479 +0100
+++ lerc-4.1.0/OtherLanguages/Python/setup.py 2026-03-15 12:31:09.640600081 +0100
@@ -1,23 +1,5 @@
import setuptools
-from glob import glob
-from os.path import basename, exists, join, getmtime
-from shutil import copyfile
-
-# Forces the wheel to be platform-specific (e.g., win_amd64)
-# but compatible with any Python 3 version (py3-none).
-try:
- from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
- class bdist_wheel(_bdist_wheel):
- def finalize_options(self):
- _bdist_wheel.finalize_options(self)
- self.root_is_pure = False
-
- def get_tag(self):
- _, _, plat = _bdist_wheel.get_tag(self)
- return "py3", "none", plat
- cmdclass = {'bdist_wheel': bdist_wheel}
-except ImportError:
- cmdclass = {}
+from os.path import join
readme_path = join("lerc", "README.md")
try:
@@ -26,18 +8,6 @@
except Exception:
long_description = "Limited Error Raster Compression"
-# Using MANIFEST.in doesn't respect relative paths above the package root.
-# Instead, inspect the location and copy in the binaries if newer.
-BINARY_TYPES = ["*.dll", "*.lib", "*.so*", "*.dylib"]
-PLATFORMS = ["Linux", "MacOS", "windows"]
-for platform in PLATFORMS:
- platform_dir = join("..", "..", "bin", platform)
- for ext in BINARY_TYPES:
- input_binaries = glob(join(platform_dir, ext))
- for input_binary in input_binaries:
- output_binary = join("lerc", basename(input_binary))
- if not exists(output_binary) or getmtime(input_binary) > getmtime(output_binary):
- copyfile(input_binary, output_binary)
setuptools.setup(
name="pylerc",
@@ -51,14 +21,11 @@
url="https://github.com/Esri/lerc",
packages=setuptools.find_packages(),
install_requires=["numpy >=2.3.0,<3"],
- cmdclass=cmdclass,
classifiers=[
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: Apache Software License",
],
- package_data={"lerc": BINARY_TYPES},
python_requires=">=3.11",
- zip_safe=False,
)