3 |
3 |
|
4 |
4 |
EAPI=7
|
5 |
5 |
|
6 |
|
MY_DOC="userg_revQ"
|
7 |
|
inherit autotools desktop flag-o-matic
|
|
6 |
inherit autotools desktop flag-o-matic udev xdg-utils
|
8 |
7 |
|
9 |
|
# HINTS:
|
10 |
|
# -> non-free modules are x86 and amd64 only
|
11 |
|
# -> iscan frontend needs non-free modules
|
12 |
|
# -> sane-epkowa should be usable on every arch
|
13 |
|
# -> ${P}-${SRC_REV}.tar.gz (for gcc 3.2/3.3)
|
14 |
|
# -> ${P}-${SRC_REV}.c2.tar.gz (for gcc 3.4 or later)
|
15 |
|
|
16 |
|
# FIXME:
|
17 |
|
# iscan doesn't compile w/o libusb, this should be fixed somehow.
|
18 |
|
|
19 |
|
# TODO:
|
20 |
|
# (re)add closed-source binary modules which are needed for some scanners.
|
21 |
|
|
22 |
|
DESCRIPTION="EPSON Image Scan! for Linux (including sane-epkowa backend)"
|
23 |
|
HOMEPAGE="http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX"
|
24 |
|
SRC_URI="http://support.epson.net/linux/src/scanner/iscan/${PN}_$(ver_rs 3 -).tar.gz
|
25 |
|
doc? (
|
26 |
|
https://dev.gentoo.org/~flameeyes/avasys/${MY_DOC}_e.pdf
|
27 |
|
l10n_ja? ( https://dev.gentoo.org/~flameeyes/avasys/${MY_DOC}_j.pdf )
|
28 |
|
)"
|
|
8 |
DESCRIPTION="EPSON Image Scan v3 for Linux"
|
|
9 |
HOMEPAGE="https://support.epson.net/linux/en/imagescanv3.php https://gitlab.com/utsushi/utsushi"
|
|
10 |
SRC_URI="https://support.epson.net/linux/src/scanner/imagescanv3/common/imagescan_${PV}.orig.tar.gz"
|
29 |
11 |
|
30 |
|
LICENSE="GPL-2 AVASYS"
|
|
12 |
LICENSE="GPL-3+"
|
31 |
13 |
SLOT="0"
|
32 |
|
KEYWORDS="amd64 x86"
|
33 |
|
IUSE="doc gimp l10n_ja nls X"
|
|
14 |
IUSE="graphicsmagick gui test"
|
|
15 |
KEYWORDS="~amd64 ~x86"
|
34 |
16 |
|
35 |
|
REQUIRED_USE="gimp? ( X )"
|
36 |
|
|
37 |
|
DEPEND="
|
38 |
|
dev-libs/libxml2:2
|
39 |
|
media-gfx/sane-backends
|
40 |
|
virtual/libusb:1
|
41 |
|
virtual/udev
|
42 |
|
gimp? ( media-gfx/gimp:0/2 )
|
43 |
|
X? (
|
44 |
|
dev-libs/glib:2
|
45 |
|
media-libs/libjpeg-turbo:=
|
46 |
|
media-libs/libpng:=
|
47 |
|
media-libs/tiff:=
|
48 |
|
x11-libs/gtk+:2
|
49 |
|
)
|
50 |
|
"
|
51 |
|
RDEPEND="${DEPEND}
|
52 |
|
media-gfx/iscan-data
|
53 |
|
"
|
|
17 |
# Disable opencl as during reorient.utr test it produces inconsistent results
|
54 |
18 |
BDEPEND="
|
55 |
19 |
virtual/pkgconfig
|
56 |
|
nls? ( sys-devel/gettext )
|
|
20 |
test? (
|
|
21 |
app-text/tesseract[png,tiff,training,-opencl]
|
|
22 |
dev-util/uncrustify
|
|
23 |
media-fonts/dejavu
|
|
24 |
virtual/imagemagick-tools[png,tiff]
|
|
25 |
)
|
57 |
26 |
"
|
58 |
|
# Upstream ships broken sanity test
|
59 |
|
RESTRICT="test"
|
60 |
|
|
61 |
|
S="${WORKDIR}/${PN}-$(ver_cut 1-3)"
|
62 |
|
|
63 |
|
DOCS=( AUTHORS NEWS README )
|
|
27 |
RDEPEND="
|
|
28 |
dev-libs/boost:=
|
|
29 |
media-gfx/sane-backends
|
|
30 |
media-libs/libjpeg-turbo:=
|
|
31 |
media-libs/tiff:=
|
|
32 |
virtual/libusb:1
|
|
33 |
graphicsmagick? ( media-gfx/graphicsmagick:=[cxx] )
|
|
34 |
!graphicsmagick? ( media-gfx/imagemagick:=[cxx] )
|
|
35 |
gui? ( dev-cpp/gtkmm:2.4 )
|
|
36 |
"
|
|
37 |
DEPEND="${RDEPEND}"
|
|
38 |
RESTRICT="!test? ( test )"
|
|
39 |
S="${WORKDIR}/utsushi-0.$(ver_cut 2-3)"
|
64 |
40 |
|
65 |
41 |
PATCHES=(
|
66 |
|
"${FILESDIR}"/iscan-2.29.1-drop-ltdl.patch
|
67 |
|
"${FILESDIR}"/iscan-2.28.1.3+libpng-1.5.patch
|
68 |
|
"${FILESDIR}"/iscan-2.29.1-png-libs.patch
|
69 |
|
"${FILESDIR}"/iscan-2.30.1-fix-g++-test.patch
|
70 |
|
"${FILESDIR}"/iscan-2.30.1.1-gcc6.patch
|
71 |
|
"${FILESDIR}"/iscan-2.30.3.1-fix-x86-unknown-types.patch
|
72 |
|
"${FILESDIR}"/iscan-2.30.4.2-sscanf.patch
|
73 |
|
"${FILESDIR}"/iscan-2.30.4.2-c99.patch
|
|
42 |
"${FILESDIR}"/${PN}-3.61.0-ijg-libjpeg.patch
|
|
43 |
"${FILESDIR}"/${PN}-3.61.0-imagemagick-7.patch
|
|
44 |
"${FILESDIR}"/${PN}-3.62.0-gcc-10.patch
|
|
45 |
"${FILESDIR}"/${PN}-3.62.0-boost-1.73.patch
|
|
46 |
"${FILESDIR}"/${PN}-3.62.0-fix-symbols.patch
|
|
47 |
"${FILESDIR}"/${PN}-3.62.0-tests-boost.patch
|
|
48 |
"${FILESDIR}"/${PN}-3.62.0-tests-tesseract.patch
|
|
49 |
"${FILESDIR}"/${PN}-3.62.0-tests-linkage.patch
|
|
50 |
"${FILESDIR}"/${PN}-3.63.0-autoconf-2.70.patch
|
|
51 |
"${FILESDIR}"/${PN}-3.65.0-sane-backends-1.1.patch
|
74 |
52 |
)
|
75 |
53 |
|
76 |
|
QA_PRESTRIPPED="usr/lib.*/libesmod.so.*"
|
77 |
|
QA_TEXTRELS="${QA_PRESTRIPPED}"
|
78 |
|
QA_FLAGS_IGNORED="${QA_PRESTRIPPED}"
|
79 |
|
|
80 |
54 |
src_prepare() {
|
81 |
55 |
default
|
82 |
56 |
|
83 |
|
if ! use X; then
|
84 |
|
sed -i -e "s:PKG_CHECK_MODULES(GTK,.*):AC_DEFINE([HAVE_GTK_2], 0):g" \
|
85 |
|
-e "s:\(PKG_CHECK_MODULES(GDK_IMLIB,.*)\):#\1:g" configure.ac || die
|
86 |
|
fi
|
87 |
|
|
|
57 |
# Remove vendored libraries
|
|
58 |
rm -r upstream/boost || die
|
|
59 |
# Workaround for deprecation warnings:
|
|
60 |
# https://gitlab.com/utsushi/utsushi/issues/90
|
|
61 |
sed -e 's|=-Werror|="-Werror -Wno-error=deprecated-declarations"|g' -i configure.ac || die
|
|
62 |
# Disable check-soname test
|
|
63 |
sed -e '/SANE_BACKEND_SANITY_CHECKS +=/d' -i sane/Makefile.am || die
|
88 |
64 |
eautoreconf
|
89 |
65 |
}
|
90 |
66 |
|
91 |
67 |
src_configure() {
|
92 |
|
append-cppflags -D_GNU_SOURCE # needed for 'strndup'
|
93 |
|
replace-flags "-O[0-9s]" "-O1" # fix selector box bug 388073
|
94 |
|
|
95 |
|
local myeconfargs=(
|
96 |
|
--enable-dependency-reduction
|
97 |
|
--disable-static
|
98 |
|
$(use_enable nls)
|
99 |
|
$(use_enable gimp)
|
100 |
|
$(use_enable X frontend)
|
101 |
|
$(use_enable X jpeg)
|
102 |
|
$(use_enable X png)
|
103 |
|
$(use_enable X tiff)
|
|
68 |
# Workaround for:
|
|
69 |
# /usr/lib64/utsushi/libutsushi.so.0: undefined symbol: libcnx_usb_LTX_factory
|
|
70 |
append-ldflags $(no-as-needed)
|
|
71 |
# https://bugs.gentoo.org/720994
|
|
72 |
append-ldflags -pthread
|
|
73 |
local myconf=(
|
|
74 |
$(use_with gui gtkmm)
|
|
75 |
--enable-sane-config
|
|
76 |
--enable-udev-config
|
|
77 |
--with-boost=yes
|
|
78 |
--with-jpeg
|
|
79 |
--with-magick=$(usex graphicsmagick GraphicsMagick ImageMagick)
|
|
80 |
--with-magick-pp=$(usex graphicsmagick GraphicsMagick ImageMagick)
|
|
81 |
--with-sane
|
|
82 |
--with-tiff
|
|
83 |
--with-udev-confdir="$(get_udevdir)"
|
104 |
84 |
)
|
105 |
|
econf "${myeconfargs[@]}"
|
|
85 |
econf "${myconf[@]}"
|
106 |
86 |
}
|
107 |
87 |
|
108 |
88 |
src_install() {
|
109 |
|
use l10n_ja && DOCS+=( {NEWS,README}.ja )
|
110 |
|
use doc && DOCS+=( "${DISTDIR}/${MY_DOC}_$(usex l10n_ja j e).pdf" )
|
111 |
89 |
default
|
112 |
|
|
113 |
|
# install sane config
|
114 |
|
insinto /etc/sane.d
|
115 |
|
doins backend/epkowa.conf
|
116 |
|
|
117 |
|
# link iscan so it is seen as a plugin in gimp
|
118 |
|
local gimpplugindir
|
119 |
|
local gimptool
|
120 |
|
if use gimp; then
|
121 |
|
for gimptool in gimptool gimptool-2.0; do
|
122 |
|
if [[ -x /usr/bin/${gimptool} ]]; then
|
123 |
|
einfo "Setting plugin link for GIMP version $(/usr/bin/${gimptool} --version)"
|
124 |
|
gimpplugindir=$(/usr/bin/${gimptool} --gimpplugindir)/plug-ins
|
125 |
|
break
|
126 |
|
fi
|
127 |
|
done
|
128 |
|
if [[ "/plug-ins" != "${gimpplugindir}" ]]; then
|
129 |
|
dodir ${gimpplugindir}
|
130 |
|
dosym ../../../../bin/iscan "${gimpplugindir}"/iscan
|
131 |
|
else
|
132 |
|
ewarn "No idea where to find the gimp plugin directory"
|
133 |
|
fi
|
|
90 |
dodoc lib/devices.conf
|
|
91 |
find "${ED}" -name '*.la' -delete || die
|
|
92 |
if use gui; then
|
|
93 |
newicon -s scalable doc/icon.svg "${PN}".svg
|
|
94 |
make_desktop_entry utsushi "Image Scan"
|
134 |
95 |
fi
|
135 |
|
|
136 |
|
use X && make_desktop_entry iscan "Image Scan! for Linux ${PV}" scanner
|
137 |
96 |
}
|
138 |
97 |
|
139 |
98 |
pkg_postinst() {
|
140 |
|
local DLL_CONF="${EPREFIX}/etc/sane.d/dll.conf"
|
141 |
|
local EPKOWA_CONF="${EPREFIX}/etc/sane.d/epkowa.conf"
|
|
99 |
udev_reload
|
|
100 |
use gui && xdg_icon_cache_update
|
|
101 |
elog "If you encounter problems with media-gfx/xsane when scanning (e.g., bad resolution),"
|
|
102 |
elog "please try the built-in GUI and kde-misc/skanlite first before reporting bugs."
|
|
103 |
}
|
142 |
104 |
|
143 |
|
if grep -q "^[ \t]*\<epkowa\>" ${DLL_CONF}; then
|
144 |
|
elog "Please edit ${EPKOWA_CONF} to suit your needs."
|
145 |
|
elif grep -q "\<epkowa\>" ${DLL_CONF}; then
|
146 |
|
elog "Hint: to enable the backend, add 'epkowa' to ${DLL_CONF}"
|
147 |
|
elog "Then edit ${EPKOWA_CONF} to suit your needs."
|
148 |
|
else
|
149 |
|
echo "epkowa" >> ${DLL_CONF} || die
|
150 |
|
elog "A new entry 'epkowa' was added to ${DLL_CONF}"
|
151 |
|
elog "Please edit ${EPKOWA_CONF} to suit your needs."
|
152 |
|
fi
|
|
105 |
pkg_postrm() {
|
|
106 |
udev_reload
|
|
107 |
use gui && xdg_icon_cache_update
|
153 |
108 |
}
|