From 5f8a50f6198e9725d61660aea16358aff1e8bbeb Mon Sep 17 00:00:00 2001 From: Michael Kinder Date: Tue, 23 Apr 2024 05:06:24 -0400 Subject: [PATCH] add ttf-vista-fonts package (nonfree) --- srcpkgs/ttf-vista-fonts/template | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 srcpkgs/ttf-vista-fonts/template diff --git a/srcpkgs/ttf-vista-fonts/template b/srcpkgs/ttf-vista-fonts/template new file mode 100644 index 00000000000000..2e988ce12ed46b --- /dev/null +++ b/srcpkgs/ttf-vista-fonts/template @@ -0,0 +1,41 @@ +pkgname=ttf-vista-fonts +version=1.0.0 +revision=1 +short_desc="Microsoft Vista and Office 2007 True Type Fonts" +maintainer="Michael Kinder " +# Referenced to the PowerPointViewer.exe, the template and mechanism are custom. +# The fonts are licensed under a Microsoft-specific license included with this +# package as filename "EULA". +license="custom:microsoft" +homepage="https://docs.microsoft.com/en-us/typography/fonts/font-faq" +distfiles="https://web.archive.org/web/20171225132744/http://download.microsoft.com/download/E/6/7/E675FFFC-2A6D-4AB0-B3EB-27C9F8C8F696/PowerPointViewer.exe>${pkgname}.cab" +checksum=249473568eba7a1e4f95498acba594e0f42e6581add4dead70c1dfb908a09423 +makedepends="fontforge fontconfig cabextract" +nocross=yes + +# While it is fine to distribute the templates that build packages +# containing the Vista and Office 2007 fonts, they must not distribute the fonts +# themselves (this would constitute changing or otherwise +# encapsulating the filename which is not permitted). +restricted=yes +repository=nonfree + +# They're just fonts... + +# Tell XBPS that these are fonts +font_dirs="/usr/share/fonts/TTF" + +do_extract() { + mkdir -p ${wrksrc} + cabextract --lowercase ${XBPS_SRCDISTDIR}/${pkgname}-${version}/${pkgname}.cab -d ${wrksrc} + cabextract --lowercase -F '*.tt[fc]' ${wrksrc}/ppviewer.cab -d ${wrksrc} +} + +do_install() { + vmkdir usr/share/fonts/TTF + # Use find command to correctly handle and copy each font file + find ${wrksrc} -iname "*.ttf" -o -iname "*.ttc" | while read fontfile; do + vcopy "$(basename ${fontfile})" usr/share/fonts/TTF/ + done + vinstall ${wrksrc}/eula 644 usr/share/licenses/${pkgname}/EULA +}