# -*- 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 62211 2009-12-31 21:36:31Z ryandesign@macports.org $

PortSystem          1.0

name                lprof
version             20090113
revision            2
categories          graphics
license             GPL
maintainers         nomaintainer
description         LProf open source ICC profiler
long_description    LProf is an open source color profiler that creates ICC \
                    compliant profiles for devices such as cameras, scanners \
                    and monitors. Origanally authored by Marti Maria the \
                    creator of LCMS. Marti has graciously consented to the \
                    creation of this project.

platforms           darwin
homepage            http://lprof.sourceforge.net
master_sites        sourceforge
fetch.type          cvs
cvs.root            :pserver:anonymous@lprof.cvs.sourceforge.net:/cvsroot/lprof
cvs.date            ${version}
cvs.module          lprof

depends_lib         path:bin/qmake-mac:qt4-mac port:libusb-compat
depends_build       port:cmake

worksrcdir          lprof

configure.cmd       cmake
configure.ccache    no
configure.args      -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
                    -DCMAKE_VERBOSE_MAKEFILE=ON \
                    -DCMAKE_BUILD_TYPE=Release \
                    -DCMAKE_SYSTEM_PREFIX_PATH=\"${prefix}\;/usr\" \
                    -DCMAKE_INSTALL_PREFIX=${prefix} \
                    -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib/ \
                    -DCMAKE_INCLUDE_PATH=${prefix}/include \
                    -DCMAKE_LIBRARY_PATH=${prefix}/lib \
                    -DQT_QMAKE_EXECUTABLE=${prefix}/bin/qmake-mac \
                    -DQTTRANS_LRELEASE_EXECUTABLE=${prefix}/bin/lrelease-mac \
                    -Wno-dev .

if {[info exists universal_sysroot]} {
    configure.args-append \
                    -DCMAKE_C_FLAGS_RELEASE="-isysroot ${universal_sysroot}" \
                    -DCMAKE_CXX_FLAGS_RELEASE="-isysroot ${universal_sysroot}" \
                    -DCMAKE_LD_FLAGS="-Wl,-syslibroot,${universal_sysroot}"
}

post-destroot {
  set appdir $destroot$applications_dir/LProf.app
  set appcdir $appdir/Contents
  xinstall -m 755 -d $appcdir/MacOS/data
  xinstall -m 755 -d $appcdir/Resources
  xinstall -m 755 -d $appcdir/Argyll.kext
  xinstall $destroot$prefix/bin/lprof $destroot$prefix/bin/icc2it8 $appcdir/MacOS
  file copy $worksrcpath/build/darwin/lprof.app/Contents/Info.plist $appcdir
  file copy $worksrcpath/build/darwin/lprof.app/Contents/Resources/lprof.icns $appcdir/Resources
  file copy $worksrcpath/src/argyll/libusb/Argyll.kext/Info.plist $appcdir/Argyll.kext
  file copy $applications_dir/Qt/Assistant.app $appcdir/MacOS
  eval file copy [glob "$destroot$prefix/data/*"] $appcdir/MacOS/data
  file delete -force $destroot$prefix/bin $destroot$prefix/data
}

livecheck.type      none
