tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: generic fonts makefile fragment
Am 06.03.2019 um 01:32 schrieb coypu%sdf.org@localhost:
> +++ mk/fonts.mk
> @@ -0,0 +1,27 @@
> +# $NetBSD$
> +#
> +# Install .otf and .ttf font files.
> +#
> +# The following variables may be used to tweak the installation path:
> +#
> +# TTF_FONTS_DIR is the install directory for .ttf files
> +#
> +# OTF_FONTS_DIR is the install directory for .otf files
That looks much better. It is also found by "bmake help
topic=ttf_fonts_dir". It is not found by "bmake help topic=fonts"
though. If you want to add this file to more help topics, add a line
# Keywords: fonts ttf otf
at the end of that comment.
I just ran "bmake help topic=ttf" and were surprised that
mk/check/check-files.mk contains that word. When I looked there, I saw
the variable FONTS_DIRS.ttf but not FONT_DIRS.otf. It's probably worth
looking at that part of the infrastructure, too.
Maybe that part is outdated since you said just installing the font
files works for you. It used to be necessary some years ago (maybe 5,
maybe 20, I'm not an X11 configuration expert).
Still, defining your own directory variables makes sense because
FONTS_DIRS.ttf is usually empty, and yours is not.
> +TTF_FONTS_DIR?= ${PREFIX}/share/fonts/X11/TTF
> +OTF_FONTS_DIR?= ${PREFIX}/share/fonts/X11/OTF
I didn't mean these variables to be overridable by the package. That's
why I explicitly said "System-defined", as opposed to "Package-defined".
That remark of me only applied to the NO_CONFIGURE and NO_BUILD
variables, since I expect that some packages will include fonts.mk and
still need to be configured. As long as no package needs to modify these
paths, their value should be fixed.
Later the operator can easily be changed back to ?=, should that ever be
necessary. Changing from ?= to = is harder though since it might
override a package's definition. The latest pkglint version finds these
cases though and warns about variables that are unconditionally
overwritten. Therefore it's not a big deal either, but it used to be,
just a year ago.
> +install-fonts:
> + ${STEP_MSG} "Installing all .otf and .ttf files from " ${WRKSRC}
Between "from" and ${WRKSRC} there will be two spaces in the output.
Since WRKSRC is a pkgsrc directory whose name will never include spaces,
it can safely be placed inside the double quotes. Pkglint will not
complain since it knows WRKSRC is safe.
Best,
Roland
Home |
Main Index |
Thread Index |
Old Index