mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-22 08:58:47 +00:00
Add the ability to pass a list of alternative bdf fonts to this port.
This can be used to generalize building of, say, language-specific versions of gd like ukrainian/gd -- the controlling port will simply set GD_FONTS to something like GD_FONTS="/usr/ports/distfiles/x-koi8u.tgz koi6x10.bdf koi8x13.bdf \ koi9x15.bdf koi12x24.bdf koi10x20.bdf" And the new configure script will extract the bdf files from the tarball and use the bdftogd perl script (bundled with the software) to regenerate the sources. No REVISION bump, because the default package is still the same...
This commit is contained in:
parent
60d97317d2
commit
1a79aa3205
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=52799
@ -48,4 +48,8 @@ MAKE_ARGS+= $v="${$v}"
|
||||
post-extract:
|
||||
bzip2 -d < ${_DISTDIR}/gd_gif_in.c.bz2 > ${WRKSRC}/gd_gif_in.c
|
||||
|
||||
.ifdef GD_FONTS
|
||||
SCRIPTS_ENV+= GD_FONTS="${GD_FONTS}"
|
||||
.endif
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
@ -2,6 +2,7 @@ PROGS!= make -V BIN_PROGRAMS -f ${WRKSRC}/Makefile
|
||||
TESTS!= make -V TEST_PROGRAMS -f ${WRKSRC}/Makefile
|
||||
OBJS!= make -V LIBOBJS -f ${WRKSRC}/Makefile
|
||||
OBJS+= gd_gif_in.o
|
||||
SRCS= ${OBJS:.o=.c}
|
||||
LIB=gd
|
||||
SHLIB_MAJOR=3
|
||||
SHLIB_MINOR=0
|
||||
@ -29,8 +30,8 @@ LDADD+= -lX11
|
||||
# to run them all automaticly. So building tests is disabled here. -mi
|
||||
all: lib${LIB}.a ${SHLIB_NAME} ${PROGS} # ${TESTS}
|
||||
|
||||
lib${LIB}.a ${SHLIB_NAME}:
|
||||
make LIB=${LIB} SRCS="${OBJS:.o=.c}" \
|
||||
lib${LIB}.a ${SHLIB_NAME}: ${SRCS}
|
||||
make LIB=${LIB} SRCS="${SRCS}" \
|
||||
SHLIB_MAJOR=${SHLIB_MAJOR} SHLIB_MINOR=${SHLIB_MINOR} \
|
||||
CFLAGS="${CFLAGS}" -ECFLAGS LDADD="${LDADD}" \
|
||||
-f bsd.lib.mk ${.TARGET}
|
||||
@ -47,3 +48,7 @@ install:
|
||||
cd ${.CURDIR} && ${INSTALL_DATA} ${INCS} ${PREFIX}/include/gd
|
||||
cd ${.CURDIR} && ${INSTALL_PROGRAM} ${PROGS} "${PREFIX}/bin/"
|
||||
${INSTALL_SCRIPT} "${.CURDIR}/bdftogd" "${PREFIX}/bin/"
|
||||
|
||||
.if exists(${.CURDIR}/Makefile.fonts)
|
||||
.include "Makefile.fonts"
|
||||
.endif
|
||||
|
44
graphics/gd2/scripts/configure
vendored
Normal file
44
graphics/gd2/scripts/configure
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
# The GD_FONTS environment variable can be set to specify the gzipped
|
||||
# tar-ball containing the fonts in bdf format and the bdf file names.
|
||||
#
|
||||
# For example:
|
||||
# GD_FONTS="/usr/ports/distfiles/x-koi8u.tgz koi6x10.bdf koi8x13.bdf \
|
||||
# koi9x15.bdf koi12x24.bdf koi10x20.bdf"
|
||||
#
|
||||
# This can be usefull for slave ports, like ukrainian/gd, which may
|
||||
# now provide alternative fonts easily.
|
||||
|
||||
# TODO: . handle multiple archiving formats: tgz, tar.bz2, zip
|
||||
# . allow for passing already extracted font-files
|
||||
|
||||
if [ -z "$GD_FONTS" ]
|
||||
then
|
||||
echo "GD_FONTS can be set to specify an alternative list of .bdf files"
|
||||
echo "See $0 for details..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
set $GD_FONTS
|
||||
#
|
||||
# The tarball is the first argument, the tiny, small, medium-bold,
|
||||
# large, and giant fonts follow.
|
||||
#
|
||||
|
||||
tarball=$1
|
||||
shift
|
||||
tar -xvzpf $tarball -C $WRKSRC $@
|
||||
|
||||
rm -f $WRKSRC/Makefile.fonts
|
||||
|
||||
for font in Tiny Small MediumBold Large Giant
|
||||
do
|
||||
f=`echo $font | tr -d [[:lower:]] | tr [[:upper:]] [[:lower:]]`
|
||||
rm -f $WRKSRC/gdfont$font.[ch]
|
||||
printf 'gdfont%s.c gdfont%s.h: %s\
|
||||
perl ${.CURDIR}/bdftogd gdFont%s font%s < %s\n' \
|
||||
$f $f $1 $font $f $1 >> $WRKSRC/Makefile.fonts
|
||||
shift
|
||||
done
|
Loading…
Reference in New Issue
Block a user