pkgsrc/fonts/t1lib/Makefile
chuck 68e3ca275b work around clang compiler issue and malloc overflow in t1lib
there are two bugs in fonts/t1lib that cause math/grace to crash on OSX:

[1] compiler bug in some versions of clang when compiling with "-O2" ...
    this appears to have been fixed somewhere between clang-11 and clang-12.
    it works ok with "-O1" and it doesn't impact my NetBSD system (which
    has gcc instead of clang).   resolve by using memcpy() in LONGCOPY()
    macro rather than using custom code that triggers the clang issue.
    see: https://mail-index.netbsd.org/tech-pkg/2022/06/08/msg026367.html

[2] one case of t1lib trying to be clever and instead writing past end of
     malloc'd buffer (which the OSX malloc did not like at all;  the netbsd
     malloc did not get messed up by this).   the address sanitizer helped
     pinpoint this.
2022-06-08 19:00:13 +00:00

60 lines
1.5 KiB
Makefile

# $NetBSD: Makefile,v 1.55 2022/06/08 19:00:13 chuck Exp $
DISTNAME= t1lib-5.1.2
PKGREVISION= 7
CATEGORIES= fonts devel graphics
MASTER_SITES= ${MASTER_SITE_SUNSITE:=libs/graphics/}
MAINTAINER= pkgsrc-users@NetBSD.org
COMMENT= Library for generating bitmaps from Adobe Type 1 fonts
MAKE_JOBS_SAFE= no
USE_LIBTOOL= yes
USE_TOOLS+= gmake pax
GNU_CONFIGURE= yes
BUILD_TARGET= without_doc
EGDIR= ${PREFIX}/share/examples/${PKGBASE}
DATADIR= ${PREFIX}/share/${PKGBASE}
CONF_FILES= ${EGDIR}/t1lib.config.sample ${DATADIR}/t1lib.config
CONF_FILES+= ${EGDIR}/FontDataBase ${DATADIR}/FontDataBase
INSTALLATION_DIRS= ${EGDIR} ${DATADIR} share/doc
.include "options.mk"
PLIST_VARS+= x11
.if !empty(PKG_OPTIONS:Mx11)
PLIST.x11= yes
.else
CONFIGURE_ARGS+= --without-x
.endif
SUBST_CLASSES+= paths
SUBST_FILES.paths= t1lib.config.sample
SUBST_VARS.paths= PREFIX
SUBST_VARS.paths+= LOCALBASE
SUBST_STAGE.paths= pre-configure
post-extract:
${CP} ${FILESDIR}/t1lib.config.sample ${WRKSRC}
pre-build:
${FIND} ${WRKSRC} -name "*.orig" -print | ${XARGS} ${RM} -f
post-install:
cd ${WRKSRC}; \
pax -rw Fonts ${DESTDIR}${DATADIR}; \
${CHMOD} go+r ${DESTDIR}${DATADIR}/Fonts/enc/IsoLatin2.enc; \
pax -rw -s "/doc/${PKGBASE}/" doc ${DESTDIR}${PREFIX}/share/doc
${INSTALL_DATA} ${WRKSRC}/t1lib.config.sample ${DESTDIR}${EGDIR}
cd ${WRKSRC}/examples; \
pax -rw FontDataBase t1example1.c t1lib.config ${DESTDIR}${EGDIR}
.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"