diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-05-19 12:20:54 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-05-19 12:20:54 +0300 |
commit | 8357040667f3008d9d0f1e33f0b0dc54ff4a3ef8 (patch) | |
tree | bf3743b1cf42a7fa257fb2cac3a835bc7da17825 /build_files | |
parent | 8ef679b6fddfa4f9d6a417b578e8ce77ca320c61 (diff) | |
parent | e8561e966d3d6ced9569e9a91aa123975e9ee95a (diff) |
Merge branch 'master' into gooseberry
Conflicts:
source/blender/windowmanager/intern/wm_playanim.c
Diffstat (limited to 'build_files')
-rw-r--r-- | build_files/buildbot/master_unpack.py | 4 | ||||
-rw-r--r-- | build_files/cmake/Modules/FindPythonLibsUnix.cmake | 35 | ||||
-rwxr-xr-x | build_files/cmake/cmake_consistency_check.py | 18 | ||||
-rw-r--r-- | build_files/cmake/cmake_consistency_check_config.py | 3 | ||||
-rw-r--r-- | build_files/cmake/packaging.cmake | 6 | ||||
-rw-r--r-- | build_files/scons/tools/Blender.py | 6 |
6 files changed, 58 insertions, 14 deletions
diff --git a/build_files/buildbot/master_unpack.py b/build_files/buildbot/master_unpack.py index 46131c5e1de..ec44705931c 100644 --- a/build_files/buildbot/master_unpack.py +++ b/build_files/buildbot/master_unpack.py @@ -124,10 +124,12 @@ else: directory = 'public_html/download' try: + filename = os.path.join(directory, packagename) zf = z.open(package) - f = file(os.path.join(directory, packagename), "wb") + f = file(filename, "wb") shutil.copyfileobj(zf, f) + os.chmod(filename, 0644) zf.close() z.close() diff --git a/build_files/cmake/Modules/FindPythonLibsUnix.cmake b/build_files/cmake/Modules/FindPythonLibsUnix.cmake index 555ca4cf0a0..e4236fb4c24 100644 --- a/build_files/cmake/Modules/FindPythonLibsUnix.cmake +++ b/build_files/cmake/Modules/FindPythonLibsUnix.cmake @@ -66,6 +66,14 @@ IF(DEFINED PYTHON_LIBPATH) SET(_IS_LIB_PATH_DEF ON) ENDIF() +STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION}) + +SET(_python_SEARCH_DIRS + ${PYTHON_ROOT_DIR} + "$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}" + "/opt/py${_PYTHON_VERSION_NO_DOTS}" + "/opt/lib/python-${PYTHON_VERSION}" +) # only search for the dirs if we havn't already IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_LIB_PATH_DEF)) @@ -75,14 +83,7 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_ "dm;dmu;du;d" # debug ) - STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION}) - SET(_python_SEARCH_DIRS - ${PYTHON_ROOT_DIR} - "$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}" - "/opt/py${_PYTHON_VERSION_NO_DOTS}" - "/opt/lib/python-${PYTHON_VERSION}" - ) FOREACH(_CURRENT_ABI_FLAGS ${_python_ABI_FLAGS}) #IF(CMAKE_BUILD_TYPE STREQUAL Debug) @@ -147,6 +148,7 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_ ENDIF() IF(PYTHON_LIBRARY AND PYTHON_LIBPATH AND PYTHON_INCLUDE_DIR AND PYTHON_INCLUDE_CONFIG_DIR) + SET(_PYTHON_ABI_FLAGS "${_CURRENT_ABI_FLAGS}") break() ELSE() # ensure we dont find values from 2 different ABI versions @@ -169,7 +171,6 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_ UNSET(_CURRENT_PATH) UNSET(_python_ABI_FLAGS) - UNSET(_python_SEARCH_DIRS) ENDIF() UNSET(_IS_INC_DEF) @@ -201,14 +202,28 @@ IF(PYTHONLIBSUNIX_FOUND) # XXX No more valid with debian-like py3.4 packages... # GET_FILENAME_COMPONENT(PYTHON_LIBPATH ${PYTHON_LIBRARY} PATH) - # not used - # SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "") + # not required for build, just used when bundling Python. + FIND_PROGRAM( + PYTHON_EXECUTABLE + NAMES + "python${PYTHON_VERSION}${_PYTHON_ABI_FLAGS}" + "python${PYTHON_VERSION}" + "python" + HINTS + ${_python_SEARCH_DIRS} + PATH_SUFFIXES bin + ) ENDIF() +UNSET(_PYTHON_VERSION_NO_DOTS) +UNSET(_PYTHON_ABI_FLAGS) +UNSET(_python_SEARCH_DIRS) + MARK_AS_ADVANCED( PYTHON_INCLUDE_DIR PYTHON_INCLUDE_CONFIG_DIR PYTHON_LIBRARY PYTHON_LIBPATH PYTHON_SITE_PACKAGES + PYTHON_EXECUTABLE ) diff --git a/build_files/cmake/cmake_consistency_check.py b/build_files/cmake/cmake_consistency_check.py index 0883bdbf2d7..1a366880315 100755 --- a/build_files/cmake/cmake_consistency_check.py +++ b/build_files/cmake/cmake_consistency_check.py @@ -28,7 +28,13 @@ if not sys.version.startswith("3"): sys.version.partition(" ")[0]) sys.exit(1) -from cmake_consistency_check_config import IGNORE, UTF8_CHECK, SOURCE_DIR +from cmake_consistency_check_config import ( + IGNORE, + UTF8_CHECK, + SOURCE_DIR, + BUILD_DIR, + ) + import os from os.path import join, dirname, normpath, splitext @@ -134,6 +140,7 @@ def cmake_get_src(f): if found: cmake_base = dirname(f) + cmake_base_bin = os.path.join(BUILD_DIR, os.path.relpath(cmake_base, SOURCE_DIR)) while it is not None: i += 1 @@ -154,6 +161,8 @@ def cmake_get_src(f): # replace dirs l = l.replace("${CMAKE_CURRENT_SOURCE_DIR}", cmake_base) + l = l.replace("${CMAKE_CURRENT_BINARY_DIR}", cmake_base_bin) + l = l.strip('"') if not l: pass @@ -193,7 +202,10 @@ def cmake_get_src(f): raise Exception("unknown file type - not c or h %s -> %s" % (f, new_file)) elif context_name == "INC": - if os.path.isdir(new_file): + if new_file.startswith(BUILD_DIR): + # assume generated path + pass + elif os.path.isdir(new_file): new_path_rel = os.path.relpath(new_file, cmake_base) if new_path_rel != l: @@ -246,7 +258,7 @@ print("\nChecking for missing references:") is_err = False errs = [] for f in (global_h | global_c): - if f.endswith("dna.c"): + if f.startswith(BUILD_DIR): continue if not os.path.exists(f): diff --git a/build_files/cmake/cmake_consistency_check_config.py b/build_files/cmake/cmake_consistency_check_config.py index 729eecce233..1f75b9884bc 100644 --- a/build_files/cmake/cmake_consistency_check_config.py +++ b/build_files/cmake/cmake_consistency_check_config.py @@ -74,3 +74,6 @@ IGNORE = ( UTF8_CHECK = True SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "..")))) + +# doesn't have to exist, just use as reference +BUILD_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(SOURCE_DIR, "..", "build")))) diff --git a/build_files/cmake/packaging.cmake b/build_files/cmake/packaging.cmake index f0dd0482d4d..0cb13e0fc66 100644 --- a/build_files/cmake/packaging.cmake +++ b/build_files/cmake/packaging.cmake @@ -112,3 +112,9 @@ elseif(UNIX) "tar.bz2") endif() +unset(MAJOR_VERSION) +unset(MINOR_VERSION) +unset(PATCH_VERSION) + +unset(BUILD_REV) + diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index fe171f9257b..03ca5e9c0ae 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -877,6 +877,7 @@ def UnixPyBundle(target=None, source=None, env=None): py_src = env.subst( env['BF_PYTHON_LIBPATH'] + '/python'+env['BF_PYTHON_VERSION'] ) py_target = env.subst( dir + '/python/' + target_lib + '/python'+env['BF_PYTHON_VERSION'] ) + py_target_bin = env.subst(dir + '/python/bin') # This is a bit weak, but dont install if its been installed before, makes rebuilds quite slow. if os.path.exists(py_target): @@ -896,6 +897,11 @@ def UnixPyBundle(target=None, source=None, env=None): except: pass + # install the executable + run("rm -rf '%s'" % py_target_bin) + os.makedirs(py_target_bin) + run("cp '%s' '%s'" % (env.subst(env['BF_PYTHON_BINARY']), py_target_bin)) + run("cp -R '%s' '%s'" % (py_src, os.path.dirname(py_target))) run("rm -rf '%s/distutils'" % py_target) run("rm -rf '%s/lib2to3'" % py_target) |