2015-11-23 10:32:16 +03:00
|
|
|
# Copyright 1999-2015 Gentoo Foundation
|
2011-11-09 11:33:19 +04:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
2015-08-10 23:59:40 +03:00
|
|
|
# $Id$
|
2011-11-09 11:33:19 +04:00
|
|
|
|
2014-08-02 16:51:42 +04:00
|
|
|
EAPI=5
|
|
|
|
inherit autotools eutils toolchain-funcs
|
2011-11-09 11:33:19 +04:00
|
|
|
|
|
|
|
DESCRIPTION="graphical scanning frontend"
|
|
|
|
HOMEPAGE="http://www.xsane.org/"
|
2014-08-02 16:51:42 +04:00
|
|
|
SRC_URI="
|
|
|
|
http://www.xsane.org/download/${P}.tar.gz
|
2015-08-24 15:02:01 +03:00
|
|
|
https://dev.gentoo.org/~dilfridge/distfiles/${PN}-0.998-patches-2.tar.xz
|
2014-08-02 16:51:42 +04:00
|
|
|
"
|
2011-11-09 11:33:19 +04:00
|
|
|
|
|
|
|
LICENSE="GPL-2"
|
|
|
|
SLOT="0"
|
2015-11-23 10:32:16 +03:00
|
|
|
KEYWORDS="alpha amd64 arm ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
|
2012-02-08 10:13:10 +04:00
|
|
|
IUSE="nls jpeg png tiff gimp lcms ocr"
|
2011-11-09 11:33:19 +04:00
|
|
|
|
2014-08-02 16:51:42 +04:00
|
|
|
RDEPEND="
|
|
|
|
media-gfx/sane-backends
|
2011-11-09 11:33:19 +04:00
|
|
|
x11-libs/gtk+:2
|
2012-02-08 10:13:10 +04:00
|
|
|
x11-misc/xdg-utils
|
2011-11-09 11:33:19 +04:00
|
|
|
jpeg? ( virtual/jpeg )
|
|
|
|
png? ( media-libs/libpng )
|
|
|
|
tiff? ( media-libs/tiff )
|
|
|
|
gimp? ( media-gfx/gimp )
|
2014-08-02 16:51:42 +04:00
|
|
|
lcms? ( media-libs/lcms:2 )
|
|
|
|
"
|
2012-02-08 10:13:10 +04:00
|
|
|
|
|
|
|
PDEPEND="ocr? ( app-text/gocr )"
|
2011-11-09 11:33:19 +04:00
|
|
|
|
|
|
|
DEPEND="${RDEPEND}
|
2014-08-02 16:51:42 +04:00
|
|
|
app-arch/xz-utils
|
|
|
|
virtual/pkgconfig
|
|
|
|
"
|
2011-11-09 11:33:19 +04:00
|
|
|
|
2012-02-08 10:13:10 +04:00
|
|
|
src_prepare() {
|
|
|
|
# Apply multiple fixes from different distributions
|
2014-08-02 16:51:42 +04:00
|
|
|
# Drop included patch and reuse patchset from prior version
|
|
|
|
rm "${WORKDIR}/${PN}-0.998-patches-2"/005-update-param-crash.patch || die
|
|
|
|
epatch "${WORKDIR}/${PN}-0.998-patches-2"/*.patch
|
2012-02-08 10:13:10 +04:00
|
|
|
|
|
|
|
# Fix compability with libpng15 wrt #377363
|
|
|
|
sed -i -e 's:png_ptr->jmpbuf:png_jmpbuf(png_ptr):' src/xsane-save.c || die
|
2012-11-12 00:10:44 +04:00
|
|
|
|
|
|
|
# Fix AR calling directly (bug #442606)
|
|
|
|
sed -i -e 's:ar r:$(AR) r:' lib/Makefile.in || die
|
|
|
|
tc-export AR
|
2014-08-02 16:51:42 +04:00
|
|
|
|
|
|
|
# Add support for lcms-2 (from Fedora)
|
|
|
|
epatch "${FILESDIR}/${PN}-0.999-lcms2.patch"
|
|
|
|
AT_M4DIR="m4" eautoreconf
|
2011-11-09 11:33:19 +04:00
|
|
|
}
|
|
|
|
|
2012-02-08 10:13:10 +04:00
|
|
|
src_configure() {
|
2014-08-02 16:51:42 +04:00
|
|
|
econf \
|
|
|
|
--enable-gtk2 \
|
2011-11-09 11:33:19 +04:00
|
|
|
$(use_enable nls) \
|
|
|
|
$(use_enable jpeg) \
|
|
|
|
$(use_enable png) \
|
|
|
|
$(use_enable tiff) \
|
|
|
|
$(use_enable gimp) \
|
2012-02-08 10:13:10 +04:00
|
|
|
$(use_enable lcms)
|
2011-11-09 11:33:19 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
2014-08-02 16:51:42 +04:00
|
|
|
default
|
|
|
|
|
2011-11-09 11:33:19 +04:00
|
|
|
dodoc xsane.*
|
2012-02-08 10:13:10 +04:00
|
|
|
|
2011-11-09 11:33:19 +04:00
|
|
|
# link xsane so it is seen as a plugin in gimp
|
|
|
|
if use gimp; then
|
|
|
|
local plugindir
|
2012-08-22 10:20:09 +04:00
|
|
|
if [ -x "${EPREFIX}"/usr/bin/gimptool ]; then
|
2011-11-09 11:33:19 +04:00
|
|
|
plugindir="$(gimptool --gimpplugindir)/plug-ins"
|
2012-08-22 10:20:09 +04:00
|
|
|
elif [ -x "${EPREFIX}"/usr/bin/gimptool-2.0 ]; then
|
2011-11-09 11:33:19 +04:00
|
|
|
plugindir="$(gimptool-2.0 --gimpplugindir)/plug-ins"
|
|
|
|
else
|
|
|
|
die "Can't find GIMP plugin directory."
|
|
|
|
fi
|
2012-08-22 10:20:09 +04:00
|
|
|
dodir "${plugindir#${EPREFIX}}"
|
2012-11-12 00:10:44 +04:00
|
|
|
dosym /usr/bin/xsane "${plugindir#${EPREFIX}}"/xsane
|
2011-11-09 11:33:19 +04:00
|
|
|
fi
|
2012-02-08 10:13:10 +04:00
|
|
|
|
2011-11-09 11:33:19 +04:00
|
|
|
newicon src/xsane-48x48.png ${PN}.png
|
|
|
|
}
|