Skip to content

Commit

Permalink
Merge branch 'develop' into colorcodebot
Browse files Browse the repository at this point in the history
  • Loading branch information
AndydeCleyre committed Feb 25, 2022
2 parents 1c05bea + 5cdbd42 commit 085ec2d
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 84 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/buildpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
- name: create and update build ctnr from official repos
run: |
buildah from --name ctnr docker.io/library/archlinux:base-devel
buildah copy ctnr 'https://archlinux.org/mirrorlist/?country=US&protocol=https&ip_version=4&ip_version=6&use_mirror_status=on' /tmp/mirrorlist
buildah run ctnr sh -c "sed 's/^#Server =/Server =/g' /tmp/mirrorlist | shuf >/etc/pacman.d/mirrorlist"
buildah run ctnr chmod 0644 /etc/pacman.d/mirrorlist
buildah run ctnr pacman --noconfirm -Syu
buildah run ctnr pacman --noconfirm -S --needed git
Expand Down
69 changes: 4 additions & 65 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ The built package can be installed on Arch Linux with ``sudo pacman -U``,
or you can simply extract the fonts with your favorite archive tool for use on
any system.

To run the included scripts, you'll need ``python3-venv``.

.. contents::
:depth: 1

Expand All @@ -26,14 +28,6 @@ fork this repo on GitHub, then:
$ git clone <your-github-fork>
$ cd archbuilder_iosevka
- activate a `Python Virtual Environment`_ matching ``requirements.txt``:

.. code:: console
$ python3 -m venv venv
$ . ./venv/bin/activate
$ python -m pip install -r requirements.txt
- configure your font, either by editing ``vars.yml``:

.. code:: console
Expand All @@ -54,7 +48,7 @@ fork this repo on GitHub, then:
$ git commit -am "much better now"
$ git tag awesome-build-label
$ git push --tags
$ git push && git push --tags
You can watch the build process in your ``Actions`` tab,
or using GitHub's CLI_:
Expand All @@ -63,66 +57,13 @@ or using GitHub's CLI_:
$ gh run watch
After anywhere from 30-120 minutes you can
After anywhere from 30-120+ minutes you can
get the built font from your ``Releases`` page, or:

.. code:: console
$ gh release download -p '*'
Python Virtual Environment
--------------------------

We use two small Python tools to render the Workflow (``buildpkg.yml``)
from an included template, using the data in ``vars.yml``.

You can create and activate a virtual environment in your favorite way,
as long as it has the packages listed in ``requirements.txt``.

Some methods are described below.

Python's ``venv`` Directly
++++++++++++++++++++++++++

.. code:: console
$ python3 -m venv venv
$ . ./venv/bin/activate
$ python -m pip install -r requirements.txt
zpy
+++

zpy_ is a toolset for managing Python venvs and packages, with Zsh and pip-tools_.

Either create and activate a venv matching ``requirements.txt``:

.. code:: console
% envin
or install the necessary tools (wheezy.template, yamlpath) into their own isolated venvs,
adding links to the relevant scripts (``wheezy.template``, ``yaml-get``) to your ``PATH``:

.. code:: console
% pipz install --cmd wheezy.template,yaml-get wheezy.template yamlpath
pipenv
++++++

.. code:: console
$ pipenv shell
$ pipenv install
pipx
++++

.. code:: console
$ pipx install wheezy.template yamlpath
Using the Customizer Site
-------------------------

Expand All @@ -148,8 +89,6 @@ To use a configuration thus generated with this builder:
.. _Iosevka: https://github.com/be5invis/Iosevka/
.. _an official web app: https://typeof.net/Iosevka/customizer
.. _zpy: https://github.com/andydecleyre/zpy
.. _pip-tools: https://github.com/jazzband/pip-tools
.. _CLI: https://github.com/cli/cli

.. |build status| image:: https://github.com/AndydeCleyre/archbuilder_iosevka/workflows/Build%20and%20upload%20Arch%20Linux%20packages/badge.svg
Expand Down
14 changes: 12 additions & 2 deletions mk/buildpkg.yml.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
#!/bin/sh -e
cd "$(dirname "$0")"
gitroot="$(git rev-parse --show-toplevel)"
gitroot="$(git -C "$(dirname "$0")" rev-parse --show-toplevel)"
cd "$gitroot"

if [ ! -d venv ]; then
python3 -m venv venv
fi
# shellcheck disable=SC1091
. ./venv/bin/activate
pip install -qr requirements.txt

wheezy.template "${gitroot}"/templates/buildpkg.yml.wz \
"$(yaml-get -p . "${gitroot}"/vars.yml)" \
>"${gitroot}"/.github/workflows/buildpkg.yml

printf '%s\n' "Wrote ${gitroot}/.github/workflows/buildpkg.yml"
git status --short "${gitroot}/.github/workflows/buildpkg.yml"
12 changes: 11 additions & 1 deletion mk/pkgbuilds.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/sh -e

gitroot="$(git -C "$(dirname "$0")" rev-parse --show-toplevel)"
cd "$gitroot"

