# -*- 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 56239 2009-08-25 16:51:00Z jameskyle@macports.org $

PortSystem 1.0
PortGroup               muniversal 1.0

name		x264
version		20090810
revision        1
categories	multimedia
platforms	darwin
maintainers	devans openmaintainer
description	x264 - a free h264/avc encoder
long_description x264 is a free library for encoding H264/AVC video streams. \
		The code is written by Laurent Aimar, Eric Petit(OS X), Min \
		Chen (vfw/nasm), Justin Clay(vfw), Måns Rullgård and Loren \
		Merritt from scratch. It is released under the terms of the \
		GPL license.
homepage	http://www.videolan.org/x264.html
master_sites	ftp://ftp.videolan.org/pub/videolan/x264/snapshots/
distname	${name}-snapshot-${version}-2245

checksums           md5     6671b66a0a83769c54ba9cd10ad598d8 \
                    sha1    26abd8c1dc05dae04f99b33a689e4ee7debd9126 \
                    rmd160  f8297dcb4a43207f5c03165a2320425a640ff4d7


use_bzip2	yes

pre-extract {
    if {"darwin" == ${os.platform} && 9 == ${os.major}} {
        set minimum_xcodeversion 3.1
        set current_xcodeversion [exec defaults read /Developer/Applications/Xcode.app/Contents/Info CFBundleShortVersionString]
        if {[rpm-vercomp ${current_xcodeversion} ${minimum_xcodeversion}] < 0} {
            ui_error "On Mac OS X ${macosx_version}, ${name} ${version} requires Xcode ${minimum_xcodeversion} or later but you have Xcode ${current_xcodeversion}."
            return -code error "incompatible Xcode version"
        }
    }
}

configure.args \
		--enable-pthread --enable-pic --enable-shared --disable-asm

configure.cflags-append -I. -fno-common -read_only_relocs suppress

destroot.args	DIR_INSTALL=${destroot}${prefix}

build.target	default

#
# intel assembler optimizations using yasm continue
# to exhibit problems in some cases (see #19835)
# disable by default but can be enabled using +asm variant for the adventurous
#
variant asm description {enable intel assembler optimizations (experimental)} {
	depends_build-append    port:yasm
	configure.args-delete   --disable-asm
}

livecheck.check none
