diff options
author | John Stebbins <[email protected]> | 2015-08-25 09:48:14 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2015-08-25 14:17:11 -0700 |
commit | 4889bc95883dd2cb0eb679d381d15385b930bcfa (patch) | |
tree | 7a20ea87161e790b84b7f1cd4b0d10010201f995 /libhb/hb.c | |
parent | d4d9555eca3048d281d510bd51267ce67142acd6 (diff) |
build: use git version info instead of svn
Migrate from svn to git. Since our build system automatically generates
version info from the svn repo, this needs to change when we move the
repo to git.
Diffstat (limited to 'libhb/hb.c')
-rw-r--r-- | libhb/hb.c | 60 |
1 files changed, 57 insertions, 3 deletions
diff --git a/libhb/hb.c b/libhb/hb.c index e8418e741..2f4a71720 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -460,14 +460,68 @@ hb_handle_t * hb_init( int verbose, int update_check ) return h; } +// Make sure these strings at least exist in the executable even though +// they may not all be visible in the frontend. +static const char* hb_title = HB_PROJECT_TITLE; +static const char* hb_name = HB_PROJECT_NAME; +static const char* hb_website = HB_PROJECT_URL_WEBSITE; +static const char* hb_community = HB_PROJECT_URL_COMMUNITY; +static const char* hb_irc = HB_PROJECT_URL_IRC; +static const char* hb_version = HB_PROJECT_VERSION; +static const int hb_build = HB_PROJECT_BUILD; +static const char* hb_repo_url = HB_PROJECT_REPO_URL; +static const char* hb_repo_tag = HB_PROJECT_REPO_TAG; +static const int hb_repo_rev = HB_PROJECT_REPO_REV; +static const char* hb_repo_hash = HB_PROJECT_REPO_HASH; +static const char* hb_repo_branch = HB_PROJECT_REPO_BRANCH; +static const char* hb_repo_remote = HB_PROJECT_REPO_REMOTE; +static const char* hb_repo_type = HB_PROJECT_REPO_TYPE; + +const char * hb_get_full_description() +{ + static char * desc = NULL; + if (desc == NULL) + { + desc = hb_strdup_printf("%s\n" + "\tWebsite: %s\n" + "\tForum: %s\n" + "\tIRC: %s\n" + "\tBuild Type: %s\n" + "\tRepository: %s\n" + "\tRelease Tag: %s\n" + "\tRevision: %d\n" + "\tCommit Hash: %s\n" + "\tBranch: %s\n" + "\tRemote: %s", + hb_title, hb_website, hb_community, hb_irc, + hb_repo_type, hb_repo_url, hb_repo_tag, hb_repo_rev, + hb_repo_hash, hb_repo_branch, hb_repo_remote); + } + return desc; +} + /** * Returns current version of libhb. * @param h Handle to hb_handle_t. * @return character array of version number. */ -char * hb_get_version( hb_handle_t * h ) +const char * hb_get_version( hb_handle_t * h ) { - return HB_PROJECT_VERSION; + // Silence compiler warnings for unused variables + ((void)(hb_title)); + ((void)(hb_name)); + ((void)(hb_website)); + ((void)(hb_community)); + ((void)(hb_irc)); + ((void)(hb_version)); + ((void)(hb_repo_url)); + ((void)(hb_repo_tag)); + ((void)(hb_repo_rev)); + ((void)(hb_repo_hash)); + ((void)(hb_repo_branch)); + ((void)(hb_repo_remote)); + ((void)(hb_repo_type)); + return hb_version; } /** @@ -477,7 +531,7 @@ char * hb_get_version( hb_handle_t * h ) */ int hb_get_build( hb_handle_t * h ) { - return HB_PROJECT_BUILD; + return hb_build; } /** |