Tweak print/ghostscript9-agpl-base version 9.16_5
[dports.git] / print / ghostscript9-agpl-base / Makefile
1 # $FreeBSD$
2
3 PORTNAME=       ghostscript
4 PORTVERSION=    9.16
5 PORTREVISION=   5
6 CATEGORIES=     print
7 MASTER_SITES=   http://downloads.ghostscript.com/public/:gs_srcs \
8                 SF/ghostscript/GPL%20Ghostscript/${PORTVERSION}:gs_srcs \
9                 ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/gs${PORTVERSION:S/.//}/:gs_srcs \
10                 http://www.humblesoft.com/pub/:epag
11 PKGNAMESUFFIX=  9-agpl-base
12 DISTFILES=      ${DISTNAME}${EXTRACT_SUFX}:gs_srcs ${EPAG_SRCS}:epag
13 DIST_SUBDIR=    ${PORTNAME}
14 EXTRACT_ONLY=   ${DISTNAME}${EXTRACT_SUFX}
15
16 MAINTAINER=     doceng@FreeBSD.org
17 COMMENT=        Ghostscript 9.x PostScript interpreter, base part
18
19 LICENSE=        AGPLv3
20
21 LIB_DEPENDS=    libexpat.so:textproc/expat2 \
22                 libfreetype.so:print/freetype2 \
23                 libidn.so:dns/libidn \
24                 libjbig2dec.so:graphics/jbig2dec \
25                 liblcms2.so:graphics/lcms2 \
26                 libpaper.so:print/libpaper \
27                 libpng.so:graphics/png \
28                 libtiff.so:graphics/tiff
29 RUN_DEPENDS=    ${LOCALBASE}/share/${PORTNAME}/fonts/a010013l.pfb:print/gsfonts
30
31 CONFLICTS_INSTALL= \
32                 gambc-[0-9]* \
33                 ghostscript[789]-[0-9]* \
34                 ghostscript[789]-nox11-[0-9]* \
35                 ghostscript9-agpl-[0-9]* \
36                 ghostscript9-agpl-nox11-[0-9]*
37
38 USES=           autoreconf compiler gmake iconv jpeg pkgconfig:build tar:bzip2
39 USE_LDCONFIG=   yes
40 EXTRACT_AFTER_ARGS=     ${EXCLUDE_DIRS:S/^/--exclude /}
41 DATADIR=        ${PREFIX}/share/${PORTNAME}/${PORTVERSION}
42 GNU_CONFIGURE=  yes
43 MAKE_ENV=       CFLAGS_STANDARD="${CFLAGS}" \
44                 XCFLAGS="${XCFLAGS}" XLDFLAGS="${XLDFLAGS}" \
45                 SOC_LOADER="dxmainc.c"
46 CONFIGURE_ENV=  ${MAKE_ENV}
47 CONFIGURE_ARGS= --disable-compile-inits \
48                 --enable-contrib \
49                 --enable-dynamic \
50                 --enable-freetype \
51                 --with-libiconv=native \
52                 --with-system-libtiff \
53                 --with-ijs \
54                 --with-libidn \
55                 --with-libpaper \
56                 --without-x \
57                 --disable-gtk \
58                 --with-drivers=""
59 CPPFLAGS+=      -DUPD_SIGNAL=0 -I. \
60                 -I${LOCALBASE}/include/libpng \
61                 -I${WRKSRC}/openjpeg/src/lib/openjp2 \
62                 -I${LOCALBASE}/include
63 LDFLAGS+=       -L${LOCALBASE}/lib
64 XCFLAGS=        -DA4
65 XLDFLAGS=       -lpthread
66 ALL_TARGET=     so
67 INSTALL_TARGET= soinstall
68 PLIST_SUB=      SHLIB_VER="${PORTVERSION:R}" \
69                 GS_VERSION="${PORTVERSION}"
70 SUB_FILES=      pkg-message
71 SUB_LIST=       DATADIR="${DATADIR}"
72 PKGMESSAGE=     ${WRKDIR}/pkg-message
73
74 OPTIONS_DEFINE= DOCS CUPS FONTCONFIG ICONV
75 OPTIONS_DEFAULT=CUPS FONTCONFIG ICONV
76 OPTIONS_SUB=    yes
77 FONTCONFIG_DESC=Enable fontconfig support
78 FONTCONFIG_LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig
79 FONTCONFIG_CONFIGURE_ENABLE=    fontconfig
80 NO_OPTIONS_SORT=yes
81
82 EXCLUDE_DIRS=   freetype jbig2dec jpeg expat lcms2 libpng tiff zlib
83
84 .include "Makefile.drivers"
85 .include <bsd.port.options.mk>
86 .include "files/Makefile.drivers_post"
87
88 PORTDOCS=       japanese chp2200 epson740 lxm3200-tweaked md2k_md5k
89 PORTDOC_FILES=  japanese/Gdevlips.htm japanese/README.gs550j            \
90         japanese/cdj880.txt japanese/dj505j.txt japanese/djgpp.txt      \
91         japanese/gdev10v.txt japanese/gdevalps.txt                      \
92         japanese/gdevcd8.txt japanese/gdevdmpr.txt                      \
93         japanese/gdevfmlbp.txt japanese/gdevj100.txt                    \
94         japanese/gdevlbp3.txt japanese/gdevmag.txt                      \
95         japanese/gdevmd2k.txt japanese/gdevmjc.txt                      \
96         japanese/gdevml6.txt japanese/gdevp201.txt japanese/gs261j.euc  \
97         japanese/gs261j.txt chp2200/AUTHORS chp2200/INSTALL             \
98         epson740/README epson740/upp-HowTo-to-be                        \
99         lxm3200-tweaked/LICENSE lxm3200-tweaked/README                  \
100         lxm3200-tweaked/RELEASE_NOTES                                   \
101         lxm3200-tweaked/Z12-Z31-QuickSetup md2k_md5k/README.jis
102
103 post-patch:
104         ${REINPLACE_CMD} -e 's,%%DATADIR%%,${DATADIR},' \
105             ${WRKSRC}/contrib/japanese/dmp_site.ps
106 # XXX CHOSEN_COMPILER_VERSION isn't supported, so check CC hasn't changed
107         @if [ '${ARCH}:${CC}:${COMPILER_TYPE}:${COMPILER_VERSION}' = 'aarch64:cc:clang:38' ]; then \
108                 ${REINPLACE_CMD} '/CC.*trio\./s/$$/ -O0/' ${WRKSRC}/base/trio.mak; \
109         fi
110
111 pre-build-drivers.mak:
112         @${ECHO_CMD} '# automatically generated' > ${WRKSRC}/base/drivers.mak
113         @${ECHO_CMD} 'DEVICE_DEVS=$${DISPLAY_DEV}' >> ${WRKSRC}/base/drivers.mak
114 .for N in ${DEVS_LIST}
115         @${ECHO_CMD} '${N:S/^/DEVICE_/:S/^DEVICE_DISPLAY_DEV/DISPLAY_DEV/}=' >> ${WRKSRC}/base/drivers.mak
116 .endfor
117 .for D in ${OPTIONS_DEFINE:MGS_*:S/^GS_//} \
118         ${OPTIONS_GROUP_ICONV:MGS_*:S/^GS_//} \
119         ${OPTIONS_GROUP_SVGALIB:MGS_*:S/^GS_//}
120 .for N in ${DEVS_LIST}
121 .if ${PORT_OPTIONS:MGS_${D}}
122 .if !defined(OPTIONS_UNSET) || !${OPTIONS_UNSET:MGS_${D}}
123 .for X in ${${N:S/^/DEVICE_/:S/^DEVICE_DISPLAY_DEV/DISPLAY_DEV/}:M${D}.dev}
124         @${ECHO_CMD} '${N:S/^/DEVICE_/:S/^DEVICE_DISPLAY_DEV/DISPLAY_DEV/}+= $$(DD)${D}.dev'  >> ${WRKSRC}/base/drivers.mak
125 .endfor
126 .endif
127 .endif
128 .endfor
129 .endfor
130
131 pre-build: pre-build-drivers.mak
132         ${MKDIR} ${WRKSRC}/obj
133         ${MKDIR} ${WRKSRC}/bin
134
135 pre-install:
136         cd ${WRKSRC}/Resource/Init && ${RM} \
137             gs_statd.ps.orig gs_ttf.ps.orig pdf_font.ps.orig
138         ${MKDIR} ${STAGEDIR}${DATADIR}
139
140 post-install-DOCS-on: post-install-docs
141         ${MKDIR} ${WRKSRC}/contrib/japanese
142         ${INSTALL_DATA} ${WRKSRC}/contrib/japanese/doc/* \
143             ${WRKSRC}/contrib/japanese
144         ${MKDIR} ${STAGEDIR}${DOCSDIR}
145         cd ${WRKSRC}/contrib && \
146             ${TAR} -cf - ${PORTDOC_FILES} | \
147             (cd ${STAGEDIR}${DOCSDIR} && ${TAR} -xof -)
148
149 post-install:
150         ${LN} -sf gsc ${STAGEDIR}${PREFIX}/bin/gs
151         ${LN} -s -f ${LOCALBASE}/share/fonts/CIDFont \
152             ${STAGEDIR}${DATADIR}/Resource/CIDFont/fonts
153
154 .include <bsd.port.mk>