| 1 |
#! /usr/bin/env python3 |
| 2 |
# Copyright (C) 2024 fontconfig Authors |
| 3 |
# SPDX-License-Identifier: HPND |
| 4 |
|
| 5 |
import os |
| 6 |
import shutil |
| 7 |
import subprocess |
| 8 |
import sys |
| 9 |
from pathlib import Path |
| 10 |
|
| 11 |
sourcedir = os.environ.get('MESON_SOURCE_ROOT') |
| 12 |
builddir = os.environ.get('MESON_BUILD_ROOT') |
| 13 |
distdir = os.environ.get('MESON_DIST_ROOT') |
| 14 |
|
| 15 |
if shutil.which('autoreconf'): |
| 16 |
print('no autoreconf installed', file=sys.stderr) |
| 17 |
|
| 18 |
subprocess.run(['autoreconf', '-i'], cwd=distdir) |
| 19 |
|
| 20 |
# Copy files for compatibility |
| 21 |
for f in (Path(builddir) / 'doc').glob('*.1'): |
| 22 |
print(f'Copying {f.name}') |
| 23 |
shutil.copy2(f, Path(distdir) / f.stem) |
| 24 |
|
| 25 |
# Remove autom4te.cache |
| 26 |
shutil.rmtree(Path(distdir) / 'autom4te.cache') |