1 # Copyright 1999-2021 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 # Changelog since last bugzilla upload
7 # updated to use cnijfilter-common-2.80 2008-01-12 by Victor Mataré
9 # 2010-03-19 GuS Version 3.20-r1
10 # Replaced dependency of non-existing dev-libs/libxml with
11 # dependency of >=dev-libs/libxml2-2.7.3-r2.
13 # 2010-03-20 GuS Version 3.20-r2
14 # Replaced dependency of non-existing virtual/ghostscript with
15 # dependency of app-text/ghostscript-gpl.
18 inherit eutils flag-o-matic autotools multilib
20 DESCRIPTION
="Canon InkJet Scanner Driver and ScanGear MP for Linux (Pixus/Pixma-Series)."
21 HOMEPAGE
="http://support-au.canon.com.au/contents/AU/EN/0100303302.html"
22 RESTRICT
="nomirror confcache"
24 SRC_URI
="http://gdlp01.c-wss.com/gds/3/0100003033/01/scangearmp-source-1.60-1.tar.gz"
25 LICENSE
="UNKNOWN" # GPL-2 source and proprietary binaries
38 DEPEND
=">=dev-libs/libusb-0.1.12-r5
39 >=media-libs/libpng-1.2.44
40 >=media-gfx/gimp-2.6.8
41 >=x11-libs/gtk+-2.20.1-r1
42 >=media-gfx/sane-backends-1.0.19-r2"
44 # Arrays of supported Printers, there IDs and compatible models
45 _pruse
=("mp250" "mp280" "mp495" "mg5100" "mg5200" "mg6100" "mg8100")
46 _prname
=(${_pruse[@]})
47 _prid
=("356" "370" "369" "373" "374" "376" "377")
48 _prcomp
=("mp250series" "mp280series" "mp495series" "mg5100series" "mg5200series" "mg6100series" "mg8100series")
49 _max
=$
((${#_pruse[@]}-1)) # used for iterating through these arrays
52 # Standard Ebuild-functions
57 mv "${PN}-source-${PV}-1" "${P}" || die
# Correcting directory-structure
61 if [ -z "$LINGUAS" ]; then # -z tests to see if the argument is empty
62 ewarn
"You didn't specify 'LINGUAS' in your make.conf. Assuming"
63 ewarn
"English localisation, i.e. 'LINGUAS=\"en\"'."
68 _bindir
="${_prefix}/bin"
69 _libdir
="/usr/$(get_libdir)" # either lib or lib32
70 _gimpdir
="${_libdir}/gimp/2.0/plug-ins"
71 _udevdir
="/etc/udev/rules.d"
74 einfo
" USE-flags\t(description / probably compatible printers)"
76 einfo
" amd64\t(basic support for this architecture)"
77 einfo
" usb\t(connected using usb)"
79 for i
in `seq 0 ${_max}`; do
80 einfo
" ${_pruse[$i]}\t${_prcomp[$i]}"
81 if (use
${_pruse[$i]}); then
86 if (${_autochoose}); then
87 ewarn
"You didn't specify any driver model (set it's USE-flag)."
89 einfo
"As example:\tbasic MP140 support without maintenance tools"
90 einfo
"\t\t -> USE=\"mp140\""
92 einfo
"Press Ctrl+C to abort"
97 while [[ $n -gt 0 ]]; do
98 echo -en " Waiting $n seconds...\r"
108 sed -i 's/Z_BEST_SPEED/\ 1\ /g' src
/scanfile.c
110 ( cd src
&& epatch
"${FILESDIR}/fixcompile.patch" )
120 LDFLAGS
="-L$(pwd)/../com/libs_bin32"
121 elif use amd64
; then
122 LDFLAGS
="-L$(pwd)/../com/libs_bin64"
124 die
"not supported arch"
127 econf LDFLAGS
="${LDFLAGS}"
134 make || die
"Couldn't make scangearmp"
140 mkdir
-p "${D}${_bindir}" || die
141 mkdir
-p "${D}${_libdir}/bjlib" || die
143 mkdir
-p "${D}${_udevdir}" || die
147 make DESTDIR
="${D}" install || die
"Couldn't make install scangearmp"
151 for i
in $
(seq 0 ${_max}); do
152 if use
${_pruse[$i]} ||
${_autochoose}; then
153 _pr
=${_prname[$i]} _prid
=${_prid[$i]}
158 rm -f "{$D}${_libdir}"/*.1a
"{$D}${_libdir}"/*.a || die
160 # make symbolic link for gimp-plug-in
161 if [ -d "${_gimpdir}" ]; then
162 mkdir
-p "${D}${_gimpdir}" || die
163 dosym
"${_bindir}/scangearmp" "${_gimpdir}/scangearmp" || die
167 cp -a "${_prid}"/libs_bin32/* "${D}${_libdir}" || die
168 cp -a com
/libs_bin32
/* "${D}${_libdir}" || die
170 cp -a ${_prid}/libs_bin64/* "${D}${_libdir}" || die
171 cp -a com/libs_bin64/* "${D}${_libdir}" || die
173 cp -a "${_prid}"/*.DAT "${D}${_libdir}"/bjlib || die
174 cp -a "${_prid}"/*.tbl "${D}${_libdir}"/bjlib || die
175 cp com/ini/canon_mfp_net.ini "${D}${_libdir}"/bjlib || die
176 chmod 644 "${D}${_libdir}"/bjlib/* || die
177 chmod 666 "${D}${_libdir}"/bjlib/canon_mfp_net.ini || die
181 cp -a scangearmp/etc/80-canon_mfp.rules "${D}${_udevdir}" || die
182 chmod 644 "${D}${_udevdir}/80-canon_mfp.rules
" || die
188 if [ -x /sbin/udevadm ]; then
190 einfo "Reloading usb rules...
"
191 /sbin/udevadm control --reload-rules 2> /dev/null
192 /sbin/udevadm trigger --action=add --subsystem-match=usb 2>/dev/null
195 einfo "Please
, reload usb rules manually.
"
200 einfo "If you experience any problems
, please visit
:"
201 einfo " http
://forums.gentoo.org
/viewtopic-p-3217721.html
"