/[gentoo-x86]/sci-geosciences/grass/grass-6.2.1.ebuild
Gentoo

Contents of /sci-geosciences/grass/grass-6.2.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (show annotations) (download)
Tue May 4 10:52:10 2010 UTC (9 years, 9 months ago) by scarabeus
Branch: MAIN
CVS Tags: HEAD
Changes since 1.15: +1 -1 lines
FILE REMOVED
Update install approach. Install .pc file. Drop old.
(Portage version: 2.2_rc67/cvs/Linux x86_64)

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-geosciences/grass/grass-6.2.1.ebuild,v 1.15 2008/12/19 05:57:29 nerdboy Exp $
4
5 inherit eutils libtool
6
7 DESCRIPTION="An open-source GIS with raster and vector functionality, as well as 3D vizualization."
8 HOMEPAGE="http://grass.itc.it/"
9 SRC_URI="http://grass.itc.it/grass62/source/${P}.tar.gz"
10
11 LICENSE="GPL-2"
12 SLOT="6"
13 KEYWORDS="amd64 ppc sparc x86"
14 # To-do: get ppc64 gdal deps fixed up
15
16 IUSE="ffmpeg fftw gmath jpeg largefile motif mysql nls odbc opengl png \
17 postgres python readline sqlite tiff truetype X"
18
19 RESTRICT="strip"
20
21 RDEPEND=">=sys-libs/zlib-1.1.4
22 >=sys-libs/ncurses-5.3
23 >=sys-libs/gdbm-1.8.0
24 || (
25 sys-apps/man
26 sys-apps/man-db )
27 sci-libs/gdal
28 >=sci-libs/proj-4.4.7
29 ffmpeg? ( media-video/ffmpeg )
30 fftw? ( sci-libs/fftw )
31 gmath? ( virtual/blas
32 virtual/lapack )
33 jpeg? ( media-libs/jpeg )
34 motif? ( x11-libs/openmotif )
35 mysql? ( dev-db/mysql )
36 odbc? ( >=dev-db/unixODBC-2.0.6 )
37 opengl? ( virtual/opengl )
38 png? ( >=media-libs/libpng-1.2.2 )
39 postgres? ( >=virtual/postgresql-base-7.3 )
40 python? ( dev-lang/python )
41 readline? ( sys-libs/readline )
42 sqlite? ( dev-db/sqlite )
43 tiff? ( >=media-libs/tiff-3.5.7 )
44 truetype? ( >=media-libs/freetype-2.0 )
45 X? (
46 x11-libs/libXmu
47 x11-libs/libXext
48 x11-libs/libXp
49 x11-libs/libX11
50 x11-libs/libXt
51 x11-libs/libSM
52 x11-libs/libICE
53 x11-libs/libXpm
54 x11-libs/libXaw
55 >=dev-lang/tcl-8.4
56 >=dev-lang/tk-8.4
57 )"
58
59 DEPEND="${RDEPEND}
60 >=sys-devel/flex-2.5.4a
61 >=sys-devel/bison-1.35
62 X? (
63 x11-proto/xproto
64 x11-proto/xextproto
65 )"
66
67 pkg_setup() {
68 local myblas
69 if use gmath; then
70 for d in $(eselect lapack show); do myblas=${d}; done
71 if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
72 ewarn "You need to set lapack to atlas or reference. Do:"
73 ewarn " eselect lapack set <impl>"
74 ewarn "where <impl> is atlas, threaded-atlas or reference"
75 die "setup failed"
76 fi
77 for d in $(eselect blas show); do myblas=${d}; done
78 if [[ -z "${myblas/reference/}" ]] && [[ -z "${myblas/atlas/}" ]]; then
79 ewarn "You need to set blas to atlas or reference. Do:"
80 ewarn " eselect blas set <impl>"
81 ewarn "where <impl> is atlas, threaded-atlas or reference"
82 die "setup failed"
83 fi
84 fi
85
86 if use opengl && ! use X; then
87 ewarn "GRASS OpenGL support needs X (will also pull in Tcl/Tk)."
88 die "Please set the X useflag."
89 fi
90 }
91
92 src_unpack() {
93 unpack ${A}
94 cd "${S}"
95
96 use ffmpeg && epatch "${FILESDIR}"/${P}-ffmpeg-fix.patch
97 epatch "${FILESDIR}"/${P}-gcc43.patch
98 epatch rpm/fedora/grass-readline.patch
99
100 elibtoolize
101
102 # patch missing math functions (yes, this is still needed)
103 sed -i -e "s:\$(EXTRA_LIBS):\$(EXTRA_LIBS) \$(MATHLIB):g" include/Make/Shlib.make
104 echo "MATHLIB=-lm" >> include/Make/Rules.make
105 }
106
107 src_compile() {
108 local myconf
109 myconf="--prefix=/usr --with-cxx --enable-shared \
110 --with-gdal=$(type -P gdal-config) --with-curses --with-proj \
111 --with-includes=/usr/include --with-libs=/usr/$(get_libdir) \
112 --with-proj-includes=/usr/include \
113 --with-proj-libs=/usr/$(get_libdir) \
114 --with-proj-share=/usr/share/proj \
115 --without-glw --without-wxwidgets"
116 if use X; then
117 if has_version ">=dev-lang/tcl-8.5"; then
118 TCL_LIBDIR="/usr/$(get_libdir)/tcl8.5"
119 else
120 TCL_LIBDIR="/usr/$(get_libdir)/tcl8.4"
121 fi
122 myconf="${myconf} --with-tcltk --with-x \
123 --with-tcltk-includes=/usr/include \
124 --with-tcltk-libs=${TCL_LIBDIR}"
125 else
126 myconf="${myconf} --without-tcltk --without-x"
127 fi
128
129 if use opengl; then
130 epatch "${FILESDIR}"/${P}-html-nviz-fix.patch
131 myconf="${myconf} --with-opengl --with-opengl-libs=/usr/$(get_libdir)/opengl/xorg-x11/lib"
132 else
133 epatch "${FILESDIR}"/${P}-html-nonviz.patch
134 myconf="${myconf} --without-opengl --without-glw"
135 fi
136
137 # Should handle either older or latest without intervention;
138 # this won't work forever, but it should be okay for a while...
139 if use ffmpeg; then
140 myconf="${myconf} --with-ffmpeg \
141 --with-ffmpeg-libs=/usr/$(get_libdir)"
142 if has_version ">=media-video/ffmpeg-0.4.9_p20080326" ; then
143 # must pass multiple include dirs now; if anyone has a better
144 # way to do this, please speak up and file a bug :)
145 myconf="${myconf} --with-ffmpeg-includes=/usr/include/libav*"
146 else
147 myconf="${myconf} --with-ffmpeg-includes=/usr/include/ffmpeg"
148 fi
149 else
150 myconf="${myconf} --without-ffmpeg"
151 fi
152
153 if use truetype; then
154 myconf="${myconf} --with-freetype --with-freetype-includes=/usr/include/freetype2"
155 fi
156
157 if use mysql; then
158 myconf="${myconf} --with-mysql --with-mysql-includes=/usr/include/mysql \
159 --with-mysql-libs=/usr/$(get_libdir)/mysql"
160 else
161 myconf="${myconf} --without-mysql"
162 fi
163
164 if use sqlite; then
165 myconf="${myconf} --with-sqlite --with-sqlite-includes=/usr/include
166 --with-sqlite-libs=/usr/lib"
167 else
168 myconf="${myconf} --without-sqlite"
169 fi
170
171 #export LD_LIBRARY_PATH="/${WORKDIR}/image/usr/${P}/$(get_libdir):${LD_LIBRARY_PATH}"
172 econf ${myconf} --with-libs=/usr/$(get_libdir) \
173 $(use_enable amd64 64bit) \
174 $(use_with fftw) \
175 $(use_with jpeg) \
176 $(use_enable largefile) \
177 $(use_with motif) \
178 $(use_with nls) \
179 $(use_with odbc) \
180 $(use_with png) \
181 $(use_with postgres) \
182 $(use_with python) \
183 $(use_with readline) \
184 $(use_with tiff) || die "configure failed!"
185
186 emake -j1 || die "emake failed!"
187 }
188
189 src_install() {
190 make install UNIX_BIN="${D}"usr/bin BINDIR="${D}"usr/bin \
191 PREFIX="${D}"usr INST_DIR="${D}"usr/grass62 \
192 || die "make install failed!"
193
194 sed -i -e "s:^GISBASE=.*$:GISBASE=/usr/grass62:" \
195 "${D}"usr/bin/grass62 || die "sed failed!"
196
197 # Grass Extension Manager conflicts with ruby gems
198 mv "${D}"usr/bin/gem "${D}"usr/grass62/bin/
199
200 einfo "Adding env.d entry for Grass6"
201 newenvd "${FILESDIR}"/99grass-6.2 99grass-6
202 }

  ViewVC Help
Powered by ViewVC 1.1.20