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"
|
HOMEPAGE="https://vercel.com/font"
|
||||||
SRC_URI="https://github.com/vercel/geist-font/releases/download/${PV}/${P}.zip"
|
SRC_URI="https://github.com/vercel/geist-font/releases/download/${PV}/${P}.zip"
|
||||||
|
|
||||||
S="${WORKDIR}/${P}"
|
|
||||||
|
|
||||||
LICENSE="OFL-1.1"
|
LICENSE="OFL-1.1"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
KEYWORDS="~amd64"
|
KEYWORDS="~amd64"
|
||||||
@@ -18,30 +16,20 @@ KEYWORDS="~amd64"
|
|||||||
IUSE="+geist +geistmono geistpixel +otf ttf"
|
IUSE="+geist +geistmono geistpixel +otf ttf"
|
||||||
REQUIRED_USE="|| ( 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"
|
BDEPEND="app-arch/unzip"
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
if use otf; then
|
local font suffix
|
||||||
local FONT_S=()
|
|
||||||
local FONT_SUFFIX="otf"
|
|
||||||
|
|
||||||
use geist && { FONT_S+=( "${S}/fonts/Geist/otf" ); }
|
for font in Geist GeistMono GeistPixel; do
|
||||||
use geistmono && { FONT_S+=( "${S}/fonts/GeistMono/otf" ); }
|
use "${font,,}" || continue
|
||||||
use geistpixel && { FONT_S+=( "${S}/fonts/GeistPixel/otf" ); }
|
for suffix in otf ttf; do
|
||||||
|
use "${suffix}" || continue
|
||||||
font_src_install
|
FONT_SUFFIX="${suffix}"
|
||||||
fi
|
FONT_S="${S}/fonts/${font}/${suffix}"
|
||||||
|
font_src_install
|
||||||
if use ttf; then
|
done
|
||||||
local FONT_S=()
|
done
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user