diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-07-28 21:16:39 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-07-28 21:16:39 +0400 |
commit | 435d19f772d2e64d1f982ed38392641dd3d2666e (patch) | |
tree | 0a9716f1180ef3c139619a7cc57e79f42ae4c1a7 /source | |
parent | 2c51978d2b61b7a8c4c3c14bf5a9a8d573a8120a (diff) |
Fix bundling of requests on debian-like systems
Couple of issues:
- Debian systems doesn't use site-packages but uses
dist-packages instead.
- Requetss from ubuntu repository depends on urlllib3
and chardet, which also implies six. copy those libs
as well.
I know it's all rather annoying, but no that much
choise is in here..
Diffstat (limited to 'source')
-rw-r--r-- | source/creator/CMakeLists.txt | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index bd223b8d540..83315250ad2 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -511,16 +511,22 @@ if(UNIX AND NOT APPLE) PATTERN "idlelib" EXCLUDE # ./idlelib PATTERN "test" EXCLUDE # ./test PATTERN "turtledemo" EXCLUDE # ./turtledemo - PATTERN "turtle.py" EXCLUDE # ./turtle.py + PATTERN "turtle.py" EXCLUDE # ./turtle.py ) # # doesnt work, todo # install(CODE "execute_process(COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/ -name '*.so' -exec strip -s {} '\;')") - + if(WITH_PYTHON_INSTALL_NUMPY) + # Install to the same directory as the source, so debian-like + # distros are happy with their policy. + set(_suffix "site-packages") + if(${PYTHON_NUMPY_PATH} MATCHES "dist-packages") + set(_suffix "dist-packages") + endif() install( DIRECTORY ${PYTHON_NUMPY_PATH}/numpy - DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/site-packages + DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/${_suffix} PATTERN ".svn" EXCLUDE PATTERN "__pycache__" EXCLUDE # * any cache * PATTERN "*.pyc" EXCLUDE # * any cache * @@ -534,19 +540,47 @@ if(UNIX AND NOT APPLE) PATTERN "*.h" EXCLUDE # some includes are not in include dirs PATTERN "*.a" EXCLUDE # ./core/lib/libnpymath.a - for linking, we dont need. ) + unset(_suffix) endif() # Copy requests, we need to generalize site-packages if(WITH_PYTHON_INSTALL_REQUESTS) + set(_suffix "site-packages") + if(${PYTHON_REQUESTS_PATH} MATCHES "dist-packages") + set(_suffix "dist-packages") + endif() install( DIRECTORY ${PYTHON_REQUESTS_PATH}/requests - DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/site-packages + DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/${_suffix} PATTERN ".svn" EXCLUDE PATTERN "__pycache__" EXCLUDE # * any cache * PATTERN "*.pyc" EXCLUDE # * any cache * PATTERN "*.pyo" EXCLUDE # * any cache * PATTERN "cacert.pem" EXCLUDE # for now we don't deal with security ) + # On some platforms requests does have extra dependencies. + set(_requests_deps "chardet" "urllib3") + foreach(_requests_dep ${_requests_deps}) + if(EXISTS ${PYTHON_REQUESTS_PATH}/${_requests_dep}) + install( + DIRECTORY ${PYTHON_REQUESTS_PATH}/${_requests_dep} + DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/${_suffix} + PATTERN ".svn" EXCLUDE + PATTERN "__pycache__" EXCLUDE # * any cache * + PATTERN "*.pyc" EXCLUDE # * any cache * + PATTERN "*.pyo" EXCLUDE # * any cache * + ) + endif() + endforeach() + if(EXISTS ${PYTHON_REQUESTS_PATH}/six.py) + install( + FILES ${PYTHON_REQUESTS_PATH}/six.py + DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/${_suffix} + ) + endif() + unset(_requests_dep) + unset(_requests_deps) + unset(_suffix) endif() unset(_target_LIB) |