| @@ -1,124 +1,125 @@ | | | @@ -1,124 +1,125 @@ |
1 | # $NetBSD: Makefile,v 1.49 2020/01/03 23:56:09 sevan Exp $ | | 1 | # $NetBSD: Makefile,v 1.50 2020/01/06 07:23:26 mef Exp $ |
2 | | | 2 | |
3 | DISTNAME= ghostscript-${GS_VERSION} | | 3 | DISTNAME= ghostscript-${GS_VERSION} |
4 | PKGNAME= ${DISTNAME:S/ghostscript/ghostscript-agpl/} | | 4 | PKGNAME= ${DISTNAME:S/ghostscript/ghostscript-agpl/} |
5 | PKGREVISION= 2 | | 5 | PKGREVISION= 2 |
6 | CATEGORIES= print | | 6 | CATEGORIES= print |
7 | MASTER_SITES= ${MASTER_SITE_GITHUB:=ArtifexSoftware/} | | 7 | MASTER_SITES= ${MASTER_SITE_GITHUB:=ArtifexSoftware/} |
8 | GITHUB_PROJECT= ghostpdl-downloads | | 8 | GITHUB_PROJECT= ghostpdl-downloads |
9 | GITHUB_RELEASE= gs${GS_VERSION:S/.//} | | 9 | GITHUB_RELEASE= gs${GS_VERSION:S/.//} |
10 | EXTRACT_SUFX= .tar.xz | | 10 | EXTRACT_SUFX= .tar.xz |
11 | | | 11 | |
12 | MAINTAINER= pkgsrc-users@NetBSD.org | | 12 | MAINTAINER= pkgsrc-users@NetBSD.org |
13 | HOMEPAGE= https://ghostscript.com/ | | 13 | HOMEPAGE= https://ghostscript.com/ |
14 | COMMENT= Postscript interpreter | | 14 | COMMENT= Postscript interpreter |
15 | | | 15 | |
16 | # Upstream calls this "GPL Ghostscript", which is confusing; | | 16 | # Upstream calls this "GPL Ghostscript", which is confusing; |
17 | # see https://bugs.ghostscript.com/show_bug.cgi?id=700877 | | 17 | # see https://bugs.ghostscript.com/show_bug.cgi?id=700877 |
18 | # Plus adobe verbatim for Resources/CMap. | | 18 | # Plus adobe verbatim for Resources/CMap. |
19 | LICENSE= gnu-agpl-v3 | | 19 | LICENSE= gnu-agpl-v3 |
20 | | | 20 | |
21 | .include "Makefile.common" | | 21 | .include "Makefile.common" |
22 | | | 22 | |
23 | DEPENDS+= ghostscript-fonts>=6.0:../../fonts/ghostscript-fonts | | 23 | DEPENDS+= ghostscript-fonts>=6.0:../../fonts/ghostscript-fonts |
24 | | | 24 | |
25 | USE_LANGUAGES+= c c++ | | 25 | USE_LANGUAGES+= c c++ |
26 | USE_TOOLS+= gmake perl:run lex pkg-config | | 26 | USE_TOOLS+= gmake perl:run lex pkg-config |
27 | GNU_CONFIGURE= yes | | 27 | GNU_CONFIGURE= yes |
28 | UNLIMIT_RESOURCES+= datasize # gsromfs1.c | | 28 | UNLIMIT_RESOURCES+= datasize # gsromfs1.c |
29 | | | 29 | |
30 | BUILD_TARGET= so | | 30 | BUILD_TARGET= so |
31 | INSTALL_TARGET= soinstall | | 31 | INSTALL_TARGET= soinstall |
32 | | | 32 | |
33 | CONFIGURE_ARGS+= --enable-openjpeg | | 33 | CONFIGURE_ARGS+= --enable-openjpeg |
34 | CONFIGURE_ARGS+= --with-system-libtiff | | 34 | CONFIGURE_ARGS+= --with-system-libtiff |
35 | CONFIGURE_ENV+= LPLIBDIR=${PREFIX}/lib | | 35 | CONFIGURE_ENV+= LPLIBDIR=${PREFIX}/lib |
36 | CONFIGURE_ENV.HPUX+= ac_cv_func_fopen64=no | | 36 | CONFIGURE_ENV.HPUX+= ac_cv_func_fopen64=no |
37 | | | 37 | |
38 | REPLACE_PERL+= toolbin/localcluster/clusterpush.pl | | 38 | REPLACE_PERL+= toolbin/localcluster/clusterpush.pl |
39 | REPLACE_PERL+= toolbin/checkdeps.pl | | 39 | REPLACE_PERL+= toolbin/checkdeps.pl |
40 | REPLACE_PERL+= toolbin/pscet_status.pl | | 40 | REPLACE_PERL+= toolbin/pscet_status.pl |
41 | REPLACE_PERL+= toolbin/performance.pl | | 41 | REPLACE_PERL+= toolbin/performance.pl |
42 | REPLACE_PERL+= toolbin/squeeze2html.pl | | 42 | REPLACE_PERL+= toolbin/squeeze2html.pl |
43 | REPLACE_PERL+= toolbin/bugsByEngineer.pl | | 43 | REPLACE_PERL+= toolbin/bugsByEngineer.pl |
44 | REPLACE_PERL+= toolbin/htmldiff.pl | | 44 | REPLACE_PERL+= toolbin/htmldiff.pl |
45 | | | 45 | |
46 | GS_RESOURCEDIR= ${PREFIX}/share/ghostscript/${PKGVERSION}/Resource | | 46 | GS_RESOURCEDIR= ${PREFIX}/share/ghostscript/${PKGVERSION}/Resource |
47 | # MESSAGE file substitution | | 47 | # MESSAGE file substitution |
48 | MESSAGE_SUBST+= GS_RESOURCEDIR=${GS_RESOURCEDIR} | | 48 | MESSAGE_SUBST+= GS_RESOURCEDIR=${GS_RESOURCEDIR} |
49 | | | 49 | |
50 | .include "../../mk/bsd.prefs.mk" | | 50 | .include "../../mk/bsd.prefs.mk" |
51 | .include "../../mk/compiler.mk" | | 51 | .include "../../mk/compiler.mk" |
52 | | | 52 | |
53 | # \todo Remove "a4" as that is not valid according to pkglint. | | 53 | # \todo Remove "a4" as that is not valid according to pkglint. |
54 | .if defined(PAPERSIZE) && (${PAPERSIZE} == "A4" || ${PAPERSIZE} == "a4") | | 54 | .if defined(PAPERSIZE) && (${PAPERSIZE} == "A4" || ${PAPERSIZE} == "a4") |
55 | BUILD_DEFS+= PAPERSIZE | | 55 | BUILD_DEFS+= PAPERSIZE |
56 | CFLAGS+= -DA4 | | 56 | CFLAGS+= -DA4 |
57 | .endif | | 57 | .endif |
58 | | | 58 | |
59 | REQD_DIRS+= share/ghostscript | | 59 | REQD_DIRS+= share/ghostscript |
60 | | | 60 | |
61 | SUBST_CLASSES+= resdir | | 61 | SUBST_CLASSES+= resdir |
62 | SUBST_STAGE.resdir= post-extract | | 62 | SUBST_STAGE.resdir= post-extract |
63 | SUBST_MESSAGE.resdir= Fixing resource directory path | | 63 | SUBST_MESSAGE.resdir= Fixing resource directory path |
64 | SUBST_FILES.resdir= Resource/Init/gs_res.ps | | 64 | SUBST_FILES.resdir= Resource/Init/gs_res.ps |
65 | SUBST_SED.resdir= -e "s|/Resource/|${GS_RESOURCEDIR}/|g" | | 65 | SUBST_SED.resdir= -e "s|/Resource/|${GS_RESOURCEDIR}/|g" |
66 | | | 66 | |
67 | # On Linux-*-x86_64, there was an error message: | | 67 | # On Linux-*-x86_64, there was an error message: |
68 | # gp_unix.o: relocation R_X86_64_32 against `a local symbol' can not be | | 68 | # gp_unix.o: relocation R_X86_64_32 against `a local symbol' can not be |
69 | # used when making a shared object; recompile with -fPIC | | 69 | # used when making a shared object; recompile with -fPIC |
70 | .if !empty(PKGSRC_COMPILER:Mgcc) || !empty(PKGSRC_COMPILER:Mclang) | | 70 | .if !empty(PKGSRC_COMPILER:Mgcc) || !empty(PKGSRC_COMPILER:Mclang) |
71 | CFLAGS+= -fPIC | | 71 | CFLAGS+= -fPIC |
72 | .endif | | 72 | .endif |
73 | | | 73 | |
74 | # Not ideal but too many files hardcode _XOPEN_SOURCE=500. | | 74 | # Not ideal but too many files hardcode _XOPEN_SOURCE=500. |
75 | .if !empty(CC_VERSION:Mgcc-[6-9]*) || !empty(PKGSRC_COMPILER:Mclang) | | 75 | .if !empty(CC_VERSION:Mgcc-[6-9]*) || !empty(PKGSRC_COMPILER:Mclang) |
76 | CPPFLAGS.SunOS+= -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ | | 76 | CPPFLAGS.SunOS+= -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ |
77 | .else | | 77 | .else |
78 | CPPFLAGS.SunOS+= -D__C99FEATURES__ | | 78 | CPPFLAGS.SunOS+= -D__C99FEATURES__ |
79 | .endif | | 79 | .endif |
80 | | | 80 | |
81 | # Interim IRIX build fix, the real problem is that fontconfig.pc doesn't | | 81 | # Interim IRIX build fix, the real problem is that fontconfig.pc doesn't |
82 | # require linking against libiconv when it should do so. | | 82 | # require linking against libiconv when it should do so. |
83 | BUILDLINK_TRANSFORM.IRIX+= l:fontconfig:fontconfig:iconv | | 83 | BUILDLINK_TRANSFORM.IRIX+= l:fontconfig:fontconfig:iconv |
84 | | | 84 | |
85 | .include "options.mk" | | 85 | .include "options.mk" |
86 | | | 86 | |
87 | post-extract: | | 87 | post-extract: |
88 | ${MKDIR} ${WRKSRC}/bin | | 88 | ${MKDIR} ${WRKSRC}/bin |
89 | ${MKDIR} ${WRKSRC}/obj | | 89 | ${MKDIR} ${WRKSRC}/obj |
90 | ${RM} -rf ${WRKSRC}/freetype | | 90 | ${RM} -rf ${WRKSRC}/freetype |
91 | ${RM} -rf ${WRKSRC}/jbig2dec | | 91 | ${RM} -rf ${WRKSRC}/jbig2dec |
92 | ${RM} -rf ${WRKSRC}/jpeg | | 92 | ${RM} -rf ${WRKSRC}/jpeg |
93 | ${RM} -rf ${WRKSRC}/lcms2 | | 93 | ${RM} -rf ${WRKSRC}/lcms2 |
94 | ${RM} -rf ${WRKSRC}/lcms2mt | | 94 | ${RM} -rf ${WRKSRC}/lcms2mt |
95 | ${RM} -rf ${WRKSRC}/libpng | | 95 | ${RM} -rf ${WRKSRC}/libpng |
96 | ${RM} -rf ${WRKSRC}/openjpeg | | 96 | ${RM} -rf ${WRKSRC}/openjpeg |
97 | ${RM} -rf ${WRKSRC}/tiff | | 97 | ${RM} -rf ${WRKSRC}/tiff |
98 | ${RM} -rf ${WRKSRC}/zlib | | 98 | ${RM} -rf ${WRKSRC}/zlib |
99 | | | 99 | |
100 | # To allow outside customization, rename cidfmap | | 100 | # To allow outside customization, rename cidfmap |
101 | # (if you look at inside of the file, it is logically empty) | | 101 | # (if you look at inside of the file, it is logically empty) |
102 | .if !empty(PKG_OPTIONS:Mdisable-compile-inits) | | 102 | .if !empty(PKG_OPTIONS:Mdisable-compile-inits) |
103 | (cd ${WRKSRC}/Resource/Init/; ${MV} cidfmap cidfmap.dist) | | 103 | (cd ${WRKSRC}/Resource/Init/; ${MV} cidfmap cidfmap.dist) |
104 | .endif | | 104 | .endif |
105 | | | 105 | |
106 | post-install: | | 106 | post-install: |
107 | ${LN} -sf gsc ${DESTDIR}${PREFIX}/bin/gs | | 107 | ${LN} -sf gsc ${DESTDIR}${PREFIX}/bin/gs |
| | | 108 | ${RM} -f ${DESTDIR}${PREFIX}/share/ghostscript/${PKGVERSION_NOREV}/Resource/Init/gs_ttf.ps.orig |
108 | | | 109 | |
109 | .include "../../devel/libidn/buildlink3.mk" | | 110 | .include "../../devel/libidn/buildlink3.mk" |
110 | .include "../../devel/zlib/buildlink3.mk" | | 111 | .include "../../devel/zlib/buildlink3.mk" |
111 | BUILDLINK_API_DEPENDS.freetype2+= freetype2>=2.10.0 | | 112 | BUILDLINK_API_DEPENDS.freetype2+= freetype2>=2.10.0 |
112 | .include "../../graphics/freetype2/buildlink3.mk" | | 113 | .include "../../graphics/freetype2/buildlink3.mk" |
113 | # XXX: Strictly speaking jbig2dec>=0.16, however now jbig2dec is only checked | | 114 | # XXX: Strictly speaking jbig2dec>=0.16, however now jbig2dec is only checked |
114 | # XXX: via pkg-config and jbig2dec-0.17 is the first version that provides a | | 115 | # XXX: via pkg-config and jbig2dec-0.17 is the first version that provides a |
115 | # XXX: .pc file. | | 116 | # XXX: .pc file. |
116 | BUILDLINK_API_DEPENDS.jbig2dec+= jbig2dec>=0.17 | | 117 | BUILDLINK_API_DEPENDS.jbig2dec+= jbig2dec>=0.17 |
117 | .include "../../graphics/jbig2dec/buildlink3.mk" | | 118 | .include "../../graphics/jbig2dec/buildlink3.mk" |
118 | .include "../../graphics/lcms2/buildlink3.mk" | | 119 | .include "../../graphics/lcms2/buildlink3.mk" |
119 | .include "../../graphics/openjpeg/buildlink3.mk" | | 120 | .include "../../graphics/openjpeg/buildlink3.mk" |
120 | .include "../../graphics/png/buildlink3.mk" | | 121 | .include "../../graphics/png/buildlink3.mk" |
121 | .include "../../graphics/tiff/buildlink3.mk" | | 122 | .include "../../graphics/tiff/buildlink3.mk" |
122 | .include "../../print/libpaper/buildlink3.mk" | | 123 | .include "../../print/libpaper/buildlink3.mk" |
123 | .include "../../mk/jpeg.buildlink3.mk" | | 124 | .include "../../mk/jpeg.buildlink3.mk" |
124 | .include "../../mk/bsd.pkg.mk" | | 125 | .include "../../mk/bsd.pkg.mk" |