diff options
-rwxr-xr-x | .ci/azure-pipelines/build_linux.bash | 4 | ||||
-rwxr-xr-x | .ci/azure-pipelines/build_macos.bash | 4 | ||||
-rwxr-xr-x | .ci/azure-pipelines/release_macos.bash | 4 | ||||
-rw-r--r-- | .ci/build_windows.bat | 6 | ||||
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rwxr-xr-x | scripts/mumble-version.py | 73 | ||||
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/Version.h | 6 |
8 files changed, 9 insertions, 92 deletions
diff --git a/.ci/azure-pipelines/build_linux.bash b/.ci/azure-pipelines/build_linux.bash index e7e061d78..b0b2e6a50 100755 --- a/.ci/azure-pipelines/build_linux.bash +++ b/.ci/azure-pipelines/build_linux.bash @@ -26,12 +26,10 @@ else BUILD_NUMBER=0 fi -RELEASE_ID=$(python "scripts/mumble-version.py") - cd $BUILD_BINARIESDIRECTORY cmake -G Ninja -DCMAKE_INSTALL_PREFIX=appdir/usr -DCMAKE_UNITY_BUILD=ON \ - -DCMAKE_BUILD_TYPE=Release -DRELEASE_ID=$RELEASE_ID -DBUILD_NUMBER=$BUILD_NUMBER \ + -DCMAKE_BUILD_TYPE=Release -DBUILD_NUMBER=$BUILD_NUMBER \ -Dtests=ON -Dsymbols=ON -Dgrpc=ON \ -Ddisplay-install-paths=ON $BUILD_SOURCESDIRECTORY diff --git a/.ci/azure-pipelines/build_macos.bash b/.ci/azure-pipelines/build_macos.bash index 7bda34054..ff1099bb1 100755 --- a/.ci/azure-pipelines/build_macos.bash +++ b/.ci/azure-pipelines/build_macos.bash @@ -37,12 +37,10 @@ else BUILD_NUMBER=0 fi -RELEASE_ID=$(python "scripts/mumble-version.py") - cd $BUILD_BINARIESDIRECTORY cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=$MUMBLE_ENVIRONMENT_TOOLCHAIN -DIce_HOME="$MUMBLE_ENVIRONMENT_PATH/installed/x64-osx" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DRELEASE_ID=$RELEASE_ID -DBUILD_NUMBER=$BUILD_NUMBER \ + -DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DBUILD_NUMBER=$BUILD_NUMBER \ -Dtests=ON -Dstatic=ON -Dsymbols=ON -Dgrpc=ON \ -Ddisplay-install-paths=ON $BUILD_SOURCESDIRECTORY diff --git a/.ci/azure-pipelines/release_macos.bash b/.ci/azure-pipelines/release_macos.bash index 17b9c7e79..19e4ef110 100755 --- a/.ci/azure-pipelines/release_macos.bash +++ b/.ci/azure-pipelines/release_macos.bash @@ -13,10 +13,10 @@ # repository is downloaded. # -RELEASE_ID=$(python "scripts/mumble-version.py") +VERSION=$(python "scripts/mumble-version.py") cd $BUILD_BINARIESDIRECTORY -$BUILD_SOURCESDIRECTORY/macx/scripts/osxdist.py --version=$RELEASE_ID --source-dir=$BUILD_SOURCESDIRECTORY --binary-dir=. +$BUILD_SOURCESDIRECTORY/macx/scripts/osxdist.py --version=$VERSION --source-dir=$BUILD_SOURCESDIRECTORY --binary-dir=. mv *.dmg $BUILD_ARTIFACTSTAGINGDIRECTORY diff --git a/.ci/build_windows.bat b/.ci/build_windows.bat index fd65e8996..a1e027715 100644 --- a/.ci/build_windows.bat +++ b/.ci/build_windows.bat @@ -24,7 +24,7 @@ :: The method we use to store a command's output into a variable: :: https://stackoverflow.com/a/6362922 -for /f "tokens=* USEBACKQ" %%g in (`python "scripts\mumble-version.py" --format version`) do (set "VERSION=%%g") +for /f "tokens=* USEBACKQ" %%g in (`python "scripts\mumble-version.py"`) do (set "VERSION=%%g") :: For some really stupid reason we can't have this statement and the one where we set the VERSION variable in the same if body as :: in that case the variable substitution of that variable in the expression below fails (is replaced with empty string) @@ -36,8 +36,6 @@ if defined MUMBLE_BUILD_NUMBER_TOKEN ( set BUILD_NUMBER=0 ) -for /f "tokens=* USEBACKQ" %%g in (`python "scripts\mumble-version.py"`) do (set "RELEASE_ID=%%g") - :: Create build directory if it doesn't exist. if not exist "%MUMBLE_BUILD_DIRECTORY%" mkdir "%MUMBLE_BUILD_DIRECTORY% @@ -50,7 +48,7 @@ set PATH=%PATH%;C:\WixSharp cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE="%MUMBLE_ENVIRONMENT_TOOLCHAIN%" -DVCPKG_TARGET_TRIPLET=%MUMBLE_ENVIRONMENT_TRIPLET% ^ -DIce_HOME="%MUMBLE_ENVIRONMENT_PATH%\installed\%MUMBLE_ENVIRONMENT_TRIPLET%" ^ -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe ^ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DRELEASE_ID=%RELEASE_ID% -DBUILD_NUMBER=%BUILD_NUMBER% ^ + -DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DBUILD_NUMBER=%BUILD_NUMBER% ^ -Dpackaging=ON -Dtests=ON -Dstatic=ON -Dsymbols=ON -Dgrpc=ON -Dasio=ON -Dg15=ON ^ -Ddisplay-install-paths=ON %MUMBLE_SOURCE_REPOSITORY% diff --git a/CMakeLists.txt b/CMakeLists.txt index 987844d04..bfd7d3986 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,6 @@ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.20.0") endif() set(BUILD_NUMBER CACHE STRING "The build number of the current build. Will be used in Mumble's version to make sure newer builds upgrade older installations properly.") -set(RELEASE_ID CACHE STRING "The ID of the current release (used for representation in the UI and the updater)") if ("${BUILD_NUMBER}" STREQUAL "") if(packaging) @@ -89,7 +88,6 @@ target_architecture(MUMBLE_TARGET_ARCH) string(TOLOWER "${MUMBLE_TARGET_ARCH}" MUMBLE_TARGET_ARCH) message(STATUS "##################################################") -message(STATUS "Mumble release ID: ${RELEASE_ID}") message(STATUS "Mumble version: ${PROJECT_VERSION}") message(STATUS "Architecture: ${MUMBLE_TARGET_ARCH}") if(NOT IS_MULTI_CONFIG) diff --git a/scripts/mumble-version.py b/scripts/mumble-version.py index b43ad9d84..3aa8119ad 100755 --- a/scripts/mumble-version.py +++ b/scripts/mumble-version.py @@ -5,55 +5,7 @@ # that can be found in the LICENSE file at the root of the # Mumble source tree or at <https://www.mumble.info/LICENSE>. # -# This script returns the Mumble version string for a Mumble Git -# repository. The script must be run from within a Mumble Git -# repository. -# This is a replacement for `git describe` to make snapshots -# use the future, untagged version number rather than the previous. -# -# The version is of form 1.3.0~2020-07-02~g4f336a2~snapshot. -# It includes the target release version rather than the previous -# release (as git describe does). -# -# Detailed description: -# -# Once upon a time, Mumble used the output of `git describe` as -# its version string. -# -# If a commit was tagged, it was a "release", and got a simple -# string which was the name of the tag. -# -# If a commit wasn't tagged, it got '1.2.6-234-gf552ag1', which -# consists of the number of commits since the latest tag, and -# the commit hash of the latest commit. -# -# However, the output of `git describe` was found to be confusing -# in practice. This is because the base version of the `git describe` -# output is the latest tag, which is to say: the *previous* -# version of Mumble. -# -# So, a user running a snapshot that would become 1.3.0 would be -# running a version like 1.2.6-234-gf552ag1. This is confusing -# simply by looking at the version numbers, but the way versioning -# works inside the Mumble client made it worse: the client's version -# was referred to as "1.3.0" in several places, but the actual version -# number said 1.2.6-234-gf552ag1. -# -# This script is the replacement for `git describe`. It outputs the -# *actual* base version of the Mumble tree, rather than the latest tag. -# This means that snapshots for Mumble 1.3.0 now have the base version -# '1.3.0'. -# -# It also changes the version string: Instead of using dashes -# as a separator in the version string, it now uses tildes. This allows -# Debian's dpkg version comparer to correctly sort snapshot versions -# before release versions. The new string also includes 'snapshot' in the -# version string to denote to users that the given version is a pre-release -# snapshot. -# Furthermore the version number does use the latest commit's date rather -# than therevision number since the last tag. -# A full new-style version string looks like this: -# 1.3.0~2020-07-02~g4f336a2~snapshot. +# This script reads and prints the current Mumble version from __future__ import (unicode_literals, print_function, division) @@ -100,10 +52,7 @@ def readProjectVersion(): def main(): parser = argparse.ArgumentParser() - parser.add_argument('-f', '--format', choices = ['full', 'version', 'suffix'], default='full', help = 'Output format') parser.add_argument('-n', '--newline', action = "store_true", help = 'Break line after printing version') - parser.add_argument('-r', '--revision', type = int, default = 1, help = 'Revision (only used for type \'beta\' and \'rc\')') - parser.add_argument('-t', '--type', choices = ['snapshot', 'beta', 'rc', 'stable'], default = 'snapshot', help = 'Release type - determines the suffix') args = parser.parse_args() if args.newline: @@ -113,27 +62,9 @@ def main(): version = readProjectVersion() - if args.format == 'version': - print(version, end = end) - return - - suffix = '' + print(version, end = end) - if args.type == 'rc' or args.type == 'beta': - suffix = '-{0}{1}'.format(args.type, args.revision) - elif args.type == 'snapshot': - # Get the date of the most recent commit - latestCommitDate = cmd(['git', 'log', '-1', '--format=%cd', '--date=short']).strip() - # Get the hash of the most recent commit (shortened) - latestCommitHash = cmd(['git', 'rev-parse', '--short', 'HEAD']).strip() - - suffix = '~{0}~g{1}~snapshot'.format(latestCommitDate, latestCommitHash) - - if args.format == 'suffix': - print(suffix, end = end) - else: - print(version + suffix, end = end) if __name__ == '__main__': main() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4ded17ed1..8d95b922e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -128,8 +128,6 @@ target_sources(shared target_compile_definitions(shared PUBLIC "MUMBLE_VERSION=${PROJECT_VERSION}" - # Only define this macro if RELEASE_ID is actually set - $<$<NOT:$<STREQUAL:"${RELEASE_ID}","">>:MUMBLE_RELEASE_ID=${RELEASE_ID}> ) target_compile_definitions(shared diff --git a/src/Version.h b/src/Version.h index e7fca1afc..2980b8fc8 100644 --- a/src/Version.h +++ b/src/Version.h @@ -11,11 +11,7 @@ #define MUMXTEXT(X) #X #define MUMTEXT(X) MUMXTEXT(X) -#ifndef MUMBLE_RELEASE_ID -# define MUMBLE_RELEASE "Compiled by User" -#else -# define MUMBLE_RELEASE MUMTEXT(MUMBLE_RELEASE_ID) -#endif +#define MUMBLE_RELEASE MUMTEXT(MUMBLE_VERSION) namespace Version { |