b2912ac1b5
We use https://github.com/wangqr/Aegisub/pull/121 to allow building from a tarball and avoid cloning from git. Fix #31637
56 lines
2 KiB
Diff
56 lines
2 KiB
Diff
From dee94396eee4b67eafae7f00e540cb284769473d Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
|
|
Date: Wed, 15 Sep 2021 23:54:10 -0300
|
|
Subject: [PATCH] Allow CMake builds from tarball.
|
|
|
|
Add environment variable that can be passed to build/version.sh to force
|
|
a git version if it can't use git to determine one.
|
|
|
|
Since we are here, also fix:
|
|
|
|
- use of 'return' in a script, should be 'exit'
|
|
- wrong grep command to match numerical version with 3 digits
|
|
---
|
|
build/version.sh | 10 +++++-----
|
|
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/build/version.sh b/build/version.sh
|
|
index 8cea0a3f3..d505341e4 100755
|
|
--- a/build/version.sh
|
|
+++ b/build/version.sh
|
|
@@ -10,13 +10,13 @@ if ! test -d "${srcdir}/.git"; then
|
|
done < "${version_h_path}"
|
|
if test x$BUILD_GIT_VERSION_NUMBER != x -a x$BUILD_GIT_VERSION_STRING != x; then
|
|
export VERSION_SOURCE="from cached git_version.h"
|
|
- return 0
|
|
+ exit 0
|
|
else
|
|
echo "invalid git_version.h"
|
|
exit 2
|
|
fi
|
|
- else
|
|
- echo "git repo not found and no cached git_version.h"
|
|
+ elif [ -z "$FORCE_GIT_VERSION" ]; then
|
|
+ echo "git repo not found and no cached git_version.h - use FORCE_GIT_VERSION to override"
|
|
exit 2
|
|
fi
|
|
fi
|
|
@@ -25,13 +25,13 @@ last_svn_revision=6962
|
|
last_svn_hash="16cd907fe7482cb54a7374cd28b8501f138116be"
|
|
|
|
git_revision=$(expr $last_svn_revision + $(git log --pretty=oneline $last_svn_hash..HEAD 2>/dev/null | wc -l))
|
|
-git_version_str=$(git describe --exact-match 2> /dev/null)
|
|
+git_version_str=${FORCE_GIT_VERSION:-$(git describe --exact-match 2> /dev/null)}
|
|
installer_version='0.0.0'
|
|
resource_version='0, 0, 0'
|
|
if test x$git_version_str != x; then
|
|
git_version_str="${git_version_str##v}"
|
|
tagged_release=1
|
|
- if [ $(echo $git_version_str | grep '\d\.\d\.\d') ]; then
|
|
+ if [ $(echo $git_version_str | grep '[0-9].[0-9].[0-9]') ]; then
|
|
installer_version=$git_version_str
|
|
resource_version=$(echo $git_version_str | sed 's/\./, /g')
|
|
fi
|
|
--
|
|
2.33.0
|
|
|