[cantarell-fonts/default-vf] Add toggle for VF




commit 9873fbb62f66832c3c3ba9cf3ba35a11e0991288
Author: Nikolaus Waxweiler <madigens gmail com>
Date:   Thu Jul 29 22:32:16 2021 +0100

    Add toggle for VF

 .gitlab-ci.yml    | 29 ++++++++++++++++++++++++++++-
 meson.build       |  4 +++-
 meson_options.txt |  5 ++++-
 src/meson.build   | 32 +++++++++++++++++---------------
 4 files changed, 52 insertions(+), 18 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e5ea0b37..3cb30d5e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,4 @@
-build:
+build-default:
   image: 'registry.fedoraproject.org/fedora:latest'
   script:
     - dnf install -y git-core python3-pip meson ninja-build libappstream-glib-devel gettext python3.8
@@ -17,6 +17,33 @@ build:
     - git config --global user.email "you example com"
     - git config --global user.name "Your Name"
     - git commit -m "Make package with prebuilt binaries, ninja will dist them."
+
+    - ninja -C build dist
+  artifacts:
+    paths:
+      - build/meson-dist
+      - prebuilt/*.otf
+    expire_in: 7 days
+
+build-just-statics:
+  image: 'registry.fedoraproject.org/fedora:latest'
+  script:
+    - dnf install -y git-core python3-pip meson ninja-build libappstream-glib-devel gettext python3.8
+    - python3.8 -m ensurepip
+    - python3.8 -m venv venv
+    - . venv/bin/activate
+    - pip3 install meson ninja -r requirements.txt
+    - meson build -D buildstatics=true -D buildvf=false
+    - ninja -C build install
+
+    # Make a dist package with prebuilt binaries.
+    - git add meson_options.txt
+    - cp /usr/local/share/fonts/cantarell/*.otf prebuilt
+    - git add prebuilt/*.otf
+    - git config --global user.email "you example com"
+    - git config --global user.name "Your Name"
+    - git commit -m "Make package with prebuilt binaries, ninja will dist them."
+
     - ninja -C build dist
   artifacts:
     paths:
diff --git a/meson.build b/meson.build
index 7c5117ac..4c142041 100644
--- a/meson.build
+++ b/meson.build
@@ -14,7 +14,9 @@ if useprebuilt == false
     if get_option('buildstatics') == true
         make_static_fonts = join_paths(meson.current_source_dir(), 'scripts', 'make-static-fonts.py')
     endif
-    make_variable_font = join_paths(meson.current_source_dir(), 'scripts', 'make-variable-font.py')
+    if get_option('buildvf') == true
+        make_variable_font = join_paths(meson.current_source_dir(), 'scripts', 'make-variable-font.py')
+    endif
     psautohint = find_program('psautohint')
     subdir('src')
 else
diff --git a/meson_options.txt b/meson_options.txt
index 38480b80..6c363eea 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -8,4 +8,7 @@ option('buildappstream', type : 'boolean', value : true,
        description : 'Build Appstream metadata file')
 
 option('buildstatics', type : 'boolean', value : false,
-       description : 'Build static fonts in addition to the variable font')
+       description : 'Build static fonts')
+
+option('buildvf', type : 'boolean', value : true,
+       description : 'Build variable fonts')
diff --git a/src/meson.build b/src/meson.build
index 37928aab..535133d5 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -15,18 +15,20 @@ if get_option('buildstatics') == true
     )
 endif
 
-custom_target(
-    'cantarell-variable-font',
-    input: 'Cantarell.designspace',
-    output: 'Cantarell-VF.otf',
-    command: [
-        python3,
-        make_variable_font,
-        '@INPUT@',
-        join_paths(meson.current_source_dir(), 'Cantarell.stylespace'),
-        psautohint,
-        '@OUTPUT@'
-    ],
-    install: true,
-    install_dir: fontsdir,
-)
+if get_option('buildvf') == true
+    custom_target(
+        'cantarell-variable-font',
+        input: 'Cantarell.designspace',
+        output: 'Cantarell-VF.otf',
+        command: [
+            python3,
+            make_variable_font,
+            '@INPUT@',
+            join_paths(meson.current_source_dir(), 'Cantarell.stylespace'),
+            psautohint,
+            '@OUTPUT@'
+        ],
+        install: true,
+        install_dir: fontsdir,
+    )
+endif


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