[PATCH 1/2] share/mk/: Generate the fonts during the build

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

 



Suggested-by: "G. Branden Robinson" <branden@xxxxxxxxxx>
Signed-off-by: Alejandro Colomar <alx@xxxxxxxxxx>
---

Hi Branden, Deri,

I've removed the Tinos font from the repository.  I get a few more
warnings now (especially after the second patch), but the PDF looks the
same visually, I think.  Would you mind reviewing the patches?  I
removed the contents of Tinos.pfa from this patch, to avoid 7858 lines
of deleted .pfa.

I would also like to remove the TINOR thing, but I don't know how.  If
you can send a patch for it, it would be great.  If you want to have a
look in git, check out this branch:
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/log/?h=fonts>

Have a lovely day!
Alex

 scripts/LinuxManBook/devpdf/Tinos.pfa         | 7858 -----------------
 scripts/LinuxManBook/devpdf/download          |    1 -
 .../devpdf => share/mk/build/fonts}/TINOR     |    0
 share/mk/build/fonts/_.mk                     |   21 +
 share/mk/build/fonts/tinos.mk                 |   36 +
 share/mk/build/pdf/book.mk                    |    7 +-
 .../configure/build-depends/groff/pfbtops.mk  |   15 +
 .../texlive-fonts-extra/Tinos.pfb.mk          |   12 +
 8 files changed, 88 insertions(+), 7862 deletions(-)
 delete mode 100644 scripts/LinuxManBook/devpdf/Tinos.pfa
 delete mode 100755 scripts/LinuxManBook/devpdf/download
 rename {scripts/LinuxManBook/devpdf => share/mk/build/fonts}/TINOR (100%)
 create mode 100644 share/mk/build/fonts/_.mk
 create mode 100644 share/mk/build/fonts/tinos.mk
 create mode 100644 share/mk/configure/build-depends/groff/pfbtops.mk
 create mode 100644 share/mk/configure/build-depends/texlive-fonts-extra/Tinos.pfb.mk

diff --git a/scripts/LinuxManBook/devpdf/Tinos.pfa b/scripts/LinuxManBook/devpdf/Tinos.pfa
deleted file mode 100644
index 88c21d670..000000000
--- a/scripts/LinuxManBook/devpdf/Tinos.pfa
+++ /dev/null
@@ -1,7858 +0,0 @@
diff --git a/scripts/LinuxManBook/devpdf/download b/scripts/LinuxManBook/devpdf/download
deleted file mode 100755
index e230c8213..000000000
--- a/scripts/LinuxManBook/devpdf/download
+++ /dev/null
@@ -1 +0,0 @@
-	Tinos	Tinos.pfa
diff --git a/scripts/LinuxManBook/devpdf/TINOR b/share/mk/build/fonts/TINOR
similarity index 100%
rename from scripts/LinuxManBook/devpdf/TINOR
rename to share/mk/build/fonts/TINOR
diff --git a/share/mk/build/fonts/_.mk b/share/mk/build/fonts/_.mk
new file mode 100644
index 000000000..8b456453e
--- /dev/null
+++ b/share/mk/build/fonts/_.mk
@@ -0,0 +1,21 @@
+# Copyright 2021-2024, Alejandro Colomar <alx@xxxxxxxxxx>
+# SPDX-License-Identifier: LGPL-3.0-only WITH LGPL-3.0-linking-exception
+
+
+ifndef MAKEFILE_BUILD_FONTS_INCLUDED
+MAKEFILE_BUILD_FONTS_INCLUDED := 1
+
+
+include $(MAKEFILEDIR)/build/_.mk
+include $(MAKEFILEDIR)/configure/directory_variables/src.mk
+include $(MAKEFILEDIR)/src/man.mk
+
+
+_FONTSDIR := $(builddir)/fonts
+
+
+.PHONY: build-fonts
+build-fonts: build-fonts-tinos
+
+
+endif  # include guard
diff --git a/share/mk/build/fonts/tinos.mk b/share/mk/build/fonts/tinos.mk
new file mode 100644
index 000000000..2b93e84ec
--- /dev/null
+++ b/share/mk/build/fonts/tinos.mk
@@ -0,0 +1,36 @@
+# Copyright 2021-2024, Alejandro Colomar <alx@xxxxxxxxxx>
+# SPDX-License-Identifier: LGPL-3.0-only WITH LGPL-3.0-linking-exception
+
+
+ifndef MAKEFILE_BUILD_FONTS_TINOS_INCLUDED
+MAKEFILE_BUILD_FONTS_TINOS_INCLUDED := 1
+
+
+include $(MAKEFILEDIR)/build/fonts/_.mk
+include $(MAKEFILEDIR)/configure/build-depends/texlive-fonts-extra/Tinos.pfb.mk
+include $(MAKEFILEDIR)/configure/build-depends/groff/pfbtops.mk
+
+
+TINOR := $(MAKEFILEDIR)/build/fonts/TINOR
+
+
+_TINOS_PFA := $(_FONTSDIR)/Tinos.pfa
+_TINOR     := $(_FONTSDIR)/TINOR
+
+_TINOS := $(_TINOS_PFA) $(_TINOR)
+
+
+$(_TINOS_PFA): $(TINOS_PFB) $(MK) | $$(@D)/
+	$(info	$(INFO_)PFBTOPS		$@)
+	$(PFBTOPS) <$< >$@
+
+$(_TINOR): $(_FONTSDIR)/%: $(MAKEFILEDIR)/build/fonts/% $(MK) | $$(@D)/
+	$(info	$(INFO_)CP		$@)
+	$(CP) -T $< $@
+
+
+.PHONY: build-fonts-tinos
+build-fonts-tinos: $(_TINOS)
+
+
+endif  # include guard
diff --git a/share/mk/build/pdf/book.mk b/share/mk/build/pdf/book.mk
index 7566f0043..21097fd0e 100644
--- a/share/mk/build/pdf/book.mk
+++ b/share/mk/build/pdf/book.mk
@@ -8,6 +8,7 @@ MAKEFILE_BUILD_PDF_BOOK_INCLUDED := 1
 
 include $(MAKEFILEDIR)/build/_.mk
 include $(MAKEFILEDIR)/build/man/_.mk
