Skip to content
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

[swig,gdal] New port #25

Merged
merged 9 commits into from
May 13, 2024
Merged

[swig,gdal] New port #25

merged 9 commits into from
May 13, 2024

Conversation

m-kuhn
Copy link
Contributor

@m-kuhn m-kuhn commented Mar 14, 2024

No description provided.

@m-kuhn m-kuhn changed the title [swig] New port [swig,gdal] New port Mar 15, 2024
@m-kuhn
Copy link
Contributor Author

m-kuhn commented Mar 15, 2024

CC @dg0yt you might be interested in seeing python bindings for gdal

Comment on lines +172 to +182
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/Lib"
"${CURRENT_PACKAGES_DIR}/debug/Scripts"
)
file(COPY "${CURRENT_PACKAGES_DIR}/Lib/site-packages/" DESTINATION "${CURRENT_PACKAGES_DIR}/${PYTHON3_SITE}")
# TODO: Generalize for non windows
file(COPY "${CURRENT_PACKAGES_DIR}/Scripts" DESTINATION "${CURRENT_PACKAGES_DIR}/${PYTHON3_SITE}/../../Scripts")
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/Lib/site-packages"
"${CURRENT_PACKAGES_DIR}/Scripts"
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is certainly a hack, ideally we would convince setuptools to install into the proper prefix tools/python3 in the package directory, right now it installs into the root of the package directory. https://github.com/OSGeo/gdal/blob/a8a0fd5e526f664212dcca3204c686c768cbcc3d/swig/python/CMakeLists.txt#L207 Is where it's invoked.

Also, the current (hacky) destination for scripts is handcoded, relative to PYTHON3_SITE which is brittle too.

if os.name == 'nt':
os.add_dll_directory('@PACKAGE_DLL_DIR@')
os.add_dll_directory('@INSTALLED_DLL_DIR@')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should actually be ensured by other means

@m-kuhn m-kuhn force-pushed the swig branch 2 times, most recently from 4db06bf to 869c722 Compare May 13, 2024 06:27
@m-kuhn m-kuhn merged commit ebe7539 into main May 13, 2024
4 checks passed
@m-kuhn m-kuhn deleted the swig branch May 13, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant