aboutsummaryrefslogtreecommitdiff
path: root/multimedia/libx264
diff options
context:
space:
mode:
authorJohannes Jost Meixner <xmj@FreeBSD.org>2014-11-22 16:23:34 +0000
committerJohannes Jost Meixner <xmj@FreeBSD.org>2014-11-22 16:23:34 +0000
commit4f12f3b1783327d4e833649c63d8e1724bb16588 (patch)
tree69858a5647bf444b8dbaae3a0602f21ce314cc16 /multimedia/libx264
parentd2ddcbb5a0935eab677bbd463a5653e4564b369b (diff)
downloadports-4f12f3b1783327d4e833649c63d8e1724bb16588.tar.gz
ports-4f12f3b1783327d4e833649c63d8e1724bb16588.zip
multimedia/x264: General overhaul
- Split x264 into two ports: the CLI application (x264), and the library (libx264). This will allow x264 to use lavf and friends from ffmpeg for decoding and demuxing while preventing a circular dependency between the two: x264 can depend on ffmpeg, but ffmpeg will depend on libx264 rather than x264. - Add the LAVF option to the CLI port, making the dependency on ffmpeg optional. - Update to 0.142.2455. - Amend fixes to local patches so that they can apply to the new upstream files. - Provide the git revision and other version information to the build environment, allowing the CLI binary to display this information (like the Windows builds). - Remove unsupported build options (X11_OUTPUT). - Ensure that the library and CLI ports each have the appropriate options. - Add notes for future contributors who wish to update the ports. - Bump PORTREVISION for all dependent ports. PR: 187805 Differential Revision: https://reviews.freebsd.org/D1159 Submitted by: Andrew Berg <aberg010@my.hennepintech.edu> Approved by: koobs (maintainer, mentor)
Notes
Notes: svn path=/head/; revision=373073
Diffstat (limited to 'multimedia/libx264')
-rw-r--r--multimedia/libx264/Makefile107
-rw-r--r--multimedia/libx264/distinfo4
-rw-r--r--multimedia/libx264/files/patch-Makefile33
-rw-r--r--multimedia/libx264/files/patch-common_cpu.c29
-rw-r--r--multimedia/libx264/pkg-descr13
-rw-r--r--multimedia/libx264/pkg-plist7
6 files changed, 193 insertions, 0 deletions
diff --git a/multimedia/libx264/Makefile b/multimedia/libx264/Makefile
new file mode 100644
index 000000000000..e8baf7b9ccfb
--- /dev/null
+++ b/multimedia/libx264/Makefile
@@ -0,0 +1,107 @@
+# Created by: Michael Johnson <ahze@FreeBSD.org>
+# $FreeBSD$
+#
+# Updating notes: see multimedia/x264/Makefile.
+
+PORTNAME= libx264
+PORTVERSION= 0.${X264_BUILD}.${X264_REV}
+CATEGORIES= multimedia
+MASTER_SITES= ftp://ftp.videolan.org/pub/videolan/x264/snapshots/ \
+ http://samples.mplayerhq.hu/yuv4mpeg2/:pgo
+DISTNAME= x264-snapshot-${X264_SNAPSHOT}-2245-stable
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
+DIST_SUBDIR= libx264
+EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
+
+MAINTAINER= koobs@FreeBSD.org
+COMMENT= Library and tool for encoding H.264/AVC video streams
+
+LICENSE= GPLv2
+
+BUILD_DEPENDS= yasm>=0.6.0:${PORTSDIR}/devel/yasm \
+ ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash
+
+X264_BUILD= 142
+X264_REV= 2455
+X264_COMMIT= 021c0dc6c95c1bc239c9db78a80dd85fc856a4dd
+X264_GITVER= ${X264_COMMIT:C/^(.......).*$/\1/g}
+X264_SNAPSHOT= 20140827
+
+USES= gmake tar:bzip2
+WRKSRC= ${WRKDIR}/${DISTNAME}
+USE_LDCONFIG= yes
+HAS_CONFIGURE= yes
+
+OPTIONS_DEFINE= ASM DEBUG HI10P GCC
+OPTIONS_DEFAULT= ASM
+ASM_DESC= Enable Assembly Optimizations
+DEBUG_DESC= Generate Debugging Symbols
+GCC_DESC= Use current GCC
+HI10P_DESC= Enable High 10 Profile 10-bit encoding
+
+CONFIGURE_ARGS+= --extra-cflags="-I${LOCALBASE}/include" \
+ --extra-ldflags="-L${LOCALBASE}/lib" \
+ --enable-static --enable-shared \
+ --disable-opencl \
+ --disable-cli
+
+PLIST_SUB+= X264_BUILD=${X264_BUILD}
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MGCC}
+USE_GCC= yes
+.endif
+
+.if !${PORT_OPTIONS:MASM}
+CONFIGURE_ARGS+= --disable-asm
+.endif
+
+.if ${PORT_OPTIONS:MHI10P}
+CONFIGURE_ARGS+= --bit-depth=10
+.endif
+
+.if ${PORT_OPTIONS:MDEBUG} || defined(WITH_DEBUG)
+CONFIGURE_ARGS+= --enable-debug
+.endif
+
+# Around the time GCC stack protection (aka Propolice) for userland
+# was enabled on src/share/mk/bsd.sys.mk
+# SVN rev 180012 on 2008-06-25 21:33:28Z by ru
+.if ${OSVERSION} >= 800040
+LDFLAGS+= -fstack-protector
+.endif
+
+.if ${PORT_OPTIONS:MPGO}
+# y4m sample video
+Y4M_VIDEO=example.y4m
+Y4M_VIDEO_DISTFILE=example.y4m.bz2
+
+DISTFILES+= ${Y4M_VIDEO_DISTFILE}:pgo
+ALL_TARGET= fprofiled
+MAKE_ENV+= VIDS="${WRKDIR}/${Y4M_VIDEO}"
+
+RESTRICTED= ${Y4M_VIDEO_DISTFILE} file may not be mirrored
+RESTRICTED_FILES= ${Y4M_VIDEO_DISTFILE}
+.endif
+
+post-extract:
+.if ${PORT_OPTIONS:MPGO}
+ @( cd ${WRKDIR} && ${BZIP2_CMD} -dc ${DISTDIR}/${DIST_SUBDIR}/${Y4M_VIDEO_DISTFILE} > ${Y4M_VIDEO} )
+.endif
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|; \
+ s|-lpthread|${PTHREAD_LIBS}|g; \
+ s|/bin/bash|${LOCALBASE}/bin/bash|; \
+ s|gpac_static|gpac|g' \
+ ${WRKSRC}/configure
+ @${REINPLACE_CMD} -e 's|bash|sh|; \
+ s|VER="x"|VER="${X264_REV} ${X264_GITVER}"|; \
+ s|VERSION=""|VERSION=" r${X264_REV} ${X264_GITVER}"|' \
+ ${WRKSRC}/version.sh
+ @${REINPLACE_CMD} -e 's|$$(libdir)/pkgconfig|${PREFIX}/libdata/pkgconfig|; \
+ s|$${libdir}/pkgconfig|${PREFIX}/libdata/pkgconfig|' \
+ ${WRKSRC}/Makefile
+
+.include <bsd.port.mk>
diff --git a/multimedia/libx264/distinfo b/multimedia/libx264/distinfo
new file mode 100644
index 000000000000..a8c202a07b68
--- /dev/null
+++ b/multimedia/libx264/distinfo
@@ -0,0 +1,4 @@
+SHA256 (libx264/x264-snapshot-20140827-2245-stable.tar.bz2) = fb1de3f802a83778527d45e69b552efa73b677ebb3ac633a8720923e71ffc5e3
+SIZE (libx264/x264-snapshot-20140827-2245-stable.tar.bz2) = 624939
+SHA256 (libx264/example.y4m.bz2) = a5bec9d37362bd9d7773fbd0644643f9ec096d654d20823004e88d5df32bbff7
+SIZE (libx264/example.y4m.bz2) = 4910029
diff --git a/multimedia/libx264/files/patch-Makefile b/multimedia/libx264/files/patch-Makefile
new file mode 100644
index 000000000000..6d5646214e2c
--- /dev/null
+++ b/multimedia/libx264/files/patch-Makefile
@@ -0,0 +1,33 @@
+--- Makefile.orig 2014-08-27 15:45:08.000000000 -0500
++++ Makefile 2014-10-21 16:18:59.299348000 -0500
+@@ -85,12 +85,12 @@
+ endif
+ X86SRC = $(X86SRC0:%=common/x86/%)
+
+-ifeq ($(ARCH),X86)
++ifeq ($(ARCH),i386)
+ ARCH_X86 = yes
+ ASMSRC = $(X86SRC) common/x86/pixel-32.asm
+ endif
+
+-ifeq ($(ARCH),X86_64)
++ifeq ($(ARCH),amd64)
+ ARCH_X86 = yes
+ ASMSRC = $(X86SRC:-32.asm=-64.asm) common/x86/trellis-64.asm
+ endif
+@@ -104,7 +104,14 @@
+ endif
+
+ # AltiVec optims
+-ifeq ($(ARCH),PPC)
++ifeq ($(ARCH),powerpc)
++ARCH_PPC = yes
++endif
++ifeq ($(ARCH),powerpc64)
++ARCH_PPC = yes
++endif
++
++ifdef ARCH_PPC
+ ifneq ($(AS),)
+ SRCS += common/ppc/mc.c common/ppc/pixel.c common/ppc/dct.c \
+ common/ppc/quant.c common/ppc/deblock.c \
diff --git a/multimedia/libx264/files/patch-common_cpu.c b/multimedia/libx264/files/patch-common_cpu.c
new file mode 100644
index 000000000000..b1c529d67055
--- /dev/null
+++ b/multimedia/libx264/files/patch-common_cpu.c
@@ -0,0 +1,29 @@
+--- common/cpu.c.orig 2010-06-24 22:45:07.000000000 +0200
++++ common/cpu.c 2010-07-18 22:55:49.324572565 +0200
+@@ -234,7 +234,7 @@
+
+ #elif ARCH_PPC
+
+-#if SYS_MACOSX || SYS_OPENBSD
++#if SYS_MACOSX || SYS_OPENBSD || SYS_FREEBSD
+ #include <sys/sysctl.h>
+ uint32_t x264_cpu_detect( void )
+ {
+@@ -242,12 +242,16 @@
+ uint32_t cpu = 0;
+ #if SYS_OPENBSD
+ int selectors[2] = { CTL_MACHDEP, CPU_ALTIVEC };
+-#else
++#elif SYS_MACOSX
+ int selectors[2] = { CTL_HW, HW_VECTORUNIT };
+ #endif
+ int has_altivec = 0;
+ size_t length = sizeof( has_altivec );
++#if SYS_MACOSX || SYS_OPENBSD
+ int error = sysctl( selectors, 2, &has_altivec, &length, NULL, 0 );
++#else
++ int error = sysctlbyname("hw.altivec", &has_altivec, &length, NULL, 0 );
++#endif
+
+ if( error == 0 && has_altivec != 0 )
+ cpu |= X264_CPU_ALTIVEC;
diff --git a/multimedia/libx264/pkg-descr b/multimedia/libx264/pkg-descr
new file mode 100644
index 000000000000..ebadb26dcee2
--- /dev/null
+++ b/multimedia/libx264/pkg-descr
@@ -0,0 +1,13 @@
+x264 is a free library for encoding H.264/AVC (aka MPEG-4 Part 10)
+video streams.
+
+Encoder features
+ * CAVLC/CABAC
+ * Multi-references
+ * Intra: all modes (4x4 and 16x16 with all predictions)
+ * Inter P: all partitions (from 16x16 down to 4x4)
+ * Inter B: partitions from 16x16 down to 8x8 (including SKIP/DIRECT)
+ * Ratecontrol: constant quantizer, constant bitrate, or multipass ABR
+ * Scene cut detection
+
+WWW: http://www.videolan.org/x264.html
diff --git a/multimedia/libx264/pkg-plist b/multimedia/libx264/pkg-plist
new file mode 100644
index 000000000000..cee118b2477b
--- /dev/null
+++ b/multimedia/libx264/pkg-plist
@@ -0,0 +1,7 @@
+include/x264.h
+include/x264_config.h
+lib/libx264.a
+lib/libx264.so
+lib/libx264.so.%%X264_BUILD%%
+@dir libdata/pkgconfig
+libdata/pkgconfig/x264.pc