about summary refs log tree commit diff
path: root/pkgs/applications/video/aegisub/no-git.patch
blob: c98467ca6525f8c44daa7c296adfe9dba2b59f2e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Modified from <https://github.com/wangqr/Aegisub/commit/f8dca9f6386299ec2f90158e2d923a8fb30e3466>
to patch cleanly to v3.3.2. Necessary for building without git.
Upstream and will be in next release.

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