forked from GeoDaCenter/geoda
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Chore] upgrade gdal 3.8.4 (GeoDaCenter#2473)
- Loading branch information
Showing
6 changed files
with
51 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,38 @@ | ||
''' | ||
code sign geoda dependent dylibs inplace | ||
''' | ||
import subprocess | ||
import os | ||
import sys | ||
import re | ||
from shutil import copyfile | ||
import sys | ||
from pathlib import Path | ||
|
||
processed_items = {} | ||
|
||
|
||
def ProcessDependency(dylib_path, cid, current_item=None): | ||
print("ProcessDependency:", dylib_path, cid, current_item) | ||
if dylib_path in processed_items: | ||
return | ||
else: | ||
processed_items[dylib_path] = True | ||
|
||
if dylib_path == '@rpath/libgeos.3.11.2.dylib': | ||
dylib_path = '/opt/homebrew/opt/geos/lib/libgeos.3.11.2.dylib' | ||
if dylib_path == '@rpath/libgeos.3.11.1.dylib': | ||
dylib_path = '/opt/homebrew/opt/geos/lib/libgeos.3.11.1.dylib' | ||
if dylib_path == '@rpath/libgeos.3.11.0.dylib': | ||
dylib_path = '/opt/homebrew/opt/geos/lib/libgeos.3.11.0.dylib' | ||
if dylib_path == '@rpath/libgeos.3.11.2.dylib': | ||
dylib_path = '/opt/homebrew/opt/geos/lib/libgeos.3.11.2.dylib' | ||
if dylib_path == '@rpath/libgeos.3.12.2.dylib': | ||
dylib_path = '/opt/homebrew/opt/geos/lib/libgeos.3.12.2.dylib' | ||
if dylib_path == '@loader_path/libicuuc.71.dylib': | ||
dylib_path = '/opt/homebrew/opt/icu4c/lib/libicuuc.71.dylib' | ||
if dylib_path == '@loader_path/libicuuc.72.dylib': | ||
dylib_path = '/opt/homebrew/opt/icu4c/lib/libicuuc.72.dylib' | ||
if dylib_path == '@loader_path/libicuuc.73.dylib': | ||
dylib_path = '/opt/homebrew/opt/icu4c/lib/libicuuc.73.dylib' | ||
if dylib_path == '@loader_path/libicudata.71.dylib': | ||
dylib_path = '/opt/homebrew/opt/icu4c/lib/libicudata.71.dylib' | ||
if dylib_path == '@loader_path/libicudata.72.dylib': | ||
dylib_path = '/opt/homebrew/opt/icu4c/lib/libicudata.72.dylib' | ||
if dylib_path == '@loader_path/libicudata.73.dylib': | ||
dylib_path = '/opt/homebrew/opt/icu4c/lib/libicudata.73.dylib' | ||
if dylib_path == '@loader_path/libbrotlicommon.1.dylib': | ||
dylib_path = '/opt/homebrew/opt/brotli/lib/libbrotlicommon.1.dylib' | ||
if dylib_path == '@rpath/libsharpyuv.0.dylib': | ||
dylib_path = '/opt/homebrew/opt/webp/lib/libsharpyuv.0.dylib' | ||
if dylib_path == '@loader_path/libkmlbase.1.dylib': | ||
dylib_path = '/opt/homebrew/opt/libkml/lib/libkmlbase.1.dylib' | ||
if dylib_path == '@loader_path/libkmldom.1.dylib': | ||
dylib_path = '/opt/homebrew/opt/libkml/lib/libkmldom.1.dylib' | ||
|
||
m = re.search('@rpath/libIlmThread-(.*).dylib', dylib_path) | ||
if m: | ||
dylib_path = '/usr/local/opt/openexr/lib/libIlmThread-' + \ | ||
m.group(1) + '.dylib' | ||
m = re.search('@rpath/libIex-(.*).dylib', dylib_path) | ||
if m: | ||
dylib_path = '/usr/local/opt/openexr/lib/libIex-' + \ | ||
m.group(1) + '.dylib' | ||
m = re.search('@rpath/libOpenEXR-(.*).dylib', dylib_path) | ||
if m: | ||
dylib_path = '/usr/local/opt/openexr/lib/libOpenEXR-' + \ | ||
m.group(1) + '.dylib' | ||
m = re.search('@rpath/libOpenEXRCore-(.*).dylib', dylib_path) | ||
if m: | ||
dylib_path = '/usr/local/opt/openexr/lib/libOpenEXRCore-' + \ | ||
m.group(1) + '.dylib' | ||
|
||
m = re.search('@rpath/(libabsl.*)', dylib_path) | ||
if m: | ||
dylib_path = '/usr/local/opt/abseil/lib/' + m.group(1) | ||
elif dylib_path.startswith('@rpath'): | ||
if dylib_path.startswith('@rpath'): | ||
print('@rpath: before', dylib_path) | ||
item_filename = os.path.basename(dylib_path) | ||
copy_dir = str(Path(current_item).parent) | ||
dylib_path = f'{copy_dir}/{item_filename}' | ||
|
||
m = re.search('@rpath/(libaws.*)', dylib_path) | ||
if m: | ||
dylib_path = '/usr/local/opt/aws-sdk-cpp/lib/' + m.group(1) | ||
|
||
m = re.search('@loader_path/../../../../(opt*)', dylib_path) | ||
if m: | ||
dylib_path = '/usr/local/' + m.group(1) | ||
print('@rpath: after', dylib_path) | ||
# m = re.search('@loader_path/../../../../(opt*)', dylib_path) | ||
# if m: | ||
# dylib_path = '/usr/local/' + m.group(1) | ||
|
||
if dylib_path.startswith('@loader_path'): | ||
item_filename = os.path.basename(dylib_path) | ||
upper_levels = dylib_path.count('../') | ||
copy_dir = str(Path(current_item).parent) | ||
print('upper_levels:', upper_levels, 'copy_dir:', | ||
copy_dir, 'item_filename:', item_filename) | ||
if upper_levels - 1 >= 0: | ||
current_dir = Path(current_item).parents[upper_levels - 1] | ||
copy_dir = str(current_dir) | ||
|
@@ -106,7 +57,7 @@ def ProcessDependency(dylib_path, cid, current_item=None): | |
|
||
|
||
# e.g. | ||
# python3 code_sign.py /opt/homebrew/opt/gdal/lib/libgdal.29.dylib "Apple Development: [email protected] (AN5USPSZF6)" | ||
# python3 code_sign.py /opt/homebrew/opt/gdal/lib/libgdal.32.dylib "Apple Development: [email protected] (AN5USPSZF6)" | ||
# ProcessDependency(sys.argv[1], sys.argv[2]) | ||
# ProcessDependency('/opt/homebrew/Cellar/gdal/3.7.2/lib/libgdal.33.3.7.2.dylib', "Apple Development: [email protected] (AN5USPSZF6)") | ||
# python3 code_sign.py /opt/homebrew/opt/gdal/lib/libgdal.34.dylib "Apple Development: [email protected] (AN5USPSZF6)" | ||
# python3 code_sign.py /Users/xun/github/geoda/BuildTools/macosx/libraries/lib/libwx_osx_cocoau-3.2.dylib "Apple Development: [email protected] (AN5USPSZF6)" | ||
# python3 code_sign.py /Users/xun/github/geoda/BuildTools/macosx/libraries/lib/libwx_osx_cocoau_gl-3.2.dylib "Apple Development: [email protected] (AN5USPSZF6)" | ||
ProcessDependency(sys.argv[1], sys.argv[2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters