From 49e704cb19dfe72b293fd286395e37ed1d3c3d99 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 1 Jan 2018 12:16:42 +0100 Subject: build: move copyright statement to a shared location Now macosx_menubar.m and mpv.rc (win32) use the same copyright string. (This is a bit roundabout, because mpv.rc can't use C constants. Also the C code wants to avoid rebuilding real source files if only version.h changed, so only version.c includes version.h.) --- common/common.h | 1 + common/version.c | 1 + osdep/macosx_menubar.m | 2 +- osdep/mpv.rc | 3 ++- player/main.c | 5 ++--- version.sh | 2 ++ 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/common/common.h b/common/common.h index bed9060f71..8dd02026f6 100644 --- a/common/common.h +++ b/common/common.h @@ -68,6 +68,7 @@ enum { extern const char mpv_version[]; extern const char mpv_builddate[]; +extern const char mpv_copyright[]; char *mp_format_time(double time, bool fractions); char *mp_format_time_fmt(const char *fmt, double time); diff --git a/common/version.c b/common/version.c index b98fe00ed1..61f4018022 100644 --- a/common/version.c +++ b/common/version.c @@ -24,3 +24,4 @@ const char mpv_version[] = "mpv " VERSION; const char mpv_builddate[] = BUILDDATE; +const char mpv_copyright[] = MPVCOPYRIGHT; diff --git a/osdep/macosx_menubar.m b/osdep/macosx_menubar.m index 4e9b1733d6..3a5c5a76c2 100644 --- a/osdep/macosx_menubar.m +++ b/osdep/macosx_menubar.m @@ -612,7 +612,7 @@ NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: @"mpv", @"ApplicationName", [self getMPVIcon], @"ApplicationIcon", - @"Copyright © 2000-2017 mpv/MPlayer/mplayer2 projects", @"Copyright", + [NSString stringWithUTF8String:mpv_copyright], @"Copyright", [NSString stringWithUTF8String:mpv_version], @"ApplicationVersion", nil]; [NSApp orderFrontStandardAboutPanelWithOptions:options]; diff --git a/osdep/mpv.rc b/osdep/mpv.rc index 9c51e2d25b..34c19e7028 100644 --- a/osdep/mpv.rc +++ b/osdep/mpv.rc @@ -16,6 +16,7 @@ */ #include +#include "version.h" VS_VERSION_INFO VERSIONINFO FILEVERSION 2, 0, 0, 0 @@ -32,7 +33,7 @@ VS_VERSION_INFO VERSIONINFO VALUE "CompanyName", "mpv" VALUE "FileDescription", "mpv" VALUE "FileVersion", "2.0.0.0" - VALUE "LegalCopyright", "(C) 2000-2018 mpv/mplayer2/MPlayer" + VALUE "LegalCopyright", MPVCOPYRIGHT VALUE "OriginalFilename", "mpv.exe" VALUE "ProductName", "mpv" VALUE "ProductVersion", "2.0.0.0" diff --git a/player/main.c b/player/main.c index 1a0de32686..5f79e784ed 100644 --- a/player/main.c +++ b/player/main.c @@ -140,9 +140,8 @@ void mp_update_logging(struct MPContext *mpctx, bool preinit) void mp_print_version(struct mp_log *log, int always) { int v = always ? MSGL_INFO : MSGL_V; - mp_msg(log, v, - "%s (C) 2000-2018 mpv/MPlayer/mplayer2 projects\n built on %s\n", - mpv_version, mpv_builddate); + mp_msg(log, v, "%s %s\n built on %s\n", + mpv_version, mpv_copyright, mpv_builddate); print_libav_versions(log, v); mp_msg(log, v, "\n"); // Only in verbose mode. diff --git a/version.sh b/version.sh index 45a529c54e..2cfc384b5c 100755 --- a/version.sh +++ b/version.sh @@ -54,11 +54,13 @@ fi NEW_REVISION="#define VERSION \"${VERSION}\"" OLD_REVISION=$(head -n 1 "$version_h" 2> /dev/null) BUILDDATE="#define BUILDDATE \"$(date)\"" +MPVCOPYRIGHT="#define MPVCOPYRIGHT \"Copyright © 2000-2018 mpv/MPlayer/mplayer2 projects\"" # Update version.h only on revision changes to avoid spurious rebuilds if test "$NEW_REVISION" != "$OLD_REVISION"; then cat < "$version_h" $NEW_REVISION $BUILDDATE +$MPVCOPYRIGHT EOF fi -- cgit v1.2.3