/[gentoo-x86]/app-text/ghostscript-gpl/ghostscript-gpl-8.70-r1.ebuild
Gentoo

Contents of /app-text/ghostscript-gpl/ghostscript-gpl-8.70-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Fri Aug 7 02:22:05 2009 UTC (5 years, 4 months ago) by tgurr
Branch: MAIN
Revbump fixing QA problems regarding ldflags (bug #280404) and cjk (bug #280515).
(Portage version: 2.2_rc36/cvs/Linux x86_64)

1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-text/ghostscript-gpl/ghostscript-gpl-8.70.ebuild,v 1.1 2009/08/04 21:59:54 tgurr Exp $
4
5 inherit autotools eutils versionator flag-o-matic
6
7 DESCRIPTION="GPL Ghostscript - the most current Ghostscript, AFPL, relicensed."
8 HOMEPAGE="http://ghostscript.com/"
9
10 MY_P=${P/-gpl}
11 GSDJVU_PV=1.4
12 PVM=$(get_version_component_range 1-2)
13 SRC_URI="!bindist? ( djvu? ( mirror://sourceforge/djvu/gsdjvu-${GSDJVU_PV}.tar.gz ) )
14 mirror://sourceforge/ghostscript/${MY_P}.tar.bz2
15 mirror://gentoo/${P}-patchset-2.tar.bz2"
16
17 LICENSE="GPL-3 CPL-1.0"
18 SLOT="0"
19 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
20 IUSE="bindist cairo cups djvu gtk jpeg2k X"
21
22 COMMON_DEPEND="app-text/libpaper
23 media-libs/fontconfig
24 >=media-libs/jpeg-6b
25 >=media-libs/libpng-1.2.5
26 >=media-libs/tiff-3.7
27 >=sys-libs/zlib-1.1.4
28 !bindist? ( djvu? ( app-text/djvu ) )
29 cairo? ( >=x11-libs/cairo-1.2.0 )
30 cups? ( >=net-print/cups-1.3.8 )
31 gtk? ( >=x11-libs/gtk+-2.0 )
32 jpeg2k? ( media-libs/jasper )
33 X? ( x11-libs/libXt x11-libs/libXext )
34 !app-text/ghostscript-gnu"
35
36 DEPEND="${COMMON_DEPEND}
37 dev-util/pkgconfig"
38
39 RDEPEND="${COMMON_DEPEND}
40 linguas_ja? ( media-fonts/kochi-substitute )
41 linguas_ko? ( media-fonts/baekmuk-fonts )
42 linguas_zh_CN? ( media-fonts/arphicfonts )
43 linguas_zh_TW? ( media-fonts/arphicfonts )
44 media-fonts/gnu-gs-fonts-std"
45
46 S="${WORKDIR}/${MY_P}"
47
48 LANGS="ja ko zh_CN zh_TW"
49 for X in ${LANGS} ; do
50 IUSE="${IUSE} linguas_${X}"
51 done
52
53 src_unpack() {
54 unpack ${A}
55 cd "${S}"
56
57 # remove internal copies of expat, jasper, jpeg, libpng and zlib
58 rm -rf "${S}/expat"
59 rm -rf "${S}/jasper"
60 rm -rf "${S}/jpeg"
61 rm -rf "${S}/libpng"
62 rm -rf "${S}/zlib"
63 # remove internal urw-fonts
64 rm -rf "${S}/Resource/Font"
65
66 # Fedora patches
67 # http://cvs.fedora.redhat.com/viewcvs/devel/ghostscript/
68 epatch "${WORKDIR}/patches/${PN}-8.61-multilib.patch"
69 epatch "${WORKDIR}/patches/${PN}-8.64-scripts.patch"
70 epatch "${WORKDIR}/patches/${PN}-8.64-noopt.patch"
71 epatch "${WORKDIR}/patches/${PN}-8.64-fPIC.patch"
72 epatch "${WORKDIR}/patches/${PN}-8.70-runlibfileifexists.patch"
73 epatch "${WORKDIR}/patches/${PN}-8.64-system-jasper.patch"
74 epatch "${WORKDIR}/patches/${PN}-8.64-pksmraw.patch"
75 epatch "${WORKDIR}/patches/${PN}-8.70-jbig2dec-nullderef.patch"
76
77 # Gentoo patches
78 # respect LDFLAGS, bug #209803
79 epatch "${WORKDIR}/patches/${PN}-8.64-respect-gsc-ldflags.patch"
80
81 if use bindist && use djvu ; then
82 ewarn "You have bindist in your USE, djvu support will NOT be compiled!"
83 ewarn "See http://djvu.sourceforge.net/gsdjvu/COPYING for details on licensing issues."
84 fi
85
86 if ! use bindist && use djvu ; then
87 unpack gsdjvu-${GSDJVU_PV}.tar.gz
88 cp gsdjvu-${GSDJVU_PV}/gsdjvu "${S}"
89 cp gsdjvu-${GSDJVU_PV}/gdevdjvu.c "${S}/base"
90 epatch "${WORKDIR}/patches/${PN}-8.64-gsdjvu-1.3.patch"
91 cp gsdjvu-${GSDJVU_PV}/ps2utf8.ps "${S}/lib"
92 cp "${S}/base/contrib.mak" "${S}/base/contrib.mak.gsdjvu"
93 grep -q djvusep "${S}/base/contrib.mak" || \
94 cat gsdjvu-${GSDJVU_PV}/gsdjvu.mak >> "${S}/base/contrib.mak"
95
96 # install ps2utf8.ps, bug #197818
97 sed -i -e '/$(EXTRA_INIT_FILES)/ a\ps2utf8.ps \\' "${S}/base/unixinst.mak" \
98 || die "sed failed"
99 fi
100
101 if ! use gtk ; then
102 sed -i "s:\$(GSSOX)::" base/*.mak || die "gsx sed failed"
103 sed -i "s:.*\$(GSSOX_XENAME)$::" base/*.mak || die "gsxso sed failed"
104 fi
105
106 # search path fix
107 sed -i -e "s:\$\(gsdatadir\)/lib:/usr/share/ghostscript/${PVM}/$(get_libdir):" \
108 -e 's:$(gsdir)/fonts:/usr/share/fonts/default/ghostscript/:' \
109 -e "s:exdir=.*:exdir=/usr/share/doc/${PF}/examples:" \
110 -e "s:docdir=.*:docdir=/usr/share/doc/${PF}/html:" \
111 -e "s:GS_DOCDIR=.*:GS_DOCDIR=/usr/share/doc/${PF}/html:" \
112 base/Makefile.in base/*.mak || die "sed failed"
113
114 cd "${S}"
115 eautoreconf
116
117 cd "${S}/ijs"
118 eautoreconf
119 }
120
121 src_compile() {
122 econf \
123 $(use_enable cairo) \
124 $(use_enable cups) \
125 $(use_enable gtk) \
126 $(use_with jpeg2k jasper) \
127 $(use_with X x) \
128 --disable-compile-inits \
129 --enable-dynamic \
130 --enable-fontconfig \
131 --with-drivers=ALL \
132 --with-ijs \
133 --with-jbig2dec \
134 --with-libpaper
135
136 if ! use bindist && use djvu ; then
137 sed -i -e 's!$(DD)bbox.dev!& $(DD)djvumask.dev $(DD)djvusep.dev!g' Makefile
138 fi
139
140 emake -j1 so all || die "emake failed"
141
142 cd "${S}/ijs"
143 econf || die "ijs econf failed"
144 emake || die "ijs emake failed"
145 }
146
147 src_install() {
148 # parallel install is broken, bug #251066
149 emake -j1 DESTDIR="${D}" install-so install || die "emake install failed"
150
151 if ! use bindist && use djvu ; then
152 dobin gsdjvu || die "dobin gsdjvu install failed"
153 fi
154
155 # remove gsc in favor of gambit, bug #253064
156 rm -rf "${D}/usr/bin/gsc"
157
158 rm -rf "${D}/usr/share/doc/${PF}/html/"{README,PUBLIC}
159 dodoc doc/README || die "dodoc install failed"
160
161 cd "${S}/ijs"
162 emake DESTDIR="${D}" install || die "emake ijs install failed"
163
164 # Rename an original cidfmap to cidfmap.GS
165 mv "${D}/usr/share/ghostscript/${PVM}/Resource/Init/cidfmap"{,.GS}
166
167 # Install our own cidfmap to allow the separated cidfmap
168 insinto "/usr/share/ghostscript/${PVM}/Resource/Init"
169 doins "${WORKDIR}/fontmaps/CIDFnmap" || die "doins CIDFnmap failed"
170 doins "${WORKDIR}/fontmaps/cidfmap" || die "doins cidfmap failed"
171 for X in ${LANGS} ; do
172 if use linguas_${X} ; then
173 doins "${WORKDIR}/fontmaps/cidfmap.${X}" || die "doins cidfmap.${X} failed"
174 fi
175 done
176 }

  ViewVC Help
Powered by ViewVC 1.1.20