Import print/ghostscript9-agpl-base version 9.16_2
[dports.git] / print / ghostscript9-agpl-base / Makefile
1 # $FreeBSD$
2
3 PORTNAME=       ghostscript
4 PORTVERSION=    9.16
5 PORTREVISION=   2
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:${PORTSDIR}/textproc/expat2 \
22                 libfreetype.so:${PORTSDIR}/print/freetype2 \
23                 libidn.so:${PORTSDIR}/dns/libidn \
24                 libjbig2dec.so:${PORTSDIR}/graphics/jbig2dec \
25                 liblcms2.so:${PORTSDIR}/graphics/lcms2 \
26                 libpaper.so:${PORTSDIR}/print/libpaper \
27                 libpng.so:${PORTSDIR}/graphics/png \
28                 libtiff.so:${PORTSDIR}/graphics/tiff
29 RUN_DEPENDS=    ${LOCALBASE}/share/${PORTNAME}/fonts/a010013l.pfb:${PORTSDIR}/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 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=DOCS CUPS FONTCONFIG ICONV
76 OPTIONS_SUB=    yes
77 FONTCONFIG_DESC=Enable fontconfig support
78 FONTCONFIG_LIB_DEPENDS= libfontconfig.so:${PORTSDIR}/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
107 pre-build-drivers.mak:
108         @${ECHO_CMD} '# automatically generated' > ${WRKSRC}/base/drivers.mak
109         @${ECHO_CMD} 'DEVICE_DEVS=$${DISPLAY_DEV}' >> ${WRKSRC}/base/drivers.mak
110 .for N in ${DEVS_LIST}
111         @${ECHO_CMD} '${N:S/^/DEVICE_/:S/^DEVICE_DISPLAY_DEV/DISPLAY_DEV/}=' >> ${WRKSRC}/base/drivers.mak
112 .endfor
113 .for D in ${OPTIONS_DEFINE:MGS_*:S/^GS_//} \
114         ${OPTIONS_GROUP_ICONV:MGS_*:S/^GS_//} \
115         ${OPTIONS_GROUP_SVGALIB:MGS_*:S/^GS_//}
116 .for N in ${DEVS_LIST}
117 .if ${PORT_OPTIONS:MGS_${D}}
118 .if !defined(OPTIONS_UNSET) || !${OPTIONS_UNSET:MGS_${D}}
119 .for X in ${${N:S/^/DEVICE_/:S/^DEVICE_DISPLAY_DEV/DISPLAY_DEV/}:M${D}.dev}
120         @${ECHO_CMD} '${N:S/^/DEVICE_/:S/^DEVICE_DISPLAY_DEV/DISPLAY_DEV/}+= $$(DD)${D}.dev'  >> ${WRKSRC}/base/drivers.mak
121 .endfor
122 .endif
123 .endif
124 .endfor
125 .endfor
126
127 pre-build: pre-build-drivers.mak
128         ${MKDIR} ${WRKSRC}/obj
129         ${MKDIR} ${WRKSRC}/bin
130
131 pre-install:
132         cd ${WRKSRC}/Resource/Init && ${RM} -f \
133             gs_statd.ps.orig gs_ttf.ps.orig pdf_font.ps.orig
134         ${MKDIR} ${STAGEDIR}${DATADIR}
135
136 post-install-DOCS-on: post-install-docs
137         ${MKDIR} ${WRKSRC}/contrib/japanese
138         ${INSTALL_DATA} ${WRKSRC}/contrib/japanese/doc/* \
139             ${WRKSRC}/contrib/japanese
140         ${MKDIR} ${STAGEDIR}${DOCSDIR}
141         cd ${WRKSRC}/contrib && \
142             ${TAR} -cf - ${PORTDOC_FILES} | \
143             (cd ${STAGEDIR}${DOCSDIR} && ${TAR} -xof -)
144
145 post-install:
146         ${LN} -sf gsc ${STAGEDIR}${PREFIX}/bin/gs
147         ${LN} -s -f ${LOCALBASE}/share/fonts/CIDFont \
148             ${STAGEDIR}${DATADIR}/Resource/CIDFont/fonts
149
150 .include <bsd.port.mk>