diff options
Diffstat (limited to 'build_files')
-rw-r--r-- | build_files/buildbot/buildbot_utils.py | 15 | ||||
-rw-r--r-- | build_files/buildbot/slave_pack.py | 2 | ||||
-rw-r--r-- | build_files/cmake/macros.cmake | 33 | ||||
-rw-r--r-- | build_files/cmake/packaging.cmake | 2 | ||||
-rwxr-xr-x | build_files/utils/make_source_archive.sh | 7 |
5 files changed, 17 insertions, 42 deletions
diff --git a/build_files/buildbot/buildbot_utils.py b/build_files/buildbot/buildbot_utils.py index 369bb28006d..2dc1526c5e8 100644 --- a/build_files/buildbot/buildbot_utils.py +++ b/build_files/buildbot/buildbot_utils.py @@ -78,27 +78,26 @@ class VersionInfo: blender_h = os.path.join(builder.blender_dir, "source", "blender", "blenkernel", "BKE_blender_version.h") version_number = int(self._parse_header_file(blender_h, 'BLENDER_VERSION')) - self.version = "%d.%d" % (version_number // 100, version_number % 100) - self.version_char = self._parse_header_file(blender_h, 'BLENDER_VERSION_CHAR') + version_number_patch = int(self._parse_header_file(blender_h, 'BLENDER_VERSION_PATCH')) + version_numbers = (version_number // 100, version_number % 100, version_number_patch) + self.short_version = "%d.%02d" % (version_numbers[0], version_numbers[1]) + self.version = "%d.%02d.%d" % version_numbers self.version_cycle = self._parse_header_file(blender_h, 'BLENDER_VERSION_CYCLE') self.version_cycle_number = self._parse_header_file(blender_h, 'BLENDER_VERSION_CYCLE_NUMBER') self.hash = self._parse_header_file(buildinfo_h, 'BUILD_HASH')[1:-1] if self.version_cycle == "release": # Final release - self.full_version = self.version + self.version_char + self.full_version = self.version self.is_development_build = False elif self.version_cycle == "rc": # Release candidate version_cycle = self.version_cycle + self.version_cycle_number - if len(self.version_char) == 0: - self.full_version = self.version + version_cycle - else: - self.full_version = self.version + self.version_char + '-' + version_cycle + self.full_version = self.version + version_cycle self.is_development_build = False else: # Development build - self.full_version = self.version + self.version_char + '-' + self.hash + self.full_version = self.version + '-' + self.hash self.is_development_build = True def _parse_header_file(self, filename, define): diff --git a/build_files/buildbot/slave_pack.py b/build_files/buildbot/slave_pack.py index 3cefe2d5ec6..8549a7881e6 100644 --- a/build_files/buildbot/slave_pack.py +++ b/build_files/buildbot/slave_pack.py @@ -167,7 +167,7 @@ def pack_linux(builder): buildbot_utils.call(builder.command_prefix + ['strip', '--strip-all', blender_executable]) print("Stripping python...") - py_target = os.path.join(builder.install_dir, info.version) + py_target = os.path.join(builder.install_dir, info.short_version) buildbot_utils.call(builder.command_prefix + ['find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';']) # Construct package name diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 6287da55580..804447dbef3 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -748,8 +748,7 @@ function(get_blender_version) # - BLENDER_VERSION (major.minor) # - BLENDER_VERSION_MAJOR # - BLENDER_VERSION_MINOR - # - BLENDER_SUBVERSION (used for internal versioning mainly) - # - BLENDER_VERSION_CHAR (a, b, c, ...or empty string) + # - BLENDER_VERSION_PATCH # - BLENDER_VERSION_CYCLE (alpha, beta, rc, release) # So cmake depends on BKE_blender.h, beware of inf-loops! @@ -759,25 +758,15 @@ function(get_blender_version) file(STRINGS ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender_version.h _contents REGEX "^#define[ \t]+BLENDER_.*$") string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION[ \t]+([0-9]+).*" "\\1" _out_version "${_contents}") - string(REGEX REPLACE ".*#define[ \t]+BLENDER_SUBVERSION[ \t]+([0-9]+).*" "\\1" _out_subversion "${_contents}") - string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CHAR[ \t]+([a-z]+).*" "\\1" _out_version_char "${_contents}") + string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_PATCH[ \t]+([0-9]+).*" "\\1" _out_version_patch "${_contents}") string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CYCLE[ \t]+([a-z]+).*" "\\1" _out_version_cycle "${_contents}") if(NOT ${_out_version} MATCHES "[0-9]+") message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION") endif() - if(NOT ${_out_subversion} MATCHES "[0-9]+") - message(FATAL_ERROR "Version parsing failed for BLENDER_SUBVERSION") - endif() - - # clumsy regex, only single char are ok but it could be unset - - string(LENGTH "${_out_version_char}" _out_version_char_len) - if(NOT _out_version_char_len EQUAL 1) - set(_out_version_char "") - elseif(NOT ${_out_version_char} MATCHES "[a-z]+") - message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CHAR") + if(NOT ${_out_version_patch} MATCHES "[0-9]+") + message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_PATCH") endif() if(NOT ${_out_version_cycle} MATCHES "[a-z]+") @@ -787,23 +776,11 @@ function(get_blender_version) math(EXPR _out_version_major "${_out_version} / 100") math(EXPR _out_version_minor "${_out_version} % 100") - # for packaging, alpha to numbers - string(COMPARE EQUAL "${_out_version_char}" "" _out_version_char_empty) - if(${_out_version_char_empty}) - set(_out_version_char_index "0") - else() - set(_char_ls a b c d e f g h i j k l m n o p q r s t u v w x y z) - list(FIND _char_ls ${_out_version_char} _out_version_char_index) - math(EXPR _out_version_char_index "${_out_version_char_index} + 1") - endif() - # output vars set(BLENDER_VERSION "${_out_version_major}.${_out_version_minor}" PARENT_SCOPE) set(BLENDER_VERSION_MAJOR "${_out_version_major}" PARENT_SCOPE) set(BLENDER_VERSION_MINOR "${_out_version_minor}" PARENT_SCOPE) - set(BLENDER_SUBVERSION "${_out_subversion}" PARENT_SCOPE) - set(BLENDER_VERSION_CHAR "${_out_version_char}" PARENT_SCOPE) - set(BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index}" PARENT_SCOPE) + set(BLENDER_VERSION_PATCH "${_out_version_patch}" PARENT_SCOPE) set(BLENDER_VERSION_CYCLE "${_out_version_cycle}" PARENT_SCOPE) endfunction() diff --git a/build_files/cmake/packaging.cmake b/build_files/cmake/packaging.cmake index 0e530463659..de27d31323d 100644 --- a/build_files/cmake/packaging.cmake +++ b/build_files/cmake/packaging.cmake @@ -7,7 +7,7 @@ set(PROJECT_VENDOR "Blender Foundation") set(MAJOR_VERSION ${BLENDER_VERSION_MAJOR}) set(MINOR_VERSION ${BLENDER_VERSION_MINOR}) -set(PATCH_VERSION ${BLENDER_VERSION_CHAR_INDEX}) +set(PATCH_VERSION ${BLENDER_VERSION_PATCH}) set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}) set(CPACK_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION}) diff --git a/build_files/utils/make_source_archive.sh b/build_files/utils/make_source_archive.sh index cafd1c31486..5d9096f3235 100755 --- a/build_files/utils/make_source_archive.sh +++ b/build_files/utils/make_source_archive.sh @@ -7,15 +7,14 @@ BASE_DIR="$PWD" blender_srcdir=$(dirname -- $0)/../.. blender_version=$(grep "BLENDER_VERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}') -blender_version_char=$(grep "BLENDER_VERSION_CHAR\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}') +blender_version_patch=$(grep "BLENDER_VERSION_PATCH\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}') blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}') -blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}') +VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100).$blender_version_patch if [ "$blender_version_cycle" = "release" ] ; then - VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)$blender_version_char SUBMODULE_EXCLUDE="^\(release/scripts/addons_contrib\)$" else - VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)_$blender_subversion + VERSION=$VERSION-$blender_version_cycle SUBMODULE_EXCLUDE="^$" # dummy regex fi |