Merge pull request #25959 from neo1973/TagLib_deprecation_warnings
[xbmc.git] / tools / buildsteps / defaultenv
blob89889c6cf8c24bc364219a96b7bc034ee1d97544
1 BUILDTHREADS=${BUILDTHREADS:-1}
2 SDK_VERSION=${SDK_VERSION:-"Default"}
3 NDK_VERSION=${NDK_VERSION:-"Default"}
4 NDK_API=${NDK_API:-"Default"}
5 Configuration=${Configuration:-"Default"}
6 XBMC_DEPENDS_ROOT=${XBMC_DEPENDS_ROOT:-"Default"}
7 XCODE_APP=${XCODE_APP:-"Default"}
8 PATH_CHANGE_REV_FILENAME=".last_success_revision"
9 FAILED_BUILD_FILENAME=".last_failed_revision"
10 #TARBALLS ENV-VAR is only used by android scripts atm
11 TARBALLS=${TARBALLS:-"/opt/xbmc-tarballs"}
12 RENDER_SYSTEM=${RENDER_SYSTEM:-"Default"}
13 BUILD_HOST=${BUILD_HOST:-"Default"}
15 BINARY_ADDONS_ROOT=tools/depends/target
16 BINARY_ADDONS="binary-addons"
17 DEPLOYED_BINARY_ADDONS="-e /addons"
19 # Jenkins env variables
20 JENKINS_BUILD_TIMESTAMP=${BUILD_TIMESTAMP:-"unknown"}
21 JENKINS_BUILD_COMMIT=$(echo ${GIT_COMMIT:-"unknown"} | cut -c1-8)
22 JENKINS_BUILD_REVISION=${Revision:-"unknown"}
23 JENKINS_BUILD_ID=${BUILD_ID:-"unknown"}
25 JENKINS_BUILD_STRING="${JENKINS_BUILD_TIMESTAMP}-${JENKINS_BUILD_COMMIT}-${JENKINS_BUILD_REVISION}-${JENKINS_BUILD_ID}"
27 #set platform defaults
28 #$XBMC_PLATFORM_DIR matches the platform subdirs!
29 case $XBMC_PLATFORM_DIR in
30   ios)
31     DEFAULT_SDK_VERSION=17.2
32     DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
33     DEFAULT_CONFIGURATION="Debug"
34     DEFAULT_XCODE_APP="Xcode_15.2.app"
35     ;;
37   tvos)
38     DEFAULT_SDK_VERSION=17.2
39     DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
40     DEFAULT_CONFIGURATION="Debug"
41     DEFAULT_XCODE_APP="Xcode_15.2.app"
42     ;;
44   osx64)
45     DEFAULT_SDK_VERSION=14.2
46     DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
47     DEFAULT_CONFIGURATION="Debug"
48     DEFAULT_XCODE_APP="Xcode_15.2.app"
49     ;;
51   osx-arm64)
52     DEFAULT_SDK_VERSION=14.2
53     DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
54     DEFAULT_CONFIGURATION="Debug"
55     DEFAULT_XCODE_APP="Xcode_15.2.app"
56     ;;
58   android)
59     DEFAULT_NDK_VERSION="27.2.12479018" # NDK package version (newer API can be inside)
60     DEFAULT_NDK_API="24" # Nougat API level (24) defined in package ./sysroot/usr/include/android/api-level.h
61     DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
62     DEFAULT_CONFIGURATION="RelWithDebInfo"
63     ;;
65   linux)
66     DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
67     DEFAULT_CONFIGURATION="Debug"
68     DEFAULT_RENDER_SYSTEM="gl"
69     DEFAULT_BUILD_HOST="x86_64-linux-gnu"
70   ;;
72   freebsd)
73     DEFAULT_CONFIGURATION="Debug"
74   ;;
75 esac
77 if [ "$SDK_VERSION" == "Default" ]
78 then
79   SDK_VERSION=$DEFAULT_SDK_VERSION
82 if [ "$NDK_VERSION" == "Default" ]
83 then
84   NDK_VERSION=$DEFAULT_NDK_VERSION
87 if [ "$NDK_API" == "Default" ]
88 then
89   NDK_API=$DEFAULT_NDK_API
92 if [ "$XBMC_DEPENDS_ROOT" == "Default" ]
93 then
94   XBMC_DEPENDS_ROOT=$DEFAULT_XBMC_DEPENDS_ROOT
97 if [ "$XCODE_APP" == "Default" ]
98 then
99   XCODE_APP=$DEFAULT_XCODE_APP
102 # make osx environment aware of the selected xcode app
103 export DEVELOPER_DIR=/Applications/$XCODE_APP/Contents/Developer
105 if [ "$Configuration" == "Default" ]
106 then
107   Configuration=$DEFAULT_CONFIGURATION
110 if [ "$Configuration" == "Release" ]
111 then
112   DEBUG_SWITCH='--disable-debug'
115 if [ "$RENDER_SYSTEM" == "Default" ]
116 then
117   RENDER_SYSTEM=$DEFAULT_RENDER_SYSTEM
120 if [ "$BUILD_HOST" == "Default" ]
121 then
122   BUILD_HOST=$DEFAULT_BUILD_HOST
125 #helper functions
127 #hash a dir based on the git revision, Configuration, SDK_PATH, NDK_PATH, NDK_VERSION, SDK_VERSION, TOOLCHAIN and XBMC_DEPENDS_ROOT
128 #param1 path to be hashed
129 function getBuildHash ()
131   local checkPath
132   checkPath="$1"
133   local hashStr
134   hashStr="$(git rev-list HEAD --max-count=1  -- $checkPath)"
135   hashStr="$hashStr $Configuration $SDK_PATH $NDK_PATH $NDK_VERSION $SDK_VERSION $TOOLCHAIN $XBMC_DEPENDS_ROOT $XCODE_APP"
136   echo $hashStr
139 #param1 path to be checked for changes
140 function pathChanged ()
142   local ret
143   local checkPath
144   ret="0"
146   checkPath="$1"
147   if [ -e $checkPath/$PATH_CHANGE_REV_FILENAME ]
148   then
149     if [ "$(cat $checkPath/$PATH_CHANGE_REV_FILENAME)" != "$(getBuildHash $checkPath)" ]
150     then
151       ret="1"
152     fi
153   else
154     ret="1"
155   fi
157   echo $ret
160 #param1 path to be tagged with hash
161 function tagSuccessFulBuild ()
163   local pathToTag
164   pathToTag="$1"
165   # tag last successful build with revisions of the given dir
166   # needs to match the checks in function getBuildHash
167   echo "$(getBuildHash $pathToTag)" > $pathToTag/$PATH_CHANGE_REV_FILENAME
170 #param1 path to be tagged with hash
171 function tagFailedBuild ()
173   local pathToTag
174   pathToTag="$1"
175   # tag last failed build with revisions of the given dir
176   # needs to match the checks in function getBuildHash
177   echo "$(getBuildHash $pathToTag)" > $pathToTag/$FAILED_BUILD_FILENAME
180 function getBuildRevDateStr ()
182   echo "${JENKINS_BUILD_STRING}"