1 # Created by: Michael Johnson <ahze@FreeBSD.org>
5 # We use the nightly tarballs for the *stable* branch of the git repo.
6 # X264_BUILD is the "core" number, and can always be found in x264.h.
7 # X264_COMMIT is the commit number, and can be found here:
8 # http://git.videolan.org/?p=x264.git;a=shortlog;h=refs/heads/stable
9 # To get X264_REV, you must checkout the git revision for the version to
10 # which you wish to update, and then run version.sh against it.
11 # Don't forget to update these for multimedia/libx264 as well:
12 # X264_BUILD, X264_REV, X264_COMMIT, X264_SNAPSHOT
14 # distinfo for this port and libx264 should always be *identical*.
16 # Bumping PORTREVISION for dependent ports? This is useful:
17 # cd $PORTSDIR; for x in $(find . -name "Makefile*" -print);
18 # do str=$(grep -i x264.so $x); if [[ -n $str ]] { echo "$x" }; done
21 PORTVERSION= 0.${X264_BUILD}.${X264_REV}
23 CATEGORIES= multimedia
24 MASTER_SITES= ftp://ftp.videolan.org/pub/videolan/x264/snapshots/ \
25 http://samples.mplayerhq.hu/yuv4mpeg2/:pgo
26 DISTNAME= ${PORTNAME}-snapshot-${X264_SNAPSHOT}-2245-stable
27 DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
29 EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
31 MAINTAINER= koobs@FreeBSD.org
32 COMMENT= Front-end for encoding H.264/MPEG-4 AVC video
35 LICENSE_FILE= ${WRKSRC}/COPYING
37 BUILD_DEPENDS= yasm>=1.2.0:${PORTSDIR}/devel/yasm \
38 bash:${PORTSDIR}/shells/bash
39 LIB_DEPENDS= libx264.so:${PORTSDIR}/multimedia/libx264
43 X264_COMMIT= 021c0dc6c95c1bc239c9db78a80dd85fc856a4dd
44 X264_GITVER= ${X264_COMMIT:C/^(.......).*$/\1/g}
45 X264_SNAPSHOT= 20140827
47 USES= gmake pkgconfig tar:bzip2
51 OPTIONS_DEFINE= ASM DEBUG GCC GPAC LAVF PGO
52 OPTIONS_DEFAULT= ASM GPAC
54 GCC_DESC= Use current GCC
55 GPAC_DESC= MPEG-4 output support
56 LAVF_DESC= libav* format input/output support (requires FFmpeg)
58 ASM_CONFIGURE_OFF= --disable-asm
59 DEBUG_CONFIGURE_ON= --enable-debug
60 GPAC_LIB_DEPENDS= libgpac.so:${PORTSDIR}/multimedia/gpac-libgpac
61 GPAC_CONFIGURE_OFF= --disable-gpac
62 LAVF_LIB_DEPENDS= libavcodec.so:${PORTSDIR}/multimedia/ffmpeg \
63 libavformat.so:${PORTSDIR}/multimedia/ffmpeg \
64 libavutil.so:${PORTSDIR}/multimedia/ffmpeg \
65 libswscale.so:${PORTSDIR}/multimedia/ffmpeg
66 LAVF_CONFIGURE_OFF= --disable-swscale --disable-lavf
68 CONFIGURE_ARGS+= --extra-cflags="-I${LOCALBASE}/include" \
69 --extra-ldflags="-L${LOCALBASE}/lib" \
73 CFLAGS_armv6+= -mcpu=arm1136jf-s
76 PLIST_SUB+= X264_BUILD=${X264_BUILD}
78 .include <bsd.port.options.mk>
80 .if ${PORT_OPTIONS:MGCC}
82 .elif ${PORT_OPTIONS:MPGO}
86 .if ${PORT_OPTIONS:MPGO}
88 Y4M_VIDEO= example.y4m
89 Y4M_VIDEO_DISTFILE= example.y4m.bz2
91 DISTFILES+= ${Y4M_VIDEO_DISTFILE}:pgo
93 MAKE_ENV+= VIDS="${WRKDIR}/${Y4M_VIDEO}"
95 RESTRICTED= ${Y4M_VIDEO_DISTFILE} file may not be mirrored
96 RESTRICTED_FILES= ${Y4M_VIDEO_DISTFILE}
100 .if ${PORT_OPTIONS:MPGO}
101 @( cd ${WRKDIR} && ${BZIP2_CMD} -dc ${DISTDIR}/${DIST_SUBDIR}/${Y4M_VIDEO_DISTFILE} > ${Y4M_VIDEO} )
105 @${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|; \
106 s|-lpthread|${PTHREAD_LIBS}|g; \
107 s|/bin/bash|${LOCALBASE}/bin/bash|; \
108 s|gpac_static|gpac|g' \
110 @${REINPLACE_CMD} -e 's|bash|sh|; \
111 s|VER="x"|VER="${X264_REV} ${X264_GITVER}"|; \
112 s|VERSION=""|VERSION=" r${X264_REV} ${X264_GITVER}"|' \
116 @(${RM} ${WRKSRC}/x264_config.h)
119 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/x264
121 .include <bsd.port.mk>