From b9bf4537288524907abaa5605b3bcd557f7ae12e Mon Sep 17 00:00:00 2001 From: Xun Li Date: Mon, 4 Mar 2024 14:47:39 -0700 Subject: [PATCH] [Chore] upgrade gdal 3.8.4 (#2473) --- BuildTools/macosx/GNUmakefile | 22 ++--- .../macosx/GeoDa.m1.xcodeproj/project.pbxproj | 16 ++-- BuildTools/macosx/code_sign.py | 83 ++++--------------- BuildTools/macosx/create-dmg/create-dmg | 3 +- BuildTools/macosx/install.sh | 12 +-- BuildTools/macosx/install_name.py | 82 ++---------------- 6 files changed, 51 insertions(+), 167 deletions(-) diff --git a/BuildTools/macosx/GNUmakefile b/BuildTools/macosx/GNUmakefile index 1ef33985d..e7211b52c 100644 --- a/BuildTools/macosx/GNUmakefile +++ b/BuildTools/macosx/GNUmakefile @@ -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 diff --git a/BuildTools/macosx/GeoDa.m1.xcodeproj/project.pbxproj b/BuildTools/macosx/GeoDa.m1.xcodeproj/project.pbxproj index 663b3f59c..dfcb9f5cd 100644 --- a/BuildTools/macosx/GeoDa.m1.xcodeproj/project.pbxproj +++ b/BuildTools/macosx/GeoDa.m1.xcodeproj/project.pbxproj @@ -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", @@ -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", @@ -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", @@ -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", diff --git a/BuildTools/macosx/code_sign.py b/BuildTools/macosx/code_sign.py index 21c26e436..0937a1b85 100755 --- a/BuildTools/macosx/code_sign.py +++ b/BuildTools/macosx/code_sign.py @@ -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: 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]) diff --git a/BuildTools/macosx/create-dmg/create-dmg b/BuildTools/macosx/create-dmg/create-dmg index 3e55dd974..04a2eff48 100755 --- a/BuildTools/macosx/create-dmg/create-dmg +++ b/BuildTools/macosx/create-dmg/create-dmg @@ -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 diff --git a/BuildTools/macosx/install.sh b/BuildTools/macosx/install.sh index 48721f9a3..3b8e33d7d 100755 --- a/BuildTools/macosx/install.sh +++ b/BuildTools/macosx/install.sh @@ -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 .. diff --git a/BuildTools/macosx/install_name.py b/BuildTools/macosx/install_name.py index b3f672b22..0afb2fcb6 100644 --- a/BuildTools/macosx/install_name.py +++ b/BuildTools/macosx/install_name.py @@ -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) @@ -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")