# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 79378 2011-06-12 03:25:17Z ryandesign@macports.org $

PortSystem              1.0
PortGroup               xcode 1.0

name                    twain-sane
version                 2.9
categories              graphics
maintainers             nomaintainer
supported_archs         i386 ppc

description             TWAIN datasource for SANE

long_description        This is a TWAIN datasource for Mac OS X that aquires images \
                        using the SANE backend libraries. The SANE backend libraries \
                        provide access to a large range of scanners connected through \
                        SCSI or USB. For a complete list see the documentation on the \
                        SANE project homepage. It works with my HP SCSI scanner, and \
                        many people have reported success with a large number of \
                        different scanners. The feedback from users have helped the \
                        SANE developers to fix problems with various backends, so with \
                        each release of the SANE backends more of the Mac OS X specific \
                        problems have been solved.

distname                TWAIN-SANE-Interface-${version}
homepage                http://www.ellert.se/twain-sane/
master_sites            http://www.ellert.se/PKGS/${distname}/src/

checksums               sha1    198ecb85a39f18c53d25288988735fa3181090cf \
                        rmd160  4436d3bb91d8fdc0d1c34a3f6ae74290d6b8917d

depends_lib             port:libiconv \
                        port:gettext \
                        port:libusb-compat \
                        port:sane-backends

xcode.project           SANE.ds.xcodeproj
xcode.destroot.path     /Library/Image Capture/TWAIN Data Sources
xcode.build.settings    LIBRARY_SEARCH_PATHS=${prefix}/lib \
                        HEADER_SEARCH_PATHS=${prefix}/include
xcode.destroot.settings LIBRARY_SEARCH_PATHS=${prefix}/lib \
                        HEADER_SEARCH_PATHS=${prefix}/include

build.dir               ${worksrcpath}/src

pre-build {
    # Generate Info.plist
    system "cd ${build.dir} && ./Info.sh > Info.plist"
}

destroot.violate_mtree  yes

livecheck.type          regex
livecheck.regex         TWAIN-SANE-Interface-(\[0-9.\]+)${extract.suffix}
