|
|
| |
src_unpack() { | src_unpack() { |
unpack ${A} | unpack ${A} |
|
epatch ${FILESDIR}/${P}-installpathfix.patch |
cd ${S} | cd ${S} |
elibtoolize --patch-only | elibtoolize --patch-only |
gnuconfig_update | gnuconfig_update |
|
|
if built_with_use sci-libs/hdf szip ; then | if built_with_use sci-libs/hdf szip ; then |
einfo "Found HDF4 compiled with szip. Nice." | einfo "Found HDF4 compiled with szip. Nice." |
else | else |
ewarn "HDF4 must be compiled with szip USE flag!" |
ewarn "HDF4 (sci-libs/hdf) must be compiled with szip USE flag!" |
einfo "Emerge HDF with szip USE flag and then emerge GDAL." | einfo "Emerge HDF with szip USE flag and then emerge GDAL." |
die "HDF4 not merged with szip use flag" | die "HDF4 not merged with szip use flag" |
fi | fi |
|
|
| |
src_compile() { | src_compile() { |
distutils_python_version | distutils_python_version |
# This package uses old borked automake/autoconf and libtool, so |
|
# it doesn't work without ${D} (or with econf and einstall). |
|
|
|
pkg_conf="--prefix=${D}usr --exec-prefix=${D}usr --bindir=${D}usr/bin \ |
|
--datadir=${D}usr/share/gdal --includedir=${D}usr/include/gdal \ |
|
--libdir=${D}usr/$(get_libdir) --mandir=${D}usr/share/man \ |
|
--with-pymoddir=${D}usr/lib/python${PYVER}/site-packages \ |
|
--enable-static=no --enable-shared=yes --with-gnu-ld" |
|
|
|
# the above should make libtool behave for the most part |
|
| |
use_conf="$(use_with jpeg) $(use_with png) $(use_with mysql) \ | use_conf="$(use_with jpeg) $(use_with png) $(use_with mysql) \ |
$(use_with postgres pg) $(use_with fits cfitsio) \ | $(use_with postgres pg) $(use_with fits cfitsio) \ |
|
|
fi | fi |
| |
if useq python ; then | if useq python ; then |
use_conf="--with-pymoddir=${D}usr/lib/python${PYVER}/site-packages \ |
use_conf="--with-pymoddir=/usr/lib/python${PYVER}/site-packages \ |
${use_conf}" | ${use_conf}" |
else | else |
use_conf="--with-python=no ${use_conf}" | use_conf="--with-python=no ${use_conf}" |
fi | fi |
| |
# Fix doc path just in case | # Fix doc path just in case |
sed -i -e "s:@exec_prefix@/doc:${D}usr/share/doc/${PF}/html:g" GDALmake.opt.in |
sed -i -e "s:@exec_prefix@/doc:/usr/share/doc/${PF}/html:g" GDALmake.opt.in |
| |
./configure --with-pymoddir=${D}usr/lib/python${PYVER}/site-packages \ |
econf ${use_conf} || die 'configure failed' |
${pkg_conf} ${use_conf} |
|
| |
# Patch libtool here since it's not created until after configure runs |
|
sed -i -e "s:hardcode_into_libs=yes:hardcode_into_libs=no:g" libtool |
|
echo '#undef GDAL_PREFIX' >> port/cpl_config.h |
|
echo '#define GDAL_PREFIX "/usr"' >> port/cpl_config.h |
|
emake || die "emake failed" | emake || die "emake failed" |
if useq doc ; then | if useq doc ; then |
emake docs || die "emake docs failed" | emake docs || die "emake docs failed" |
|
|
src_install() { | src_install() { |
# einstall causes sandbox violations on /usr/lib/libgdal.so | # einstall causes sandbox violations on /usr/lib/libgdal.so |
make DESTDIR=${D} install || die "make install failed" | make DESTDIR=${D} install || die "make install failed" |
dosed "s:${D}usr:/usr:g" /usr/bin/gdal-config |
|
dosed "s:/usr/local/bin/perl:/usr/bin/perl:g" ${S}/Doxyfile.man |
|
dosed "s:$(INST_DOCS)/gdal:$(INST_DOCS)/html:g" GNUmakefile |
|
dodoc Doxyfile.man Doxyfile HOWTO-RELEASE NEWS | dodoc Doxyfile.man Doxyfile HOWTO-RELEASE NEWS |
if useq doc ; then | if useq doc ; then |
dohtml html/*.* || die "install html failed" | dohtml html/*.* || die "install html failed" |