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 | |
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')
-rw-r--r-- | libhb/hb.c | 60 | ||||
-rw-r--r-- | libhb/hb.h | 3 | ||||
-rw-r--r-- | libhb/project.h.m4 | 10 |
3 files changed, 65 insertions, 8 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; } /** diff --git a/libhb/hb.h b/libhb/hb.h index cbf25f712..c8101ed68 100644 --- a/libhb/hb.h +++ b/libhb/hb.h @@ -39,7 +39,8 @@ int hb_hwd_enabled( hb_handle_t *h ); hb_hwd_t * hb_hwd_get_context(); /* hb_get_version() */ -char * hb_get_version( hb_handle_t * ); +const char * hb_get_full_description(); +const char * hb_get_version( hb_handle_t * ); int hb_get_build( hb_handle_t * ); /* hb_check_update() diff --git a/libhb/project.h.m4 b/libhb/project.h.m4 index 7e70b5b36..ae54f255c 100644 --- a/libhb/project.h.m4 +++ b/libhb/project.h.m4 @@ -21,12 +21,14 @@ dnl <<#>>define HB_PROJECT_VERSION_HEX 0x<<>>__HB_version_hex<<>>LL <<#>>define HB_PROJECT_BUILD __HB_build <<#>>define HB_PROJECT_REPO_URL "__HB_repo_url" -<<#>>define HB_PROJECT_REPO_ROOT "__HB_repo_root" -<<#>>define HB_PROJECT_REPO_UUID "__HB_repo_uuid" +<<#>>define HB_PROJECT_REPO_TAG "__HB_repo_tag" <<#>>define HB_PROJECT_REPO_REV __HB_repo_rev -<<#>>define HB_PROJECT_REPO_DATE "__HB_repo_date" -<<#>>define HB_PROJECT_REPO_OFFICIAL __HB_repo_official +<<#>>define HB_PROJECT_REPO_HASH "__HB_repo_hash" +<<#>>define HB_PROJECT_REPO_BRANCH "__HB_repo_branch" +<<#>>define HB_PROJECT_REPO_REMOTE "__HB_repo_remote" <<#>>define HB_PROJECT_REPO_TYPE "__HB_repo_type" +<<#>>define HB_PROJECT_REPO_OFFICIAL __HB_repo_official +<<#>>define HB_PROJECT_REPO_DATE "__HB_repo_date" <<#>>define HB_PROJECT_BUILD_SPEC "__BUILD_spec" <<#>>define HB_PROJECT_BUILD_MACHINE "__BUILD_machine" |