PortSystem 1.0
PortGroup xcode 1.0

name		Chmox
version		0.4
revision	5
categories	aqua textproc
maintainers	nomaintainer
description	Read CHM documents on your Mac
long_description	\
	A viewer for Microsoft Help \"CHM\" (aka Compiled HTML) files	\
	using Cocoa, WebKit and chmlib.
homepage	http://chmox.sourceforge.net

fetch.type	cvs
cvs.root	:pserver:anonymous@chmox.cvs.sourceforge.net:/cvsroot/chmox
cvs.module	Sources

worksrcdir	Sources

if {[vercmp $xcodeversion 4.0] < 0} {
    patchfiles	patch-chmox.xcode-project.pbxproj.diff
} else {
    post-patch {
        copy -force ${filespath}/project.pbxproj ${worksrcpath}/chmox.xcode/
    }
}

post-patch {
	reinplace s|@PREFIX@|${prefix}| ${worksrcpath}/chmox.xcode/project.pbxproj
}

depends_lib	path:lib/libssl.dylib:openssl \
			port:libxml2

# xcode PG builds port again in destroot phase - no need to build twice and causes
# errors on new Xcode build system if we try due to duplicated symlinks
build                   {}

xcode.build.settings	LIBRARY_SEARCH_PATHS=${prefix}/lib \
					    DEPLOYMENT_LOCATION=NO

xcode.destroot.settings	LIBRARY_SEARCH_PATHS=${prefix}/lib

livecheck.type  regex
livecheck.regex "${name} (\\d+(?:\\.\\d+)*)"
