Repository navigation
Develop #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #9
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -94,6 +94,23 @@ echo "" | |||||||||||
| echo ">>> cmake install → ${INSTALL_DIR}" | ||||||||||||
| cmake --install build | ||||||||||||
|
|
||||||||||||
| # ── Stage pure-python GDAL utilities (osgeo_utils) ──────────────────────────── | ||||||||||||
| # GDAL algorithms that embed Python at runtime (e.g. `gdal driver gpkg | ||||||||||||
| # validate`) import the osgeo_utils package. It is pure python (no compiled | ||||||||||||
| # extensions), lives in the GDAL source tree, and is version-locked to the | ||||||||||||
| # tag we just built. Staging it under <prefix>/python lets the R runtime | ||||||||||||
| # expose it to the embedded interpreter via PYTHONPATH. | ||||||||||||
| echo "" | ||||||||||||
| echo ">>> Staging osgeo_utils (gdal-utils) → ${INSTALL_DIR}/python" | ||||||||||||
| mkdir -p "${INSTALL_DIR}/python" | ||||||||||||
| cp -r "${SRC_DIR}/swig/python/gdal-utils/osgeo_utils" "${INSTALL_DIR}/python/" | ||||||||||||
|
Comment on lines
+105
to
+106
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If a previous build has already staged
Suggested change
|
||||||||||||
| PY_COUNT=$(find "${INSTALL_DIR}/python/osgeo_utils" -name '*.py' | wc -l) | ||||||||||||
| echo " osgeo_utils python files staged: ${PY_COUNT}" | ||||||||||||
| if [[ ! -f "${INSTALL_DIR}/python/osgeo_utils/samples/validate_gpkg.py" ]]; then | ||||||||||||
| echo "FATAL: osgeo_utils/samples/validate_gpkg.py missing after staging" | ||||||||||||
| exit 1 | ||||||||||||
| fi | ||||||||||||
|
|
||||||||||||
| echo "" | ||||||||||||
| echo ">>> Build complete." | ||||||||||||
| echo " DLL: ${INSTALL_DIR}/bin/libgdal-39.dll" | ||||||||||||
|
|
||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |||||||||||
| # include/ — public headers (for compiling against the bundle) | ||||||||||||
| # lib/ — import libraries (.dll.a) (for linking against the bundle) | ||||||||||||
| # share/ — gdal/proj runtime data files | ||||||||||||
| # python/ — pure-python osgeo_utils package for embedded-python algorithms | ||||||||||||
| # | ||||||||||||
| # The goal is that BUNDLE_DIR/bin/*.dll should load with zero external deps | ||||||||||||
| # beyond standard Windows system DLLs (kernel32, msvcrt, ucrtbase, etc.) | ||||||||||||
|
|
@@ -43,6 +44,16 @@ if [[ -d "${INSTALL_DIR}/share" ]]; then | |||||||||||
| cp -r "${INSTALL_DIR}/share/." "${BUNDLE_DIR}/share/" | ||||||||||||
| fi | ||||||||||||
|
|
||||||||||||
| # Pure-python GDAL utilities staged by build_gdal.sh. Required by GDAL | ||||||||||||
| # algorithms that embed Python at runtime (e.g. `gdal driver gpkg validate`). | ||||||||||||
| if [[ -d "${INSTALL_DIR}/python" ]]; then | ||||||||||||
| echo "" | ||||||||||||
| echo ">>> Copying python utilities (osgeo_utils)" | ||||||||||||
| mkdir -p "${BUNDLE_DIR}/python" | ||||||||||||
| cp -r "${INSTALL_DIR}/python/." "${BUNDLE_DIR}/python/" | ||||||||||||
|
Comment on lines
+52
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To prevent stale files from previous bundling attempts from persisting in the final bundle, it is safer to remove the existing
Suggested change
|
||||||||||||
| echo " python files: $(find "${BUNDLE_DIR}/python" -name '*.py' | wc -l)" | ||||||||||||
| fi | ||||||||||||
|
|
||||||||||||
| # ── Copy primary DLLs from install prefix ──────────────────────────────────── | ||||||||||||
| echo "" | ||||||||||||
| echo ">>> Copying primary DLLs from install prefix" | ||||||||||||
|
|
@@ -209,6 +220,7 @@ ls -lh "${BUNDLE_DIR}/bin/"*.dll | awk '{printf " %-50s %s\n", $NF, $5}' | |||||||||||
| echo "" | ||||||||||||
| echo "Headers (count): $(find "${BUNDLE_DIR}/include" -name '*.h' | wc -l)" | ||||||||||||
| echo "Import libs: $(ls "${BUNDLE_DIR}/lib/"*.dll.a 2>/dev/null | wc -l)" | ||||||||||||
| echo "Python utils: $(find "${BUNDLE_DIR}/python" -name '*.py' 2>/dev/null | wc -l) files" | ||||||||||||
| echo "" | ||||||||||||
| TOTAL=$(du -sh "${BUNDLE_DIR}" | cut -f1) | ||||||||||||
| echo "Total bundle size: ${TOTAL}" | ||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Windows, path comparisons can fail due to differences in case sensitivity or slash direction (e.g.,
C:/path/to/pythonvsc:\\path\to\python). To ensure robust detection of existingPYTHONPATHentries and avoid duplicate or redundant additions, normalize bothpython_dirandpy_parts(usingtolower()andnormalizePath()) before performing the%in%check.