# -*- 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

PortSystem              1.0
PortGroup               xcode 1.0

name                    twain-sane
version                 3.5
categories              graphics
license                 GPL-2+
maintainers             nomaintainer
supported_archs         i386 ppc

#
# does not build universal on 64 bit platforms
#

if {${os.major} > 9} {
    universal_variant no
}

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               rmd160  e7e79108645578e1a51a1bfacc1d18da61d267ce \
                        sha256  e0eb432b7cffa2f19b8b95f1025a7d1bccd46df881a35431f8d598208756471f

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 -W ${build.dir} {./Info.sh > Info.plist}
}

destroot.violate_mtree  yes

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