Skip to content

Commit

Permalink
[Chore] upgrade gdal 3.8.4 (#2473)
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 authored Mar 4, 2024
1 parent 40003fc commit b9bf453
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 167 deletions.
22 changes: 11 additions & 11 deletions BuildTools/macosx/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,19 @@ build-geoda-mac:
cp $(GeoDa_ROOT)/rc/menus.xrc build/GeoDa.app/Contents/Resources
cp $(GeoDa_ROOT)/rc/toolbar.xrc build/GeoDa.app/Contents/Resources
cp /usr/local/opt/gdal/share/gdal/* build/GeoDa.app/Contents/Resources/gdaldata
cp libraries/lib/libwx_osx_cocoau-3.1.4.0.0.dylib build/GeoDa.app/Contents/Frameworks/libwx_osx_cocoau-3.1.dylib
cp libraries/lib/libwx_osx_cocoau_gl-3.1.4.0.0.dylib build/GeoDa.app/Contents/Frameworks/libwx_osx_cocoau_gl-3.1.dylib
cp /usr/local/opt/gdal/lib/libgdal.33.dylib build/GeoDa.app/Contents/Frameworks
cp libraries/lib/libwx_osx_cocoau-3.2.0.2.2.dylib build/GeoDa.app/Contents/Frameworks/libwx_osx_cocoau-3.2.dylib
cp libraries/lib/libwx_osx_cocoau_gl-3.2.0.2.2.dylib build/GeoDa.app/Contents/Frameworks/libwx_osx_cocoau_gl-3.2.dylib
cp /usr/local/opt/gdal/lib/libgdal.34.dylib build/GeoDa.app/Contents/Frameworks
install_name_tool -id "GeoDa" build/GeoDa.app/Contents/MacOS/GeoDa
install_name_tool -change "$(GEODA_HOME)/libraries/lib/libwx_osx_cocoau_gl-3.1.dylib" "@executable_path/../Frameworks/libwx_osx_cocoau_gl-3.1.dylib" build/GeoDa.app/Contents/MacOS/GeoDa
install_name_tool -change "$(GEODA_HOME)/libraries/lib/libwx_osx_cocoau-3.1.dylib" "@executable_path/../Frameworks/libwx_osx_cocoau-3.1.dylib" build/GeoDa.app/Contents/MacOS/GeoDa
install_name_tool -change "/usr/local/opt/gdal/lib/libgdal.33.dylib" "@executable_path/../Frameworks/libgdal.33.dylib" build/GeoDa.app/Contents/MacOS/GeoDa
install_name_tool -change "/opt/homebrew/opt/gdal/lib/libgdal.33.dylib" "@executable_path/../Frameworks/libgdal.33.dylib" build/GeoDa.app/Contents/MacOS/GeoDa
install_name_tool -change "$(GEODA_HOME)/libraries/lib/libwx_osx_cocoau_gl-3.2.dylib" "@executable_path/../Frameworks/libwx_osx_cocoau_gl-3.2.dylib" build/GeoDa.app/Contents/MacOS/GeoDa
install_name_tool -change "$(GEODA_HOME)/libraries/lib/libwx_osx_cocoau-3.2.dylib" "@executable_path/../Frameworks/libwx_osx_cocoau-3.2.dylib" build/GeoDa.app/Contents/MacOS/GeoDa
install_name_tool -change "/usr/local/opt/gdal/lib/libgdal.34.dylib" "@executable_path/../Frameworks/libgdal.34.dylib" build/GeoDa.app/Contents/MacOS/GeoDa
install_name_tool -change "/opt/homebrew/opt/gdal/lib/libgdal.34.dylib" "@executable_path/../Frameworks/libgdal.34.dylib" build/GeoDa.app/Contents/MacOS/GeoDa
python3 install_name.py $(GEODA_HOME)/build/GeoDa.app/Contents/Frameworks "Developer ID Application: Geodapress LLC (26M5NG43GP)"
install_name_tool -change "@executable_path/../Frameworks/libwx_osx_cocoau-3.1.4.0.0.dylib" "@executable_path/../Frameworks/libwx_osx_cocoau-3.1.dylib" build/GeoDa.app/Contents/Frameworks/libwx_osx_cocoau_gl-3.1.dylib
codesign -f --timestamp -o runtime -s "Developer ID Application: Geodapress LLC (26M5NG43GP)" build/GeoDa.app/Contents/Frameworks/libwx_osx_cocoau_gl-3.1.dylib
codesign -f --timestamp -o runtime -s "Developer ID Application: Geodapress LLC (26M5NG43GP)" build/GeoDa.app/Contents/Frameworks/libwx_osx_cocoau-3.1.4.0.0.dylib
codesign -f --timestamp -o runtime -s "Developer ID Application: Geodapress LLC (26M5NG43GP)" build/GeoDa.app/Contents/Frameworks/libwx_osx_cocoau-3.1.dylib
install_name_tool -change "@executable_path/../Frameworks/libwx_osx_cocoau-3.2.0.2.2.dylib" "@executable_path/../Frameworks/libwx_osx_cocoau-3.2.dylib" build/GeoDa.app/Contents/Frameworks/libwx_osx_cocoau_gl-3.2.dylib
codesign -f --timestamp -o runtime -s "Developer ID Application: Geodapress LLC (26M5NG43GP)" build/GeoDa.app/Contents/Frameworks/libwx_osx_cocoau_gl-3.2.dylib
codesign -f --timestamp -o runtime -s "Developer ID Application: Geodapress LLC (26M5NG43GP)" build/GeoDa.app/Contents/Frameworks/libwx_osx_cocoau-3.2.0.2.2.dylib
codesign -f --timestamp -o runtime -s "Developer ID Application: Geodapress LLC (26M5NG43GP)" build/GeoDa.app/Contents/Frameworks/libwx_osx_cocoau-3.2.dylib
codesign -f --timestamp -o runtime -s "Developer ID Application: Geodapress LLC (26M5NG43GP)" build/GeoDa.app/Contents/MacOS/lisa_kernel.cl
codesign -f --timestamp -o runtime -s "Developer ID Application: Geodapress LLC (26M5NG43GP)" build/GeoDa.app/Contents/MacOS/GeoDa
codesign -f --timestamp -o runtime -s "Developer ID Application: Geodapress LLC (26M5NG43GP)" build/GeoDa.app
Expand Down
16 changes: 8 additions & 8 deletions BuildTools/macosx/GeoDa.m1.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2262,8 +2262,8 @@
"-I/opt/homebrew/opt/boost/include",
"-I/opt/homebrew/opt/gdal/include",
"-I/usr/include",
"-I./libraries/lib/wx/include/osx_cocoa-unicode-3.1",
"-I./libraries/include/wx-3.1/",
"-I./libraries/lib/wx/include/osx_cocoa-unicode-3.2",
"-I./libraries/include/wx-3.2/",
"-I./temp/boost",
"-I./libraries/include",
"-I./temp/eigen3",
Expand All @@ -2286,8 +2286,8 @@
"-L/opt/homebrew/opt/gdal/lib",
"-lgdal",
"-L$(SRCROOT)/libraries/lib",
"-lwx_osx_cocoau-3.1",
"-lwx_osx_cocoau_gl-3.1",
"-lwx_osx_cocoau-3.2",
"-lwx_osx_cocoau_gl-3.2",
"-framework",
OpenCL,
"-framework",
Expand Down Expand Up @@ -2356,8 +2356,8 @@
"$(OTHER_CFLAGS)",
"-I/opt/homebrew/include",
"-I/usr/include",
"-I./libraries/lib/wx/include/osx_cocoa-unicode-3.1",
"-I./libraries/include/wx-3.1/",
"-I./libraries/lib/wx/include/osx_cocoa-unicode-3.2",
"-I./libraries/include/wx-3.2/",
"-I./temp/boost",
"-I./libraries/include",
"-I./temp/eigen3",
Expand All @@ -2378,8 +2378,8 @@
"-L/opt/homebrew/opt/gdal/lib",
"-lgdal",
"-L$(SRCROOT)/libraries/lib",
"-lwx_osx_cocoau-3.1",
"-lwx_osx_cocoau_gl-3.1",
"-lwx_osx_cocoau-3.2",
"-lwx_osx_cocoau_gl-3.2",
"-framework",
OpenCL,
"-framework",
Expand Down
83 changes: 17 additions & 66 deletions BuildTools/macosx/code_sign.py
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)
Expand All @@ -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: xunli@uchicago.edu (AN5USPSZF6)"
# python3 code_sign.py /opt/homebrew/opt/gdal/lib/libgdal.32.dylib "Apple Development: xunli@uchicago.edu (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: xunli@uchicago.edu (AN5USPSZF6)")
# python3 code_sign.py /opt/homebrew/opt/gdal/lib/libgdal.34.dylib "Apple Development: xunli@uchicago.edu (AN5USPSZF6)"
# python3 code_sign.py /Users/xun/github/geoda/BuildTools/macosx/libraries/lib/libwx_osx_cocoau-3.2.dylib "Apple Development: xunli@uchicago.edu (AN5USPSZF6)"
# python3 code_sign.py /Users/xun/github/geoda/BuildTools/macosx/libraries/lib/libwx_osx_cocoau_gl-3.2.dylib "Apple Development: xunli@uchicago.edu (AN5USPSZF6)"
ProcessDependency(sys.argv[1], sys.argv[2])
3 changes: 2 additions & 1 deletion BuildTools/macosx/create-dmg/create-dmg
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ echo "Done fixing permissions."

# make the top window open itself on mount:
echo "Blessing started"
bless --folder "${MOUNT_DIR}" --openfolder "${MOUNT_DIR}"
# bless --folder "${MOUNT_DIR}" --openfolder "${MOUNT_DIR}"
bless --folder "${MOUNT_DIR}"
echo "Blessing finished"

if ! test -z "$VOLUME_ICON_FILE"; then
Expand Down
12 changes: 6 additions & 6 deletions BuildTools/macosx/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ cd temp
# cd ..
# cd ..

# Build wxWidgets 3.1.4
if ! [ -f "wxWidgets-3.1.4.tar.bz2" ]; then
curl -L -O https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.4/wxWidgets-3.1.4.tar.bz2
tar -xf wxWidgets-3.1.4.tar.bz2
# Build wxWidgets 3.2.4
if ! [ -f "wxWidgets-3.2.4.tar.bz2" ]; then
curl -L -O https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.4/wxWidgets-3.2.4.tar.bz2
tar -xf wxWidgets-3.2.4.tar.bz2
fi
if ! [ -f "../libraries/bin/wx-config" ]; then
cd wxWidgets-3.1.4
./configure --with-cocoa --with-opengl --enable-postscript --enable-textfile --without-liblzma --enable-webview --enable-cxx11 --enable-webview --disable-mediactrl --enable-webviewwebkit --enable-monolithic --with-libtiff=builtin --with-libpng=builtin --with-libjpeg=builtin --prefix=$GEODA_HOME/libraries
cd wxWidgets-3.2.4
./configure --with-cocoa --with-opengl --enable-postscript --enable-textfile --without-liblzma --enable-webview --enable-cxx11 --disable-mediactrl --enable-webviewwebkit --enable-monolithic --with-libtiff=builtin --with-libpng=builtin --with-libjpeg=builtin --prefix=$GEODA_HOME/libraries
make -j $CPUS
make install
cd ..
Expand Down
82 changes: 7 additions & 75 deletions BuildTools/macosx/install_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,80 +40,12 @@ def process_dependency(framework_path, dylib_name):
for item in items:
# e.g. '@loader_path/../../../../opt/libarchive/lib/libarchive.13.dylib (compatibility version 20.0.0, current version 20.2.0)'
item = item.strip().split(" ")[0]

# workaround for gdal 3.3.3 that @rpath/libgeos.3.10.2.dylib was used instead of dir path
copyitem = item
if item == '@rpath/libgeos.3.10.2.dylib':
copyitem = '/usr/local/opt/geos/lib/libgeos.dylib'
if item == '@rpath/libgeos.3.11.0.dylib':
copyitem = '/usr/local/opt/geos/lib/libgeos.dylib'
if item == '@rpath/libgeos.3.12.0.dylib':
copyitem = '/usr/local/opt/geos/lib/libgeos.dylib'
if item == '@rpath/libgeos.3.11.1.dylib':
copyitem = '/usr/local/opt/geos/lib/libgeos.dylib'
if item == '@rpath/libgeos.3.11.2.dylib':
copyitem = '/usr/local/opt/geos/lib/libgeos.dylib'
if item == '@loader_path/libicuuc.70.dylib':
copyitem = '/usr/local/opt/icu4c/lib/libicuuc.70.dylib'
if item == '@loader_path/libicuuc.71.dylib':
copyitem = '/usr/local/opt/icu4c/lib/libicuuc.71.dylib'
if item == '@loader_path/libicuuc.72.dylib':
copyitem = '/usr/local/opt/icu4c/lib/libicuuc.72.dylib'
if item == '@loader_path/libicuuc.73.dylib':
copyitem = '/usr/local/opt/icu4c/lib/libicuuc.73.dylib'
if item == '@loader_path/libicudata.70.dylib':
copyitem = '/usr/local/opt/icu4c/lib/libicudata.70.dylib'
if item == '@loader_path/libicudata.71.dylib':
copyitem = '/usr/local/opt/icu4c/lib/libicudata.71.dylib'
if item == '@loader_path/libicudata.72.dylib':
copyitem = '/usr/local/opt/icu4c/lib/libicudata.72.dylib'
if item == '@loader_path/libicudata.73.dylib':
copyitem = '/usr/local/opt/icu4c/lib/libicudata.73.dylib'
if item == '@loader_path/libbrotlicommon.1.dylib':
copyitem = '/usr/local/opt/brotli/lib/libbrotlicommon.1.dylib'

if item == '@rpath/libIlmThread-3_1.30.dylib':
copyitem = '/usr/local/opt/openexr/lib/libIlmThread-3_1.30.dylib'
if item == '@rpath/libIex-3_1.30.dylib':
copyitem = '/usr/local/opt/openexr/lib/libIex-3_1.30.dylib'
if item == '@rpath/libOpenEXR-3_1.30.dylib':
copyitem = '/usr/local/opt/openexr/lib/libOpenEXR-3_1.30.dylib'
if item == '@rpath/libOpenEXRCore-3_1.30.dylib':
copyitem = '/usr/local/opt/openexr/lib/libOpenEXRCore-3_1.30.dylib'
if item == '@rpath/libabsl_log_internal_conditions.2301.0.0.dylib':
copyitem = '/usr/local/opt/abseil/lib/libabsl_log_internal_conditions.2301.0.0.dylib'
if item == '@rpath/libabsl_raw_logging_internal.2301.0.0.dylib':
copyitem = '/usr/local/opt/abseil/lib/libabsl_raw_logging_internal.2301.0.0.dylib'
if item == '@rpath/libabsl_log_severity.2301.0.0.dylib':
copyitem = '/usr/local/opt/abseil/lib/libabsl_log_severity.2301.0.0.dylib'
if item == '@rpath/libabsl_base.2301.0.0.dylib':
copyitem = '/usr/local/opt/abseil/lib/libabsl_base.2301.0.0.dylib'

m = re.search('@rpath/libIlmThread-(.*).dylib', item)
if m:
copyitem = '/usr/local/opt/openexr/lib/libIlmThread-' + \
m.group(1) + '.dylib'
m = re.search('@rpath/libIex-(.*).dylib', item)
if m:
copyitem = '/usr/local/opt/openexr/lib/libIex-' + \
m.group(1) + '.dylib'
m = re.search('@rpath/libOpenEXR-(.*).dylib', item)
if m:
copyitem = '/usr/local/opt/openexr/lib/libOpenEXR-' + \
m.group(1) + '.dylib'
m = re.search('@rpath/libOpenEXRCore-(.*).dylib', item)
if m:
copyitem = '/usr/local/opt/openexr/lib/libOpenEXRCore-' + \
m.group(1) + '.dylib'

name_matches = re.search('@rpath/(libabsl.*)', item)
if name_matches:
copyitem = '/usr/local/opt/abseil/lib/' + name_matches.group(1)

name_matches = re.search('@rpath/(libaws.*)', item)
if name_matches:
copyitem = '/usr/local/opt/aws-sdk-cpp/lib/' + \
name_matches.group(1)
if item.startswith('@rpath'):
item_filename = os.path.basename(item)
copy_dir = str(Path(current_item).parent)
copyitem = f'{copy_dir}/{item_filename}'

if item.startswith('@loader_path'):
item_filename = os.path.basename(item)
Expand Down Expand Up @@ -145,6 +77,6 @@ def process_dependency(framework_path, dylib_name):
os.system(cmd)


process_dependency(FRAMEWORK_PATH, "libwx_osx_cocoau_gl-3.1.dylib")
process_dependency(FRAMEWORK_PATH, "libwx_osx_cocoau-3.1.dylib")
process_dependency(FRAMEWORK_PATH, "libgdal.33.dylib")
process_dependency(FRAMEWORK_PATH, "libwx_osx_cocoau_gl-3.2.dylib")
process_dependency(FRAMEWORK_PATH, "libwx_osx_cocoau-3.2.dylib")
process_dependency(FRAMEWORK_PATH, "libgdal.34.dylib")

0 comments on commit b9bf453

Please sign in to comment.