Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #5175 from MartijnKaijser/appname

Make it easier to rebrand from a single file
  • Loading branch information...
commit bdf39043b7c39a489d6ce7229b5e70fd6a5aeaf0 2 parents e561c97 + 1da24b7
Martijn Kaijser MartijnKaijser authored
79 configure.in
View
@@ -115,6 +115,41 @@ AC_DEFUN([XB_PUSH_FLAGS], [
INCLUDES="$SAVE_INCLUDES"
])
+# version can be overridden by setting the following as ENV vars when running configure
+APP_NAME=${APP_NAME-$(${AWK} '/APP_NAME/ {print $2}' version.txt)}
+APP_VERSION_MAJOR=${APP_VERSION_MAJOR-$(${AWK} '/VERSION_MAJOR/ {print $2}' version.txt)}
+APP_VERSION_MINOR=${APP_VERSION_MINOR-$(${AWK} '/VERSION_MINOR/ {print $2}' version.txt)}
+APP_VERSION_TAG=${APP_VERSION_TAG-$(${AWK} '/VERSION_TAG/ {print $2}' version.txt)}
+APP_VERSION_TAG_LC=$(echo $APP_VERSION_TAG | ${AWK} '{print tolower($0)}')
+APP_VERSION_CODE=${APP_VERSION_CODE-$(${AWK} '/VERSION_CODE/ {print $2}' version.txt)}
+APP_ADDON_API=${APP_ADDON_API-$(${AWK} '/ADDON_API/ {print $2}' version.txt)}
+if test "$APP_NAME" != "" && test "$APP_VERSION_MAJOR" != "" && test "$APP_VERSION_MINOR" != "" \
+&& test "$APP_VERSION_TAG" != "" && test "$APP_VERSION_CODE" != "" && test "$APP_ADDON_API" != ""; then
+ final_message="$final_message\n ${APP_NAME} Version:\t${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}-${APP_VERSION_TAG}"
+ AC_SUBST(APP_NAME)
+ AC_SUBST(APP_VERSION_MAJOR)
+ AC_SUBST(APP_VERSION_MINOR)
+ AC_SUBST(APP_VERSION_TAG)
+ AC_SUBST(APP_VERSION_TAG_LC)
+ AC_SUBST(APP_VERSION_CODE)
+ AC_SUBST(APP_ADDON_API)
+else
+ AC_MSG_ERROR(could not detect application Version, make sure version.txt is complete)
+fi
+
+# check for GIT_REV
+AC_CHECK_PROG(HAVE_GIT,git,"yes","no",)
+if test "$GIT_REV" = ""; then
+ if test -f VERSION ; then
+ GIT_REV=$(awk 'END{print substr($1,1,16)}' VERSION)
+ elif test "$HAVE_GIT" = "yes" -a -d ${abs_top_srcdir}/.git; then
+ GIT_REV=$(git --no-pager log --abbrev=7 -n 1 --pretty=format:"%h %ci" HEAD | awk '{gsub("-", "");print $2"-"$1}')
+ else
+ GIT_REV="Unknown"
+ fi
+fi
+final_message="$final_message\n git Rev.:\t${GIT_REV}"
+
# General message strings
configure_debug="ERROR: this is a configure debug statement"
missing_library="Could not find a required library. Please see the README for your platform."
@@ -183,7 +218,7 @@ libcec_enabled="== libcec enabled. =="
libcec_disabled="== libcec disabled. CEC adapter support will not be available. =="
dashes="------------------------"
-final_message="\n XBMC Configuration:"
+final_message="\n ${APP_NAME} Configuration:"
final_message="\n$dashes$final_message\n$dashes"
AC_ARG_WITH([ffmpeg],
@@ -513,8 +548,8 @@ AC_ARG_ENABLE([codec],
AC_ARG_ENABLE([libav-compat],
[AS_HELP_STRING([--enable-libav-compat],
- [build a wrapper around libav to provide the functions needed by XBMC. This is
- *not* supported by XBMC developers and is provided only for convenience. (default is no) 'Linux only'])],
+ [build a wrapper around libav to provide the functions needed by ${APP_NAME}. This is
+ *not* supported by ${APP_NAME} developers and is provided only for convenience. (default is no) 'Linux only'])],
[use_libav_hacks=$enableval],
[use_libav_hacks=no])
@@ -687,39 +722,7 @@ esac
XBMC_SETUP_ARCH_DEFINES()
-# check for GIT_REV
-AC_CHECK_PROG(HAVE_GIT,git,"yes","no",)
-if test "$GIT_REV" = ""; then
- if test -f VERSION ; then
- GIT_REV=$(awk 'END{print substr($1,1,16)}' VERSION)
- elif test "$HAVE_GIT" = "yes" -a -d ${abs_top_srcdir}/.git; then
- GIT_REV=$(git --no-pager log --abbrev=7 -n 1 --pretty=format:"%h %ci" HEAD | awk '{gsub("-", "");print $2"-"$1}')
- else
- GIT_REV="Unknown"
- fi
-fi
-final_message="$final_message\n git Rev.:\t${GIT_REV}"
-
-# detect Xbmc soname version
-# version can be overridden by setting the following as ENV vars when running configure
-APP_VERSION_MAJOR=${APP_VERSION_MAJOR-$(${AWK} '/VERSION_MAJOR/ {print $2}' version.txt)}
-APP_VERSION_MINOR=${APP_VERSION_MINOR-$(${AWK} '/VERSION_MINOR/ {print $2}' version.txt)}
-APP_VERSION_TAG=${APP_VERSION_TAG-$(${AWK} '/VERSION_TAG/ {print $2}' version.txt)}
-APP_VERSION_TAG_LC=$(echo $APP_VERSION_TAG | ${AWK} '{print tolower($0)}')
-APP_VERSION_CODE=${APP_VERSION_CODE-$(${AWK} '/VERSION_CODE/ {print $2}' version.txt)}
-APP_ADDON_API=${APP_ADDON_API-$(${AWK} '/ADDON_API/ {print $2}' version.txt)}
-if test "$APP_VERSION_MAJOR" != "" && test "$APP_VERSION_MINOR" != "" && test "$APP_VERSION_TAG" != "" \
-&& test "$APP_VERSION_CODE" != "" && test "$APP_ADDON_API" != ""; then
- final_message="$final_message\n Xbmc Version:\t${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}-${APP_VERSION_TAG}"
- AC_SUBST(APP_VERSION_MAJOR)
- AC_SUBST(APP_VERSION_MINOR)
- AC_SUBST(APP_VERSION_TAG)
- AC_SUBST(APP_VERSION_TAG_LC)
- AC_SUBST(APP_VERSION_CODE)
- AC_SUBST(APP_ADDON_API)
-else
- AC_MSG_ERROR(could not detect XBMC Version, make sure version.txt is complete)
-fi
+# detect soname version
if test "$host_vendor" = "apple"; then
echo "#define GIT_REV \"$GIT_REV\"" > git_revision.h
@@ -780,7 +783,7 @@ if echo "$ARCH" | grep -q "freebsd" ; then
LDFLAGS="$LDFLAGS -L$LOCALBASE/lib"
fi
if test "$host_vendor" = "apple" ; then
- # standard xbmc paths
+ # standard application paths
INCLUDES="$INCLUDES -I\$(abs_top_srcdir)/xbmc/osx"
if test "$use_arch" != "arm"; then
LIBS="$LIBS -framework ApplicationServices"
@@ -1010,7 +1013,7 @@ else
AC_CHECK_LIB([GLU], [main],, AC_MSG_ERROR($missing_library))
fi
else
- AC_MSG_RESULT(== WARNING: OpenGL support is disabled. XBMC will run VERY slow. ==)
+ AC_MSG_RESULT(== WARNING: OpenGL support is disabled. ${APP_NAME} will run VERY slow. ==)
AC_CHECK_LIB([SDL_gfx],[main])
fi
fi
1  project/cmake/xbmc-config.cmake.in
View
@@ -1,4 +1,5 @@
SET(XBMC_INCLUDE_DIR @prefix@/include)
+SET(APP_NAME @APP_NAME@)
SET(APP_VERSION_MAJOR @APP_VERSION_MAJOR@)
SET(APP_VERSION_MINOR @APP_VERSION_MINOR@)
LIST(APPEND CMAKE_MODULE_PATH @prefix@/lib/xbmc)
6 tools/windows/CompileInfo.bat
View
@@ -8,6 +8,8 @@ SET bin_dir=%builddeps_dir%\bin
SET msys_bin_dir=%builddeps_dir%\msys\bin
REM read the version values from version.txt
+FOR /f %%i IN ('%msys_bin_dir%\awk.exe "/APP_NAME/ {print $2}" %base_dir%\version.txt') DO SET app_name=%%i
+FOR /f %%i IN ('%msys_bin_dir%\awk.exe "/COMPANY_NAME/ {print $2}" %base_dir%\version.txt') DO SET company_name=%%i
FOR /f %%i IN ('%msys_bin_dir%\awk.exe "/VERSION_MAJOR/ {print $2}" %base_dir%\version.txt') DO SET major=%%i
FOR /f %%i IN ('%msys_bin_dir%\awk.exe "/VERSION_MINOR/ {print $2}" %base_dir%\version.txt') DO SET minor=%%i
FOR /f %%i IN ('%msys_bin_dir%\awk.exe "/VERSION_TAG/ {print $2}" %base_dir%\version.txt') DO SET tag=%%i
@@ -18,7 +20,7 @@ SET separator=,
CALL SET file_version=%%addon_api:.=%separator%%%%separator%0
REM create the files with the proper version information
-"%msys_bin_dir%\sed.exe" -e s/@APP_VERSION_MAJOR@/%major%/g -e s/@APP_VERSION_MINOR@/%minor%/g -e s/@APP_VERSION_TAG@/%tag%/g "%base_dir%\xbmc\CompileInfo.cpp.in" > "%base_dir%\xbmc\CompileInfo.cpp"
+"%msys_bin_dir%\sed.exe" -e s/@APP_NAME@/%app_name%/g -e s/@APP_VERSION_MAJOR@/%major%/g -e s/@APP_VERSION_MINOR@/%minor%/g -e s/@APP_VERSION_TAG@/%tag%/g "%base_dir%\xbmc\CompileInfo.cpp.in" > "%base_dir%\xbmc\CompileInfo.cpp"
"%msys_bin_dir%\sed.exe" s/@APP_ADDON_API@/%addon_api%/g "%base_dir%\addons\xbmc.addon\addon.xml.in" > "%base_dir%\addons\xbmc.addon\addon.xml"
-"%msys_bin_dir%\sed.exe" -e s/@APP_VERSION_MAJOR@/%major%/g -e s/@APP_VERSION_MINOR@/%minor%/g -e s/@APP_VERSION_TAG@/%tag%/g -e s/@FILE_VERSION@/%file_version%/g "%base_dir%\xbmc\win32\XBMC_PC.rc.in" > "%base_dir%\xbmc\win32\XBMC_PC.rc"
+"%msys_bin_dir%\sed.exe" -e s/@APP_NAME@/%app_name%/g -e s/@COMPANY_NAME@/%company_name%/g -e s/@APP_VERSION_MAJOR@/%major%/g -e s/@APP_VERSION_MINOR@/%minor%/g -e s/@APP_VERSION_TAG@/%tag%/g -e s/@FILE_VERSION@/%file_version%/g "%base_dir%\xbmc\win32\XBMC_PC.rc.in" > "%base_dir%\xbmc\win32\XBMC_PC.rc"
5 version.txt
View
@@ -1,5 +1,10 @@
+APP_NAME Kodi
+COMPANY_NAME Team-Kodi
VERSION_MAJOR 14
VERSION_MINOR 0
VERSION_TAG ALPHA3
VERSION_CODE 139703
ADDON_API 13.9.703
+
+# Notes:
+# Change AC_INIT in configure.in
8 xbmc/Application.cpp
View
@@ -690,8 +690,8 @@ bool CApplication::Create()
CProfilesManager::Get().Load();
CLog::Log(LOGNOTICE, "-----------------------------------------------------------------------");
- CLog::Log(LOGNOTICE, "Starting Kodi (%s). Platform: %s %s %d-bit", g_infoManager.GetVersion().c_str(), g_sysinfo.GetBuildTargetPlatformName().c_str(),
- g_sysinfo.GetBuildTargetCpuFamily().c_str(), g_sysinfo.GetXbmcBitness());
+ CLog::Log(LOGNOTICE, "Starting %s (%s). Platform: %s %s %d-bit", g_infoManager.GetAppName().c_str(), g_infoManager.GetVersion().c_str(),
+ g_sysinfo.GetBuildTargetPlatformName().c_str(), g_sysinfo.GetBuildTargetCpuFamily().c_str(), g_sysinfo.GetXbmcBitness());
std::string buildType;
#if defined(_DEBUG)
@@ -709,8 +709,8 @@ bool CApplication::Create()
//#elif defined(some_ID) // uncomment for special version/fork
// specialVersion = " (version for XXXX)";
#endif
- CLog::Log(LOGNOTICE, "Using Kodi %s x%d build%s", buildType.c_str(), g_sysinfo.GetXbmcBitness(), specialVersion.c_str());
- CLog::Log(LOGNOTICE, "Kodi compiled " __DATE__ " by %s for %s %s %d-bit %s (%s)", g_sysinfo.GetUsedCompilerNameAndVer().c_str(), g_sysinfo.GetBuildTargetPlatformName().c_str(),
+ CLog::Log(LOGNOTICE, "Using %s %s x%d build%s", buildType.c_str(), g_infoManager.GetAppName().c_str(), g_sysinfo.GetXbmcBitness(), specialVersion.c_str());
+ CLog::Log(LOGNOTICE, "%s compiled " __DATE__ " by %s for %s %s %d-bit %s (%s)", g_infoManager.GetAppName().c_str(), g_sysinfo.GetUsedCompilerNameAndVer().c_str(), g_sysinfo.GetBuildTargetPlatformName().c_str(),
g_sysinfo.GetBuildTargetCpuFamily().c_str(), g_sysinfo.GetXbmcBitness(), g_sysinfo.GetBuildTargetPlatformVersionDecoded().c_str(),
g_sysinfo.GetBuildTargetPlatformVersion().c_str());
5 xbmc/CompileInfo.cpp.in
View
@@ -36,6 +36,11 @@ int CCompileInfo::GetMinor()
return @APP_VERSION_MINOR@;
}
+const char* CCompileInfo::GetAppName()
+{
+ return "@APP_NAME@";
+}
+
const char* CCompileInfo::GetSuffix()
{
return "@APP_VERSION_TAG@";
1  xbmc/CompileInfo.h
View
@@ -25,6 +25,7 @@ class CCompileInfo
public:
static int GetMajor();
static int GetMinor();
+ static const char* GetAppName();
static const char *GetSuffix(); // Git "Tag", e.g. alpha1
static const char* GetSCMID(); // Git Revision
};
5 xbmc/GUIInfoManager.cpp
View
@@ -4230,6 +4230,11 @@ CStdString CGUIInfoManager::GetBuild()
return StringUtils::Format("%s", __DATE__);
}
+CStdString CGUIInfoManager::GetAppName()
+{
+ return CCompileInfo::GetAppName();
+}
+
void CGUIInfoManager::SetDisplayAfterSeek(unsigned int timeOut, int seekOffset)
{
g_infoManager.m_performingSeek = false;
1  xbmc/GUIInfoManager.h
View
@@ -785,6 +785,7 @@ class CGUIInfoManager : public IMsgTargetCallback, public Observable
int GetTotalPlayTime() const;
CStdString GetCurrentPlayTimeRemaining(TIME_FORMAT format) const;
std::string GetVersionShort(void);
+ CStdString GetAppName();
CStdString GetVersion();
CStdString GetBuild();
3  xbmc/gen-compileinfo.mk
View
@@ -33,8 +33,9 @@ $(FILEPATH)/.GitRevision:
$(FILEPATH)/CompileInfo.cpp: $(VERSION.TXT) $(FILEPATH)/CompileInfo.cpp.in $(FILEPATH)/.GitRevision
@GITREV=$$(cat $(FILEPATH)/.GitRevision) ;\
+ APP_NAME=$$(awk '/APP_NAME/ {print $$2}' $(VERSION.TXT)) ;\
MAJOR=$$(awk '/VERSION_MAJOR/ {print $$2}' $(VERSION.TXT)) ;\
MINOR=$$(awk '/VERSION_MINOR/ {print $$2}' $(VERSION.TXT)) ;\
TAG=$$(awk '/VERSION_TAG/ {print $$2}' $(VERSION.TXT)) ;\
- sed -e "s/\@APP_VERSION_MAJOR\@/$$MAJOR/" -e "s/\@APP_VERSION_MINOR\@/$$MINOR/" -e "s/\@APP_VERSION_TAG\@/$$TAG/" -e "s/\@APP_SCMID\@/$$GITREV/" $@.in > $@
+ sed -e "s/\@APP_NAME\@/$$APP_NAME/" -e "s/\@APP_VERSION_MAJOR\@/$$MAJOR/" -e "s/\@APP_VERSION_MINOR\@/$$MINOR/" -e "s/\@APP_VERSION_TAG\@/$$TAG/" -e "s/\@APP_SCMID\@/$$GITREV/" $@.in > $@
6 xbmc/win32/XBMC_PC.rc.in
View
@@ -69,13 +69,13 @@ BEGIN
BEGIN
BLOCK "040904e4"
BEGIN
- VALUE "CompanyName", "Team XBMC"
- VALUE "FileDescription", "XBMC"
+ VALUE "CompanyName", "@COMPANY_NAME@"
+ VALUE "FileDescription", "@APP_NAME@"
VALUE "FileVersion", "@APP_VERSION_MAJOR@.@APP_VERSION_MINOR@-@APP_VERSION_TAG@"
VALUE "InternalName", "XBMC.exe"
VALUE "LegalCopyright", "Copyright (c) Team XBMC. All rights reserved."
VALUE "OriginalFilename", "XBMC.exe"
- VALUE "ProductName", "XBMC for Windows"
+ VALUE "ProductName", "@APP_NAME@ for Windows"
VALUE "ProductVersion", "@APP_VERSION_MAJOR@.@APP_VERSION_MINOR@-@APP_VERSION_TAG@"
END
END
Please sign in to comment.
Something went wrong with that request. Please try again.