-
Notifications
You must be signed in to change notification settings - Fork 174
Open
Labels
PythonRelated to Python bindingRelated to Python bindingbuild_CIRelated to CMake, auto-tools build infrastructure and github CIRelated to CMake, auto-tools build infrastructure and github CIenhancementNew feature or requestNew feature or request
Description
I have a script that builds AVR toolchain, including avrdude. The sctipt installs the artifacts to a directory in my user's home. I've noticed that when I want to install v8.0, it directly targets /usr/local for installing some python module. Is there any workaround not doing it? I run my script as a normal user, and it keeps failing, as it is not writable by a non superuser.
I came up with this patch.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e358e4b1..7bef99ed 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -403,8 +403,10 @@ install(FILES "avrdude.1"
)
if(HAVE_SWIG)
- execute_process(COMMAND ${Python3_EXECUTABLE} -c "import site; print(site.getsitepackages()[0])"
- OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(NOT DEFINED PYTHON_SITE_PACKAGES)
+ execute_process(COMMAND ${Python3_EXECUTABLE} -c "import site; print(site.getsitepackages()[0])"
+ OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
+ endif()
install(TARGETS swig_avrdude DESTINATION ${PYTHON_SITE_PACKAGES})
install(FILES ${CMAKE_BINARY_DIR}/src/swig_avrdude.py DESTINATION ${PYTHON_SITE_PACKAGES})
install(DIRECTORY python/ DESTINATION ${CMAKE_INSTALL_DATADIR}/avrdude FILES_MATCHING PATTERN "*.ui")
And call cmake with something like this: "-DPYTHON_SITE_PACKAGES=python"
mcueendim
Metadata
Metadata
Assignees
Labels
PythonRelated to Python bindingRelated to Python bindingbuild_CIRelated to CMake, auto-tools build infrastructure and github CIRelated to CMake, auto-tools build infrastructure and github CIenhancementNew feature or requestNew feature or request