Index: Portfile
===================================================================
--- Portfile	(revision 46107)
+++ Portfile	(working copy)
@@ -5,7 +5,7 @@
 
 name		ffmpeg
 version		15261
-revision        1
+revision        2
 categories	multimedia
 maintainers	acho@macports.org openmaintainer
 description	Digital VCR and streaming server
@@ -43,9 +43,19 @@
 
 use_parallel_build  yes
 worksrcdir     trunk
-depends_build  bin:svn:subversion port:gmake
 
-depends_lib     port:libsdl \
+depends_build   bin:svn:subversion \
+                port:gmake \
+                port:x264
+
+depends_lib     port:lame \
+                port:libvorbis \
+                port:libogg \
+                port:libtheora \
+                port:faac \
+                port:faad2 \
+                port:XviD \
+                port:libsdl \
                 port:bzip2 \
                 port:zlib
 
@@ -77,15 +87,27 @@
 }
 
 platforms       darwin
+
 configure.cflags-append	-DHAVE_LRINTF ${configure.cppflags}
 configure.args	--disable-vhook \
+                --enable-gpl \
+                --enable-nonfree \
+                --enable-swscale --enable-avfilter --enable-avfilter-lavf \
+                --enable-postproc \
+                --enable-libmp3lame \
+                --enable-libvorbis \
+                --enable-libtheora \
+                --enable-libfaac \
+                --enable-libfaad \
+                --enable-libx264 \
+                --enable-libxvid \
 		--mandir=${prefix}/share/man \
 		--enable-shared --enable-pthreads \
 		--disable-mmx --cc=gcc-4.0
 
 test.run        yes
 
-default_variants	+a52
+default_variants +a52
 
 # configure isn't autoconf and they do use a dep cache
 universal_variant no
@@ -111,52 +133,7 @@
 	configure.args-append --disable-decoder=cavs
 }
 
-variant gpl description {allow use of GPL code, the resulting libav* and ffmpeg will be under GPL} {
-	configure.args-append --enable-gpl
-}
-
-variant postproc requires gpl description {enable GPLed postprocessing support} {
-	configure.args-append --enable-postproc
-}
-
-# Adds MP3 support
-variant lame description {enable MP3 encoding via libmp3lame} {
-	depends_lib-append port:lame
-	configure.args-append --enable-libmp3lame
-}
-
-variant extvorbis description {enable Vorbis encoding via libvorbis, native implementation exists} {
-	depends_lib-append port:libvorbis port:libogg
-	configure.args-append --enable-libvorbis
-}
-
-variant theora description {enable Theora encoding via libtheora} {
-	depends_lib-append port:libtheora port:libogg
-	configure.args-append --enable-libtheora
-}
-
-variant faac requires gpl description {enable FAAC support via libfaac} {
-	depends_lib-append port:faac
-	configure.args-append --enable-libfaac
-}
-
-variant faad requires gpl description {enable FAAD support via libfaad} {
-	depends_lib-append port:faad2
-	configure.args-append --enable-libfaad
-}
-
-variant xvid requires gpl description {enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists} {
-	depends_lib-append port:XviD
-	configure.args-append --enable-libxvid
-}
-
-# depends build until x264 port supports shared libraries
-variant x264 requires gpl description {enable H.264 encoding via x264} {
-	depends_build-append port:x264
-	configure.args-append --enable-libx264
-}
-
-variant a52 requires gpl description {enable GPLed liba52 support} {
+variant a52 description {enable GPLed liba52 support} {
 	depends_lib-append port:a52dec
 	configure.args-append --enable-liba52
 	post-destroot {
@@ -169,12 +146,70 @@
 	}
 }
 
-variant avfilter requires gpl description {video filter support (replaces vhook)} {
-	configure.args-append --enable-swscale --enable-avfilter
+variant no_gpl conflicts a52 description {disallow use of GPL code, license will be LGPL if +no_nonfree is selected} {
+    configure.args-delete   --enable-gpl
+    configure.args-delete   --enable-postproc
+    configure.args-delete   --enable-swscale
+    configure.args-delete   --enable-libfaad
+    depends_lib-delete      port:faad2
+    configure.args-delete   --enable-libx264
+    depends_build-delete      port:x264
+    configure.args-delete   --enable-libxvid
+    depends_lib-delete      port:XviD
+}
 
-	# keep vhook as long as avfilter isnt working fully
-	configure.args-delete --disable-vhook
+variant no_nonfree description {disallow use of nonfree code, libraries and binaries will be redistributable under GPL/LGPL} {
+    configure.args-delete --enable-nonfree
 }
 
+post-activate {
+    if {![variant_isset no_nonfree]} {
+        ui_msg "
+*******
+******* This build of ${name} includes nonfree code.
+*******
+******* The following libraries and binaries may not be redistributed:
+*******
+*******     ffmpeg
+*******     libavcodec
+*******     libavdevice
+*******     libavfilter
+*******     libavformat
+*******     libavutil
+*******
+******* To remove this restriction use variant +no_nonfree
+*******
+"
+    } elseif {![variant_isset no_gpl]} {
+        ui_msg "
+*******
+******* This build of ${name} includes GPLed code and
+******* is therefore licensed under GPL.
+*******
+******* The following modules are GPLed:
+*******
+*******      postproc
+*******      swscale
+*******      liba52
+*******      libfaad
+*******      libx264
+*******      libxvid
+*******
+******* To include only LGPLed code use variants +no_nonfree +no_gpl -a52
+*******
+"
+    } else {
+        ui_msg "
+*******
+******* This build of ${name} includes no GPLed or nonfree
+******* code and is therefore licensed under LGPL.
+*******
+"
+    }
+}
+
+#
 #disable livecheck
+#
+
 livecheck.check none
