/[gentoo-x86]/dev-lang/mercury-extras/mercury-extras-11.01.ebuild
Gentoo

Contents of /dev-lang/mercury-extras/mercury-extras-11.01.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (hide annotations) (download)
Wed Jun 6 03:15:39 2012 UTC (6 years, 6 months ago) by zmedico
Branch: MAIN
Changes since 1.7: +3 -3 lines
inherit multilib for get_libdir

(Portage version: 2.2.0_alpha110/cvs/Linux i686)

1 zmedico 1.8 # Copyright 1999-2012 Gentoo Foundation
2 keri 1.1 # Distributed under the terms of the GNU General Public License v2
3 zmedico 1.8 # $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury-extras/mercury-extras-11.01.ebuild,v 1.7 2011/08/12 21:37:35 xarthisius Exp $
4 keri 1.1
5     EAPI=2
6    
7 zmedico 1.8 inherit eutils multilib
8 keri 1.1
9 keri 1.3 PATCHSET_VER="2"
10 keri 1.1
11     DESCRIPTION="Additional libraries and tools that are not part of the Mercury standard library"
12     HOMEPAGE="http://www.cs.mu.oz.au/research/mercury/index.html"
13     SRC_URI="http://www.mercury.cs.mu.oz.au/download/files/${P}.tar.gz
14     mirror://gentoo/${P}-gentoo-patchset-${PATCHSET_VER}.tar.gz"
15    
16     LICENSE="GPL-2"
17     SLOT="0"
18 xarthisius 1.7 KEYWORDS="amd64 x86"
19 keri 1.1
20     IUSE="X cairo examples glut iodbc ncurses odbc opengl ssl tcl tk xml"
21    
22     RDEPEND="~dev-lang/mercury-${PV}
23     cairo? ( >=x11-libs/cairo-1.10.0 )
24     glut? ( media-libs/freeglut )
25     odbc? ( dev-db/unixODBC )
26     iodbc? ( !odbc? ( dev-db/libiodbc ) )
27     ncurses? ( sys-libs/ncurses )
28     opengl? ( virtual/opengl )
29     tcl? ( tk? (
30     dev-lang/tcl
31     dev-lang/tk
32     x11-libs/libX11
33     x11-libs/libXmu ) )"
34    
35     DEPEND="${RDEPEND}"
36    
37     S="${WORKDIR}"/${P}
38    
39     src_prepare() {
40     cd "${WORKDIR}"
41    
42     EPATCH_FORCE=yes
43     EPATCH_SUFFIX=patch
44     epatch "${WORKDIR}"/${PV}
45    
46     if use odbc; then
47     epatch "${WORKDIR}"/${PV}-odbc/${P}-odbc.patch
48     elif use iodbc; then
49     epatch "${WORKDIR}"/${PV}-odbc/${P}-iodbc.patch
50     fi
51    
52     cd "${S}"
53     sed -i -e "s:references:references solver_types/library:" \
54     -e "s:windows_installer_generator::" \
55     Mmakefile || die "sed default packages failed"
56    
57     if use cairo; then
58     sed -i -e "s: lex : graphics/mercury_cairo lex :" Mmakefile \
59     || die "sed cairo failed"
60     fi
61    
62     if use glut; then
63     sed -i -e "s: lex : graphics/mercury_glut lex :" Mmakefile \
64     || die "sed glut failed"
65     fi
66    
67     if use opengl; then
68     sed -i -e "s: lex : graphics/mercury_opengl lex :" Mmakefile \
69     || die "sed opengl failed"
70     fi
71    
72     if use tcl && use tk; then
73     sed -i -e "s: lex : graphics/mercury_tcltk lex :" Mmakefile \
74     || die "sed tcltk failed"
75     fi
76    
77     if use odbc || use iodbc; then
78     sed -i -e "s:moose:moose odbc:" Mmakefile \
79     || die "sed odbc failed"
80     fi
81    
82     if ! use ncurses; then
83     sed -i -e "s:curs curses::" Mmakefile \
84     || die "sed ncurses failed"
85     fi
86    
87     if ! use xml; then
88     sed -i -e "s:xml::" Mmakefile \
89     || die "sed xml failed"
90     fi
91    
92     sed -i -e "s:@libdir@:$(get_libdir):" \
93     dynamic_linking/Mmakefile posix/Mmakefile \
94     || die "sed libdir failed"
95    
96     # disable broken packages
97     sed -i -e "s:lazy_evaluation::" -e "s:references::" Mmakefile \
98     || die "sed broken packages failed"
99     }
100    
101     src_compile() {
102     # Mercury dependency generation must be run single-threaded
103     mmake \
104     -j1 depend || die "mmake depend failed"
105    
106     mmake \
107     MMAKEFLAGS="${MAKEOPTS}" \
108     EXTRA_MLFLAGS=--no-strip \
109     EXTRA_LDFLAGS="${LDFLAGS}" \
110     EXTRA_LD_LIBFLAGS="${LDFLAGS}" \
111     || die "mmake failed"
112     }
113    
114     src_install() {
115     mmake \
116     MMAKEFLAGS="${MAKEOPTS}" \
117     EXTRA_LD_LIBFLAGS="${LDFLAGS}" \
118     INSTALL_PREFIX="${D}"/usr \
119     install || die "mmake install failed"
120    
121     find "${D}"/usr/$(get_libdir)/mercury -type l | xargs rm
122    
123     cd "${S}"
124     if use examples; then
125     insinto /usr/share/doc/${PF}/samples/base64
126     doins base64/*.m || die
127    
128     insinto /usr/share/doc/${PF}/samples/complex_numbers
129     doins complex_numbers/samples/* || die
130    
131     insinto /usr/share/doc/${PF}/samples/dynamic_linking
132     doins dynamic_linking/hello.m || die
133    
134     insinto /usr/share/doc/${PF}/samples/error
135     doins error/* || die
136    
137     insinto /usr/share/doc/${PF}/samples/fixed
138     doins fixed/*.m || die
139    
140     insinto /usr/share/doc/${PF}/samples/gator
141     doins -r gator/* || die
142    
143     insinto /usr/share/doc/${PF}/samples/lex
144     doins lex/samples/* || die
145    
146     insinto /usr/share/doc/${PF}/samples/log4m
147     doins log4m/*.m || die
148    
149     insinto /usr/share/doc/${PF}/samples/monte
150     doins monte/*.m || die
151    
152     insinto /usr/share/doc/${PF}/samples/moose
153     doins moose/samples/* || die
154    
155     insinto /usr/share/doc/${PF}/samples/net
156     doins net/*.m || die
157    
158     if use ncurses; then
159     insinto /usr/share/doc/${PF}/samples/curs
160     doins curs/samples/* || die
161    
162     insinto /usr/share/doc/${PF}/samples/curses
163     doins curses/sample/* || die
164     fi
165    
166     if use X; then
167     insinto /usr/share/doc/${PF}/samples/graphics
168     doins graphics/easyx/samples/*.m || die
169     fi
170    
171     if use glut && use opengl; then
172     insinto /usr/share/doc/${PF}/samples/graphics
173     doins graphics/samples/calc/* || die
174     doins graphics/samples/gears/* || die
175     doins graphics/samples/maze/* || die
176     doins graphics/samples/pent/* || die
177     fi
178    
179     if use opengl && use tcl && use tk; then
180     insinto /usr/share/doc/${PF}/samples/graphics
181     doins graphics/samples/pent/*.m || die
182     fi
183    
184     if use ssl; then
185     insinto /usr/share/doc/${PF}/samples/mopenssl
186     doins mopenssl/*.m || die
187     fi
188 keri 1.4
189     rm -rf $(find "${D}"/usr/share/doc/${PF}/samples -name CVS)
190 keri 1.1 fi
191    
192     dodoc README || die
193     }

  ViewVC Help
Powered by ViewVC 1.1.20