if [ ! -d venv ]; then
python3 -m venv venv
fi
# shellcheck disable=SC1091
. ./venv/bin/activate
pip install -qr requirements.txt

"${gitroot}"/mk/private-build-plans.toml.sh

Expand Down Expand Up @@ -28,10 +36,12 @@ yaml-get -p 'spacings.*' "${gitroot}"/vars.yml | while read -r spacing; do
"branch": "'"$upstream_branch"'"
}' >"${folder}"/PKGBUILD

printf '%s\n' "Wrote ${folder}/PKGBUILD"

if command -v makepkg >/dev/null; then
cd "${folder}"
makepkg -os
makepkg --printsrcinfo >.SRCINFO
printf '%s\n' "Wrote ${folder}/.SRCINFO"
fi

printf '%s\n' \
Expand Down
15 changes: 13 additions & 2 deletions mk/private-build-plans.toml.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
#!/bin/sh -e
cd "$(dirname "$0")"
gitroot="$(git rev-parse --show-toplevel)"

gitroot="$(git -C "$(dirname "$0")" rev-parse --show-toplevel)"
cd "$gitroot"

if [ ! -d venv ]; then
python3 -m venv venv
fi
# shellcheck disable=SC1091
. ./venv/bin/activate
pip install -qr requirements.txt

wheezy.template "${gitroot}"/templates/private-build-plans.toml.wz \
"$(yaml-get -p . "${gitroot}"/vars.yml)" \
>"${gitroot}"/private-build-plans.toml

printf '%s\n' "Wrote ${gitroot}/private-build-plans.toml"
git status --short "${gitroot}/private-build-plans.toml"
10 changes: 6 additions & 4 deletions mk/reqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ if [ "$1" ]; then
exit 1
fi

cd "$(git -C "$(dirname -- "$0")" rev-parse --show-toplevel)"
gitroot="$(git -C "$(dirname "$0")" rev-parse --show-toplevel)"
cd "$gitroot"

if [ ! -d venv ]; then
python3 -m venv venv
fi
# shellcheck disable=SC1091
. ./venv/bin/activate

pip install -U pip-tools
pip install -qU pip-tools

for reqsin in *requirements.in; do
pip-compile -U --no-header "$reqsin"
pip-compile -U --no-header --annotation-style=line "$reqsin"
printf '%s\n' "Wrote lockfile for ${reqsin}"
git status --short "${reqsin}"
done
12 changes: 4 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
ruamel.yaml==0.17.10
# via yamlpath
ruamel.yaml.clib==0.2.6
# via ruamel.yaml
wheezy.template==3.1.0
# via -r requirements.in
yamlpath==3.6.1
# via -r requirements.in
ruamel-yaml==0.17.17 # via yamlpath
ruamel-yaml-clib==0.2.6 # via ruamel-yaml
wheezy-template==3.1.0 # via -r requirements.in
yamlpath==3.6.4 # via -r requirements.in
5 changes: 4 additions & 1 deletion templates/PKGBUILD.wz
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
@require(spacing, pbp_sha256, build_webfonts, branch)
@(
name = '-'.join(filter(None, ('ttf-iosevka', spacing, 'custom')))
)\
# Maintainer: Andy Kluger <https://t.me/andykluger>
# Contributor: Markus Weimar <mail@@markusweimar.de>
_pkgname=ttf-iosevka-@{spacing and spacing + '-' or ''}custom
_pkgname=@name
pkgname=${_pkgname}-git
pkgver=1
pkgrel=1
Expand Down
3 changes: 3 additions & 0 deletions templates/buildpkg.yml.wz
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
- name: create and update build ctnr from official repos
run: |
buildah from --name ctnr docker.io/library/archlinux:base-devel
buildah copy ctnr 'https://archlinux.org/mirrorlist/?country=US&protocol=https&ip_version=4&ip_version=6&use_mirror_status=on' /tmp/mirrorlist
buildah run ctnr sh -c "sed 's/^#Server =/Server =/g' /tmp/mirrorlist | shuf >/etc/pacman.d/mirrorlist"
buildah run ctnr chmod 0644 /etc/pacman.d/mirrorlist
buildah run ctnr pacman --noconfirm -Syu
buildah run ctnr pacman --noconfirm -S --needed git

Expand Down
2 changes: 1 addition & 1 deletion templates/private-build-plans.toml.wz
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@#
@for spacing in spacings:
@(
plan=f"iosevka-{spacing and spacing + '-' or ''}custom"
plan='-'.join(filter(None, ('iosevka', spacing, 'custom')))
family=plan.replace('-', ' ').title()
)\
@#
Expand Down
1 change: 1 addition & 0 deletions vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ build:
# - ttf-iosevka-fontconfig-mono-custom-git
# - ttf-iosevka-fixed-custom-git
# - ttf-iosevka-quasi-proportional-custom-git
# - ttf-iosevka-quasi-proportional-extension-only-custom-git
spacings:
- '' # some wide glyphs
- term # fewer wide glyphs
Expand Down

0 comments on commit 085ec2d

Please sign in to comment.