Linux-man Archive mirror
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: linux-man@vger.kernel.org
Cc: branden@debian.org, Deri James <deri@chuzzlewit.myzen.co.uk>,
	 Alejandro Colomar <alx@kernel.org>
Subject: [PATCH 1/2] share/mk/: Generate the fonts during the build
Date: Mon, 25 Mar 2024 14:35:48 +0100	[thread overview]
Message-ID: <20240325133031.56302-2-alx@kernel.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 6845 bytes --]

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

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@kernel.org>
+# 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@kernel.org>
+# 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@kernel.org>
+# 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@kernel.org>
+# 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2024-03-25 13:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 13:35 Alejandro Colomar [this message]
2024-03-25 13:36 ` [PATCH 2/2] share/mk/: Reorganize files for generating the PDF book Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240325133031.56302-2-alx@kernel.org \
    --to=alx@kernel.org \
    --cc=branden@debian.org \
    --cc=deri@chuzzlewit.myzen.co.uk \
    --cc=linux-man@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).