-------- Original Message --------
Subject: Re: Interest in Sane or LibUSB
From: Richard W.M. Jones <rjones(a)redhat.com>
To: Fedora MinGW (Windows cross-compiler) project
<fedora-mingw(a)lists.fedoraproject.org>
Date: 03/24/2009 03:34 PM
Yes to both. Hans Niederman (ndim on #fedora-mingw) already took a
look at libusb-win32.
Attached. Upstream already has the sane patches. I had to add some
#undefs for u_char, u_long, and u_int for Fedora as I was getting
conflicts with the winsock(2).h defines. It seems MinGW in Fedora is
adding them, but I don't see them in any system header.
BSOD from userspace??
Yes, isn't Vista grand? ;) This is widely reported by Vista users[1] and
affects an in-house Vista machine with me.
Probably best to file a bug against the native Fedora package if you
want it to be updated.
Since libusb-0.1.x is deprecated, I doubt we'll see fixes for this
issue. I'm not sure if all packages relying on libusb in Fedora are
ready for libusb-1.0 as it is an ABI change. However, there is a
libusb-compat-0.1 package to make the transition easy. I haven't tried
compiling libusb-1.0 in MinGW yet though. I haven't found anyone who has
so I'm not sure how well it will compile. When more free time comes up
I'll attempt a build.
[1]
http://www.shaddihasan.com/blog/2008/11/09/lejos-libusb-win32-vista-and-u...
%define __strip %{_mingw32_strip}
%define __objdump %{_mingw32_objdump}
%define _use_internal_dependency_generator 0
%define __find_requires %{_mingw32_findrequires}
%define __find_provides %{_mingw32_findprovides}
Name: mingw32-libusb-win32
Version: 0.1.12.1
Release: 1%{?dist}
Summary: A library which allows userspace access to USB devices
License: LGPLv2+
Group: System Environment/Libraries
URL:
http://libusb-win32.sourceforge.net/
Source0:
http://download.sourceforge.net/libusb-win32/libusb-win32-src-%{version}....
Patch0: mingw32-libusb-win32.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: mingw32-filesystem >= 33
BuildRequires: mingw32-gcc
BuildRequires: mingw32-binutils
BuildRequires: autoconf, automake, libtool
%description
This package provides a way for applications to access USB devices.
%prep
%setup -q -n libusb-win32-src-%{version}
%patch0 -p0
chmod -x COPYING_GPL.txt
chmod -x COPYING_LGPL.txt
%build
host_prefix=%{_mingw32_target} \
make
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_mingw32_bindir}
mkdir -p $RPM_BUILD_ROOT/%{_mingw32_libdir}
mkdir -p $RPM_BUILD_ROOT/%{_mingw32_includedir}
mkdir -p $RPM_BUILD_ROOT/%{_mingw32_datadir}/libusb-win32
cp -p inf-wizard.exe install-filter.exe testlibusb.exe testlibusb-win.exe libusb0.dll
libusb0.sys $RPM_BUILD_ROOT/%{_mingw32_bindir}
cp -p libusb.a libusbd.a $RPM_BUILD_ROOT/%{_mingw32_libdir}
cp -p src/usb.h $RPM_BUILD_ROOT/%{_mingw32_includedir}
cp -p COPYING_GPL.txt COPYING_LGPL.txt $RPM_BUILD_ROOT/%{_mingw32_datadir}/libusb-win32
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{_mingw32_bindir}/libusb0.dll
%{_mingw32_bindir}/libusb0.sys
%{_mingw32_bindir}/inf-wizard.exe
%{_mingw32_bindir}/install-filter.exe
%{_mingw32_bindir}/testlibusb.exe
%{_mingw32_bindir}/testlibusb-win.exe
%{_mingw32_libdir}/libusb.a
%{_mingw32_libdir}/libusbd.a
%{_mingw32_includedir}/usb.h
%{_mingw32_datadir}/libusb-win32/COPYING_GPL.txt
%{_mingw32_datadir}/libusb-win32/COPYING_LGPL.txt
%changelog
* Tue Mar 24 2009 Michael Cronenworth <mike(a)cchtml.com> - 0.1.12.1-1
- Initial RPM release.
%define __strip %{_mingw32_strip}
%define __objdump %{_mingw32_objdump}
%define _use_internal_dependency_generator 0
%define __find_requires %{_mingw32_findrequires}
%define __find_provides %{_mingw32_findprovides}
Name: mingw32-sane-backends
Version: 1.0.19
Release: 1%{?dist}
Summary: Scanner access software
License: GPLv2+ and GPLv2+ with exceptions and Public Domain
Group: System Environment/Libraries
URL:
http://www.sane-project.org
Source0:
ftp://ftp.sane-project.org/pub/sane/sane-backends-%{version}/sane-backend...
Patch0: sane-win32-backend.patch
Patch1: sane-win32-frontend.patch
Patch2: sane-win32-lib.patch
Patch3: sane-win32-sanei.patch
Patch4: sane-win32-tools.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: mingw32-filesystem >= 33
BuildRequires: mingw32-gcc
BuildRequires: mingw32-binutils
BuildRequires: mingw32-libusb-win32
%description
Scanner Access Now Easy (SANE) is a universal scanner interface. The
SANE application programming interface (API) provides standardized
access to any raster image scanner hardware (flatbed scanner,
hand-held scanner, video and still cameras, frame-grabbers, etc.).
%prep
%setup -q -n sane-backends-%{version}
%patch0 -p0
%patch1 -p0
%patch2 -p0
%patch3 -p0
%patch4 -p0
chmod -x COPYING
%build
export BACKENDS=fujitsu \
%{_mingw32_configure}
make %{?_smp_mflags}
touch backend/.libs/libsane-fujitsu-1.dll
touch backend/.libs/libsane-dll-1.dll
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
# Remove documentation which duplicates that found in the native package.
rm -r $RPM_BUILD_ROOT/%{_mingw32_prefix}/doc
rm -r $RPM_BUILD_ROOT/%{_mingw32_prefix}/share
# Delete temp files
rm -r $RPM_BUILD_ROOT/%{_mingw32_libdir}/bin
rm -r $RPM_BUILD_ROOT/%{_mingw32_libdir}/sane
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc COPYING
%{_mingw32_bindir}/libsane-1.dll
%{_mingw32_bindir}/gamma4scanimage
%{_mingw32_bindir}/sane-config
%{_mingw32_bindir}/sane-find-scanner
%{_mingw32_bindir}/scanimage
%{_mingw32_libdir}/libsane.dll.a
%{_mingw32_libdir}/libsane.la
%{_mingw32_includedir}/sane/sane.h
%{_mingw32_includedir}/sane/saneopts.h
%{_mingw32_sysconfdir}/sane.d/dll.conf
%{_mingw32_sysconfdir}/sane.d/fujitsu.conf
%{_mingw32_sysconfdir}/sane.d/saned.conf
%changelog
* Tue Mar 24 2009 Michael Cronenworth <mike(a)cchtml.com> - 1.0.19-1
- Initial RPM release.