[cantarell-fonts/alexei-feedback] Try to built dist with prebuilt package



commit 25d5bb3a74ddb1cbcd7f7bd0bac8c4e7fe9078b7
Author: Nikolaus Waxweiler <madigens gmail com>
Date:   Thu Aug 2 23:38:02 2018 +0100

    Try to built dist with prebuilt package

 .gitlab-ci.yml              | 11 ++++++++---
 scripts/flip-prebuilt-on.py | 18 ++++++++++++++++++
 2 files changed, 26 insertions(+), 3 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 16c3afe6..74cbf80f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -4,11 +4,16 @@ build:
   script:
     - dnf install -y libappstream-glib-devel gettext
     - pip3 install fontmake psautohint meson ninja
-    - meson build -Dfontsdir=/tmp/cantarell-fonts
-    - ninja -C build dist
+    - meson build -Dfontsdir=prebuilt
     - ninja -C build install
+
+    # Make a dist package with prebuilt binaries.
+    - python3 script/flip-prebuilt-on.py meson_options.txt
+    - git add meson_options.txt
+    - git add prebuilt/*.otf
+    - git commit -m "Make package with prebuilt binaries"
+    - ninja -C build dist
   artifacts:
     paths:
       - build/meson-dist
-      - /tmp/cantarell-fonts
     expire_in: 7 days
\ No newline at end of file
diff --git a/scripts/flip-prebuilt-on.py b/scripts/flip-prebuilt-on.py
new file mode 100644
index 00000000..0968b28f
--- /dev/null
+++ b/scripts/flip-prebuilt-on.py
@@ -0,0 +1,18 @@
+"""Elaborate sed script to flip useprebuilt=True by default as I don't know
+how to "" things in .gitlab-ci.yml."""
+
+import argparse
+import fileinput
+
+parser = argparse.ArgumentParser()
+parser.add_argument(
+    "meson_options_txt", type=str, help="The meson_options.txt file to change"
+)
+args = parser.parse_args()
+
+text_to_search = "'useprebuilt', type : 'boolean', value : false"
+replacement_text = "'useprebuilt', type : 'boolean', value : true"
+
+with fileinput.FileInput(args.meson_options_txt, inplace=True, backup=".bak") as file:
+    for line in file:
+        print(line.replace(text_to_search, replacement_text), end="")


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]