Commit Graph

4 Commits

Author SHA1 Message Date
Kacper Michajłow 75e41478cc waf: migrate to version.py
Fixes https://github.com/mpv-player/mpv-build/issues/204
2023-01-28 01:03:12 +00:00
Dudemanguy 3a6ef81705 version.py/version.sh: bump copyright year 2023-01-04 08:29:07 -06:00
Dudemanguy 93d77b781d version.py/version.sh: bump copyright year 2022-01-22 13:22:23 -06:00
Dudemanguy 37549b6faa build: add version.py for generating version.h
version.h is essential for building, and its generation was done by a
shell script. Strictly speaking, python should in general be more
portable (windows), and would be better for the upcoming meson build to
simply just execute a python script. version.py has some small
differences with version.sh which shouldn't matter but they are noted
below.

- version.sh accepted several arguments that seemed useless (like
  --cwd). These were removed from version.py.
- version.py takes either no arguments (prints the version) or it takes
  exactly one argument specifying the complete path of where the header
  should be generated.
- version.sh attempted to read a file named "snapshot_version". The
  comments noted that this was for "daily tarball snapshots". Such a
  file does not exist in the source tree, and it's not really clear that
  anyone actually uses this. This logic was removed from version.py.
- version.py reads the SOURCE_DATE_EPOCH environment variable. Some
  distros use this for reproducible builds. Technically you could also
  just disable the build date but this is only a couple of extra lines
  and maybe it's prettier than UNKNOWN.
- version.py also doesn't attempt to display timezone information in the
  build date. It only shows UTC time.
2021-11-14 19:13:10 +00:00