[88444] trunk/dports/aqua/HandBrake
cal at macports.org
cal at macports.org
Mon Jan 2 09:12:35 PST 2012
Revision: 88444
http://trac.macports.org/changeset/88444
Author: cal at macports.org
Date: 2012-01-02 09:12:32 -0800 (Mon, 02 Jan 2012)
Log Message:
-----------
HandBrake: Make python version configurable, make sure we're UsingTheRightCompiler, fix two issues with clang/OS X compatibility, closes #30863
Modified Paths:
--------------
trunk/dports/aqua/HandBrake/Portfile
Added Paths:
-----------
trunk/dports/aqua/HandBrake/files/
trunk/dports/aqua/HandBrake/files/ffmpeg-jack-osx.patch
trunk/dports/aqua/HandBrake/files/mp4v2-r355-clang-compatibility-src-bmff-typebmff.cpp.patch
trunk/dports/aqua/HandBrake/files/mp4v2-r355-clang-compatibility-src-itmf-type.cpp.patch
Modified: trunk/dports/aqua/HandBrake/Portfile
===================================================================
--- trunk/dports/aqua/HandBrake/Portfile 2012-01-02 14:20:30 UTC (rev 88443)
+++ trunk/dports/aqua/HandBrake/Portfile 2012-01-02 17:12:32 UTC (rev 88444)
@@ -1,7 +1,8 @@
# -*- 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$
-PortSystem 1.0
+PortSystem 1.0
+PortGroup python 1.0
name HandBrake
version 0.9.5
@@ -73,10 +74,21 @@
mpeg2dec-0.5.1.tar.gz sha1 c39a95d18e133cd81e890fd7672f592ed41fadfc \
x264-r1834-a51816a.tar.gz sha1 33028199108ed71cb4f1b5ae755ef8a2e5f6e7d3
-depends_build port:python26 \
- bin:curl:curl \
+variant python26 conflicts python27 {
+ python.default_version 26
+}
+
+variant python27 conflicts python26 {
+ python.default_version 27
+}
+
+if {![variant_isset python27]} {
+ default_variants +python26
+}
+
+
+depends_build bin:curl:curl \
port:yasm
-set python.bin ${prefix}/bin/python2.6
post-extract {
file mkdir ${worksrcpath}/download
@@ -105,14 +117,32 @@
${worksrcpath}/download
}
-configure.cmd ${python.bin} make/configure.py
+post-extract {
+ # make mp4v2 build with clang, see http://code.google.com/p/mp4v2/issues/detail?id=80
+ file copy ${filespath}/mp4v2-r355-clang-compatibility-src-bmff-typebmff.cpp.patch \
+ ${worksrcpath}/contrib/mp4v2/A01-clang-compatibility.patch
+ file copy ${filespath}/mp4v2-r355-clang-compatibility-src-itmf-type.cpp.patch \
+ ${worksrcpath}/contrib/mp4v2/A02-clang-compatibility.patch
+ # make ffmpeg build with jack support on OS X, see http://ffmpeg.org/trac/ffmpeg/ticket/43
+ file copy ${filespath}/ffmpeg-jack-osx.patch \
+ ${worksrcpath}/contrib/ffmpeg/A06-jack-osx.patch
+}
+
+# the Python PortGroup disables configure, we still want to use it, though
+use_configure yes
+pre-configure {
+ # this needs to be set in a phase, since setting it without a phase will not
+ # give the correct python version selected by the variants
+ configure.cmd ${python.bin} make/configure.py
+}
configure.pre_args
-configure.args --fetch=curl --arch=${configure.build_arch}
+configure.args --fetch=curl --arch=${configure.build_arch} --gcc=${configure.compiler}
# +universal would be possible, but not implemented yet
# see ${worksrcpath}/doc/BUILD-Mac for details
-universal_variant no
+universal_variant no
+build.cmd [portbuild::build_getmaketype]
build.dir ${worksrcpath}/build
build.target
Added: trunk/dports/aqua/HandBrake/files/ffmpeg-jack-osx.patch
===================================================================
--- trunk/dports/aqua/HandBrake/files/ffmpeg-jack-osx.patch (rev 0)
+++ trunk/dports/aqua/HandBrake/files/ffmpeg-jack-osx.patch 2012-01-02 17:12:32 UTC (rev 88444)
@@ -0,0 +1,119 @@
+diff --git ffmpeg-r25689/configure ffmpeg-r25689/configure
+index 3fceb31..a0317d4 100755
+--- ffmpeg-r25689/configure
++++ ffmpeg-r25689/configure
+@@ -1085,6 +1085,7 @@ HAVE_LIST="
+ lrint
+ lrintf
+ lzo1x_999_compress
++ mach_semaphore_h
+ machine_ioctl_bt848_h
+ machine_ioctl_meteor_h
+ malloc_h
+@@ -1500,6 +1501,8 @@ ffserver_extralibs='$ldl'
+
+ doc_deps="texi2html"
+
++mach_semaphore_deps="mach_semaphore_h"
++
+ # tests
+
+ test_deps(){
+@@ -2951,6 +2954,8 @@ check_header soundcard.h
+
+ enabled_any alsa_indev alsa_outdev && check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
+
++check_header mach/semaphore.h
++
+ enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack
+
+ enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
+diff --git ffmpeg-r25689/libavdevice/jack_audio.c ffmpeg-r25689/libavdevice/jack_audio.c
+index 9062e7f..274380d 100644
+--- ffmpeg-r25689/libavdevice/jack_audio.c
++++ ffmpeg-r25689/libavdevice/jack_audio.c
+@@ -21,7 +21,12 @@
+ */
+
+ #include "config.h"
++#ifdef HAVE_MACH_SEMAPHORE_H
++#include <mach/task.h>
++#include <mach/semaphore.h>
++#endif
+ #include <semaphore.h>
++
+ #include <jack/jack.h>
+
+ #include "libavutil/log.h"
+@@ -38,7 +43,11 @@
+ typedef struct {
+ jack_client_t * client;
+ int activated;
++#ifdef HAVE_MACH_SEMAPHORE_H
++ semaphore_t packet_count;
++#else
+ sem_t packet_count;
++#endif
+ jack_nframes_t sample_rate;
+ jack_nframes_t buffer_size;
+ jack_port_t ** ports;
+@@ -99,7 +108,11 @@ static int process_callback(jack_nframes_t nframes, void *arg)
+
+ /* Send the now filled packet back, and increase packet counter */
+ av_fifo_generic_write(self->filled_pkts, &pkt, sizeof(pkt), NULL);
++#ifdef HAVE_MACH_SEMAPHORE_H
++ semaphore_signal(self->packet_count);
++#else
+ sem_post(&self->packet_count);
++#endif
+
+ return 0;
+ }
+@@ -150,7 +163,11 @@ static int start_jack(AVFormatContext *context, AVFormatParameters *params)
+ return AVERROR(EIO);
+ }
+
++#ifdef HAVE_MACH_SEMAPHORE_H
++ semaphore_create(TASK_NULL, &self->packet_count, 0, 0);
++#else
+ sem_init(&self->packet_count, 0, 0);
++#endif
+
+ self->sample_rate = jack_get_sample_rate(self->client);
+ self->nports = params->channels;
+@@ -212,7 +229,11 @@ static void stop_jack(JackData *self)
+ jack_deactivate(self->client);
+ jack_client_close(self->client);
+ }
++#ifdef HAVE_MACH_SEMAPHORE_H
++ semaphore_destroy(TASK_NULL, self->packet_count);
++#else
+ sem_destroy(&self->packet_count);
++#endif
+ free_pkt_fifo(self->new_pkts);
+ free_pkt_fifo(self->filled_pkts);
+ av_freep(&self->ports);
+@@ -253,7 +274,11 @@ static int audio_read_header(AVFormatContext *context, AVFormatParameters *param
+ static int audio_read_packet(AVFormatContext *context, AVPacket *pkt)
+ {
+ JackData *self = context->priv_data;
++#ifdef HAVE_MACH_SEMAPHORE_H
++ mach_timespec_t timeout = {0, 0};
++#else
+ struct timespec timeout = {0, 0};
++#endif
+ int test;
+
+ /* Activate the JACK client on first packet read. Activating the JACK client
+@@ -274,7 +299,11 @@ static int audio_read_packet(AVFormatContext *context, AVPacket *pkt)
+
+ /* Wait for a packet comming back from process_callback(), if one isn't available yet */
+ timeout.tv_sec = av_gettime() / 1000000 + 2;
++#ifdef HAVE_MACH_SEMAPHORE_H
++ if (semaphore_timedwait(self->packet_count, timeout)) {
++#else
+ if (sem_timedwait(&self->packet_count, &timeout)) {
++#endif
+ if (errno == ETIMEDOUT) {
+ av_log(context, AV_LOG_ERROR,
+ "Input error: timed out when waiting for JACK process callback output\n");
Added: trunk/dports/aqua/HandBrake/files/mp4v2-r355-clang-compatibility-src-bmff-typebmff.cpp.patch
===================================================================
--- trunk/dports/aqua/HandBrake/files/mp4v2-r355-clang-compatibility-src-bmff-typebmff.cpp.patch (rev 0)
+++ trunk/dports/aqua/HandBrake/files/mp4v2-r355-clang-compatibility-src-bmff-typebmff.cpp.patch 2012-01-02 17:12:32 UTC (rev 88444)
@@ -0,0 +1,37 @@
+Index: mp4v2-trunk-r355/src/bmff/typebmff.cpp
+===================================================================
+--- mp4v2-trunk-r355/src/bmff/typebmff.cpp (revision 441)
++++ mp4v2-trunk-r355/src/bmff/typebmff.cpp (revision 442)
+@@ -23,19 +23,12 @@
+
+ #include "impl.h"
+
+-// VStudio idiocy prevents defining template instanced static data
+-// in a namespace. Workaround it by defining in global scope.
+-// Other platforms will continue to put things in the proper namespace.
+-#if defined( _MSC_VER )
+-using namespace mp4v2::impl::bmff;
+-#else
+-namespace mp4v2 { namespace impl { namespace bmff {
+-#endif
++namespace mp4v2 { namespace impl {
+
+ ///////////////////////////////////////////////////////////////////////////////
+
+ template <>
+-const EnumLanguageCode::Entry EnumLanguageCode::data[] = {
++const bmff::EnumLanguageCode::Entry bmff::EnumLanguageCode::data[] = {
+ { mp4v2::impl::bmff::ILC_AAR, "aar", "Afar" },
+ { mp4v2::impl::bmff::ILC_ABK, "abk", "Abkhazian" },
+ { mp4v2::impl::bmff::ILC_ACE, "ace", "Achinese" },
+@@ -526,9 +519,7 @@
+
+ ///////////////////////////////////////////////////////////////////////////////
+
+-#if defined( _MSC_VER )
+-namespace mp4v2 { namespace impl { namespace bmff {
+-#endif
++namespace bmff {
+
+ ///////////////////////////////////////////////////////////////////////////////
+
Added: trunk/dports/aqua/HandBrake/files/mp4v2-r355-clang-compatibility-src-itmf-type.cpp.patch
===================================================================
--- trunk/dports/aqua/HandBrake/files/mp4v2-r355-clang-compatibility-src-itmf-type.cpp.patch (rev 0)
+++ trunk/dports/aqua/HandBrake/files/mp4v2-r355-clang-compatibility-src-itmf-type.cpp.patch 2012-01-02 17:12:32 UTC (rev 88444)
@@ -0,0 +1,82 @@
+Index: mp4v2-trunk-r355/src/itmf/type.cpp
+===================================================================
+--- mp4v2-trunk-r355/src/itmf/type.cpp (revision 441)
++++ mp4v2-trunk-r355/src/itmf/type.cpp (revision 442)
+@@ -24,19 +24,12 @@
+
+ #include "impl.h"
+
+-// VStudio idiocy prevents defining template instanced static data
+-// in a namespace. Workaround it by defining in global scope.
+-// Other platforms will continue to put things in the proper namespace.
+-#if defined( _MSC_VER )
+-using namespace mp4v2::impl::itmf;
+-#else
+-namespace mp4v2 { namespace impl { namespace itmf {
+-#endif
++namespace mp4v2 { namespace impl {
+
+ ///////////////////////////////////////////////////////////////////////////////
+
+ template <>
+-const EnumBasicType::Entry EnumBasicType::data[] = {
++const itmf::EnumBasicType::Entry itmf::EnumBasicType::data[] = {
+ { mp4v2::impl::itmf::BT_IMPLICIT, "implicit", "implicit" },
+ { mp4v2::impl::itmf::BT_UTF8, "utf8", "UTF-8" },
+ { mp4v2::impl::itmf::BT_UTF16, "utf16", "UTF-16" },
+@@ -64,7 +57,7 @@
+ ///////////////////////////////////////////////////////////////////////////////
+
+ template <>
+-const EnumGenreType::Entry EnumGenreType::data[] = {
++const itmf::EnumGenreType::Entry itmf::EnumGenreType::data[] = {
+ { mp4v2::impl::itmf::GENRE_BLUES, "blues", "Blues" },
+ { mp4v2::impl::itmf::GENRE_CLASSIC_ROCK, "classicrock", "Classic Rock" },
+ { mp4v2::impl::itmf::GENRE_COUNTRY, "country", "Country" },
+@@ -200,7 +193,7 @@
+ ///////////////////////////////////////////////////////////////////////////////
+
+ template <>
+-const EnumStikType::Entry EnumStikType::data[] = {
++const itmf::EnumStikType::Entry itmf::EnumStikType::data[] = {
+ { mp4v2::impl::itmf::STIK_OLD_MOVIE, "oldmovie", "Movie" },
+ { mp4v2::impl::itmf::STIK_NORMAL, "normal", "Normal" },
+ { mp4v2::impl::itmf::STIK_AUDIOBOOK, "audiobook", "Audio Book" },
+@@ -216,7 +209,7 @@
+ ///////////////////////////////////////////////////////////////////////////////
+
+ template <>
+-const EnumAccountType::Entry EnumAccountType::data[] = {
++const itmf::EnumAccountType::Entry itmf::EnumAccountType::data[] = {
+ { mp4v2::impl::itmf::AT_ITUNES, "itunes", "iTunes" },
+ { mp4v2::impl::itmf::AT_AOL, "aol", "AOL" },
+
+@@ -226,7 +219,7 @@
+ ///////////////////////////////////////////////////////////////////////////////
+
+ template <>
+-const EnumCountryCode::Entry EnumCountryCode::data[] = {
++const itmf::EnumCountryCode::Entry itmf::EnumCountryCode::data[] = {
+ { mp4v2::impl::itmf::CC_USA, "usa", "United States" },
+ { mp4v2::impl::itmf::CC_USA, "fra", "France" },
+ { mp4v2::impl::itmf::CC_DEU, "ger", "Germany" },
+@@ -256,7 +249,7 @@
+ ///////////////////////////////////////////////////////////////////////////////
+
+ template <>
+-const EnumContentRating::Entry EnumContentRating::data[] = {
++const itmf::EnumContentRating::Entry itmf::EnumContentRating::data[] = {
+ { mp4v2::impl::itmf::CR_NONE, "none", "None" },
+ { mp4v2::impl::itmf::CR_CLEAN, "clean", "Clean" },
+ { mp4v2::impl::itmf::CR_EXPLICIT, "explicit", "Explicit" },
+@@ -266,9 +259,7 @@
+
+ ///////////////////////////////////////////////////////////////////////////////
+
+-#if defined( _MSC_VER )
+-namespace mp4v2 { namespace impl { namespace itmf {
+-#endif
++namespace itmf {
+
+ ///////////////////////////////////////////////////////////////////////////////
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120102/b920641c/attachment.html>
More information about the macports-changes
mailing list