summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-07-30 12:34:55 +0200
committerDudemanguy <random342@airmail.cc>2023-08-02 18:51:13 +0000
commitdf7a094765b58e74a8c1b678d5a8e2374d906866 (patch)
treeb67eb4de247b4274f120fc81ce440743c8fb694a /common
parent30bf811a8f230e2a84494eaebc82e51b125cbff5 (diff)
downloadmpv-df7a094765b58e74a8c1b678d5a8e2374d906866.tar.bz2
mpv-df7a094765b58e74a8c1b678d5a8e2374d906866.tar.xz
build: remove version.py
After second thought version.py does not do anything useful. Meson has built-in function vcs_tag that mostly replicate what version.py did. For the build time we can just use __DATE__ and __TIME__. Of course this changes time string format a little, but in my opinion it looks nicer in fact. Also it will use local time, instead UTC. But I would argue that date string is only informative for users to check how old the specific mpv build is. It doesn't have to be precise, it weren't for years anyway before recent change.
Diffstat (limited to 'common')
-rw-r--r--common/meson.build8
-rw-r--r--common/version.h.in3
2 files changed, 11 insertions, 0 deletions
diff --git a/common/meson.build b/common/meson.build
new file mode 100644
index 0000000000..4bca5ea435
--- /dev/null
+++ b/common/meson.build
@@ -0,0 +1,8 @@
+version_h = vcs_tag(
+ command: ['git', 'describe', '--always', '--tags', '--dirty'],
+ input: 'version.h.in',
+ output: 'version.h',
+ replace_string: '@VERSION@',
+)
+
+sources += version_h
diff --git a/common/version.h.in b/common/version.h.in
new file mode 100644
index 0000000000..7d1c92f1bb
--- /dev/null
+++ b/common/version.h.in
@@ -0,0 +1,3 @@
+#define VERSION "@VERSION@"
+#define BUILDDATE __DATE__ " " __TIME__
+#define MPVCOPYRIGHT "Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects"