# $Id: Portfile 86786 2011-11-04 05:20:35Z boeyms@macports.org $

PortSystem              1.0
PortGroup               xcode 1.0

name			Growl
set base_version	1.1.6
version			${base_version}
revision		1
platforms		darwin
maintainers		nomaintainer
description		global notification system for Mac OS X
long_description	Growl is a global notification system for Mac OS X. Any \
				application can send a notification to Growl, which will \
				display an attractive message on your screen.

homepage		http://growl.info/

master_sites	${homepage}files/source/

checksums           md5     ab0e668ae536257e9845b80b27d6a8e6 \
                    sha1    9700a04b995c7ce808c3f37a6a0556785de55a3a \
                    rmd160  e43f232073a58d077b0fe1bd772d4f257c2edc83

use_bzip2		yes
distname		${distname}-src

xcode.target		Growl
destroot.destdir	DSTROOT=${worksrcpath}/build
xcode.destroot.path	/destroot
destroot.violate_mtree   yes

# Common/Source/LoginItemAE.c uses Carbon so can't build x86_64
supported_archs		i386 ppc

post-patch {
	reinplace "s|REVISION=.*|REVISION=116|g" ${worksrcpath}/generateHgRevision.sh
}

# install only Growl.prefPane
post-destroot {
	xinstall -d "${destroot}/Library/PreferencePanes"
	move ${worksrcpath}/build/destroot/Growl.prefPane "${destroot}/Library/PreferencePanes"
}

# The old behaviour of automatically installing the contributed extras in the
# source distribution has been disabled for now, as it is not apparent that
# every Growl user will want these.  They should probably go into other ports,
# in any case.

# the 10.4 SDK might not be installed, use the system's default
platform darwin 10 {
	patchfiles-append patch-Growl.xcodeproj__project.pbxproj.no-10.4sdk.diff
}

# disables separate strip
platform darwin 8 {
	patchfiles-append patch-Growl.xcodeproj__project.pbxproj.no_separate_strip.diff
}

# this proc is overriden to remove the SYMROOT=build/ configuration
# overwise, Extras/GrowlAction builds in Extras/GrowlAction/build instead of build
proc xcode::get_build_args {args} {
    global tcl_platform
    global configure.universal_archs configure.build_arch macosx_deployment_target
    global os.major os.arch
    global developer_dir configure.sdkroot

    set xcode_build_args "OBJROOT=build/"

    # MACOSX_DEPLOYMENT_TARGET
    append xcode_build_args " MACOSX_DEPLOYMENT_TARGET=${macosx_deployment_target}"

    # ARCHS
    if {[variant_exists universal] && [variant_isset universal]} {
        append xcode_build_args " ARCHS=\"${configure.universal_archs}\""
    } else {
        append xcode_build_args " ARCHS=${configure.build_arch}"
    }

    # SDKROOT
    append xcode_build_args " SDKROOT=\"${configure.sdkroot}\""

    return $xcode_build_args
}

