[libhandy/wip/exalm/1590: 1/2] build: Add a dist script
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [libhandy/wip/exalm/1590: 1/2] build: Add a dist script
- Date: Fri, 11 Feb 2022 13:31:06 +0000 (UTC)
commit a0d67006aea467e7d028d789c1f8e3ea3572171e
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sat Jan 1 16:48:22 2022 +0500
    build: Add a dist script
    
    Include pre-built stylesheet and docs into release tarballs.
    
    Fixes https://gitlab.gnome.org/GNOME/libadwaita/-/issues/372
 build-aux/meson/dist-data.py | 21 +++++++++++++++++++++
 meson.build                  |  2 ++
 2 files changed, 23 insertions(+)
---
diff --git a/build-aux/meson/dist-data.py b/build-aux/meson/dist-data.py
new file mode 100644
index 00000000..1e5b3db8
--- /dev/null
+++ b/build-aux/meson/dist-data.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+
+import os
+import shutil
+import subprocess
+
+from pathlib import PurePath
+
+references = [
+    'doc/libhandy-1',
+]
+
+sourceroot = os.environ.get('MESON_SOURCE_ROOT')
+buildroot = os.environ.get('MESON_BUILD_ROOT')
+distroot = os.environ.get('MESON_DIST_ROOT')
+
+for reference in references:
+    src_path = os.path.join(buildroot, reference)
+    if os.path.isdir(src_path):
+        dst_path = os.path.join(distroot, reference)
+        shutil.copytree(src_path, dst_path)
diff --git a/meson.build b/meson.build
index 0a8d929d..103d4da1 100644
--- a/meson.build
+++ b/meson.build
@@ -141,6 +141,8 @@ configure_file(
          output: 'run',
   configuration: run_data)
 
+meson.add_dist_script('build-aux'/ 'meson'/ 'dist-data.py')
+
 summary = [
   '',
   '------',
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]