mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-04-07 03:10:15 -04:00
media-fonts/geist-font: optimize ebuild
- Remove redundant S="${WORKDIR}/${P}"
- Use ${S} instead of ${WORKDIR}/${P} for DOCS
- Refactor src_install to use a nested loop for fonts and suffixes
Signed-off-by: Leroy Tennie <gentoo@gtdm.me>
This commit is contained in:
@@ -9,8 +9,6 @@ DESCRIPTION="Geist is a new font family for Vercel"
|
||||
HOMEPAGE="https://vercel.com/font"
|
||||
SRC_URI="https://github.com/vercel/geist-font/releases/download/${PV}/${P}.zip"
|
||||
|
||||
S="${WORKDIR}/${P}"
|
||||
|
||||
LICENSE="OFL-1.1"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
@@ -18,30 +16,20 @@ KEYWORDS="~amd64"
|
||||
IUSE="+geist +geistmono geistpixel +otf ttf"
|
||||
REQUIRED_USE="|| ( geist geistmono geistpixel ) || ( otf ttf )"
|
||||
|
||||
DOCS="${WORKDIR}/${P}/OFL.txt"
|
||||
DOCS="${S}/OFL.txt"
|
||||
|
||||
BDEPEND="app-arch/unzip"
|
||||
|
||||
src_install() {
|
||||
if use otf; then
|
||||
local FONT_S=()
|
||||
local FONT_SUFFIX="otf"
|
||||
|
||||
use geist && { FONT_S+=( "${S}/fonts/Geist/otf" ); }
|
||||
use geistmono && { FONT_S+=( "${S}/fonts/GeistMono/otf" ); }
|
||||
use geistpixel && { FONT_S+=( "${S}/fonts/GeistPixel/otf" ); }
|
||||
local font suffix
|
||||
|
||||
for font in Geist GeistMono GeistPixel; do
|
||||
use "${font,,}" || continue
|
||||
for suffix in otf ttf; do
|
||||
use "${suffix}" || continue
|
||||
FONT_SUFFIX="${suffix}"
|
||||
FONT_S="${S}/fonts/${font}/${suffix}"
|
||||
font_src_install
|
||||
fi
|
||||
|
||||
if use ttf; then
|
||||
local FONT_S=()
|
||||
local FONT_SUFFIX="ttf"
|
||||
|
||||
use geist && { FONT_S+=( "${S}/fonts/Geist/ttf" ); }
|
||||
use geistmono && { FONT_S+=( "${S}/fonts/GeistMono/ttf" ); }
|
||||
use geistpixel && { FONT_S+=( "${S}/fonts/GeistPixel/ttf" ); }
|
||||
|
||||
font_src_install
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user