+include $(MAKEFILEDIR)/build/fonts/_.mk
 include $(MAKEFILEDIR)/configure/build-depends/coreutils/cat.mk
 include $(MAKEFILEDIR)/configure/build-depends/groff/gropdf.mk
 include $(MAKEFILEDIR)/configure/build-depends/groff-base/eqn.mk
@@ -27,7 +28,7 @@ _PDFDIR   := $(builddir)
 _PDF_BOOK := $(_PDFDIR)/$(PDF_BOOK)
 
 
-$(_PDF_BOOK): $(_MANPAGES) $(wildcard $(LMBDIR)/* $(LMBDIR)/*/*) | $$(@D)/
+$(_PDF_BOOK): $(_MANPAGES) $(_TINOS) $(wildcard $(LMBDIR)/*) | $$(@D)/
 	$(info	$(INFO_)GROPDF		$@)
 	( \
 		$(CAT) "$(LMBDIR)"/LMBfront.roff; \
@@ -38,8 +39,8 @@ $(_PDF_BOOK): $(_MANPAGES) $(wildcard $(LMBDIR)/* $(LMBDIR)/*/*) | $$(@D)/
 	| $(PIC) \
 	| $(TBL) \
 	| $(EQN) -Tpdf \
-	| $(TROFF) -Tpdf -F"$(LMBDIR)" -dpaper=a4 $(TROFFFLAGS) \
-	| $(GROPDF) -F"$(LMBDIR)" -pa4 $(GROPDFFLAGS) \
+	| $(TROFF) -Tpdf -F$(_FONTSDIR) -dpaper=a4 $(TROFFFLAGS) \
+	| $(GROPDF) -F$(_FONTSDIR) -pa4 $(GROPDFFLAGS) \
 	| $(SPONGE) $@
 
 
diff --git a/share/mk/configure/build-depends/groff/pfbtops.mk b/share/mk/configure/build-depends/groff/pfbtops.mk
new file mode 100644
index 000000000..73f5f0455
--- /dev/null
+++ b/share/mk/configure/build-depends/groff/pfbtops.mk
@@ -0,0 +1,15 @@
+# Copyright 2024, Alejandro Colomar <alx@xxxxxxxxxx>
+# SPDX-License-Identifier: LGPL-3.0-only WITH LGPL-3.0-linking-exception
+
+
+ifndef MAKEFILE_CONFIGURE_BUILD_DEPENDS_GROFF_PFBTOPS_INCLUDED
+MAKEFILE_CONFIGURE_BUILD_DEPENDS_GROFF_PFBTOPS_INCLUDED := 1
+
+
+DEFAULT_PFBTOPSFLAGS :=
+EXTRA_PFBTOPSFLAGS   :=
+PFBTOPSFLAGS         := $(DEFAULT_PFBTOPSFLAGS) $(EXTRA_PFBTOPSFLAGS)
+PFBTOPS              := pfbtops
+
+
+endif  # include guard
diff --git a/share/mk/configure/build-depends/texlive-fonts-extra/Tinos.pfb.mk b/share/mk/configure/build-depends/texlive-fonts-extra/Tinos.pfb.mk
new file mode 100644
index 000000000..c1c713c41
--- /dev/null
+++ b/share/mk/configure/build-depends/texlive-fonts-extra/Tinos.pfb.mk
@@ -0,0 +1,12 @@
+# Copyright 2024, Alejandro Colomar <alx@xxxxxxxxxx>
+# SPDX-License-Identifier: LGPL-3.0-only WITH LGPL-3.0-linking-exception
+
+
+ifndef MAKEFILE_CONFIGURE_BUILD_DEPENDS_TEXLIVE_FONTS_EXTRA_TINOS_PFB_INCLUDED
+MAKEFILE_CONFIGURE_BUILD_DEPENDS_TEXLIVE_FONTS_EXTRA_TINOS_PFB_INCLUDED := 1
+
+
+TINOS_PFB := /usr/share/texlive/texmf-dist/fonts/type1/google/tinos/Tinos.pfb
+
+
+endif  # include guard
-- 
2.43.0

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux