Commit 5d5004f
meson: wire up generation of distribution archive
Meson knows to generate distribution archives via `meson dist`. Despite
generating the archive itself, this target also knows to compile and
execute tests from that archive, which helps to ensure that the result
is an adequate drop-in replacement for the versioned project.
While this already works as-is, one omission is that we don't propagate
the commit that this is built from into the resulting archive. This can
be fixed though by adding a distribution script that propagates the
version into the "version" file, which GIT-VERSION-GEN knows to read if
present.
Use GIT-VERSION-GEN itself to populate that file. There are two smallish
gotchas:
- The script is executed in the build directory, not in the directory
where we generate the archive. The target directory is propagated
via the "MESON_DIST_ROOT" environment variable, but because we don't
use a shell to execute GIT-VERSION-GEN we cannot populate the envvar
into its arguments. We thus adapt GIT-VERSION-GEN to handle this for
us.
- We use the "GIT-VERSION-FILE.in" template to generate the version,
which contains a "GIT_VERSION=" prefix that we need to strip after
reading the "version" file. We could avoid this extra logic if we
used a template that only had the `@GIT_VERSION@` placeholder, but
it would require us to add one more template file.
Signed-off-by: Patrick Steinhardt <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 04eb281 commit 5d5004f
2 files changed
+18
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| |||
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
36 | | - | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1944 | 1944 | | |
1945 | 1945 | | |
1946 | 1946 | | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
1947 | 1959 | | |
1948 | 1960 | | |
1949 | 1961 | | |
| |||
0 commit comments