replace ::cast_dynamic() with relevant ActionManager::get_*_action() calls
[ardour.git] / tools / define_versions.sh
1
2 # this is sourced by build and package, and executed from within build/{osx,linux}_packaging
3 #
4
5 if uname -a | grep arwin >/dev/null 2>&1 ; then
6     EXTENDED_RE=-E
7 else
8     EXTENDED_RE=-r
9 fi
10
11 GIT_REV_REGEXP='([0-9][0-9]*)\.([0-9][0-9]*)\-?([pr][rc]e?[0-9]*)?-?([0-9][0-9]*)?(-g([a-f0-9]+))?'
12
13 major_version=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\1/"`
14 minor_version=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\2/"`
15
16 # Tracks tags with "MAJOR.MINOR.MICRO"
17 # Ardour doesn't use this
18
19 micro_version=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\3/"`
20
21 #
22 # RC e.g. 8.1-rc3 (optional)
23 # OR
24 # PRE e.g. 9.3-pre0 (optional)
25 #
26 # Tracks does not use -rcN based tagging
27 #
28 rc=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\3/"`
29
30 #
31 # revision count since tag
32 #
33 r=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\4/"`
34
35 #
36 # git short sha1 commit ID
37 #
38 commit=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\6/"`
39
40 if [ "x$rc" != "x" ] ; then
41     revcount=$rc${r:+.$r}
42 elif [ "x$r" != "x" ] ; then
43     revcount=$r
44 else
45     revcount=0
46 fi
47
48 release_version=${major_version}.${minor_version}${revcount:+.$revcount}
49
50 #
51 # Figure out the Build Type
52 #
53 # Note that the name of the cache file may vary from to time
54 #
55
56 if grep -q "DEBUG = True" ../../build/c4che/_cache.py; then
57         DEBUG="T"
58 else
59         DEBUG="F"
60 fi