1 # Created by: Michael Johnson <ahze@FreeBSD.org>
4 # NOTES FOR UPDATING PORT:
6 # We use tarballs from the *stable* branch of the upstream git repository.
8 # X264_BUILD is the "core" number, and can be found in x264.h.
10 # X264_COMMIT is the commit number, and can be found here:
11 # http://git.videolan.org/?p=x264.git;a=shortlog;h=refs/heads/stable
13 # X264_REV requires a checkout the git revision for the version the port
14 # is being updated to. Then run version.sh against it.
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?= H.264/MPEG-4 AVC Video Encoding (Front End CLI)
35 LICENSE_FILE= ${WRKSRC}/COPYING
37 BUILD_DEPENDS= yasm>=1.2.0:devel/yasm \
39 LIB_DEPENDS?= libx264.so:multimedia/libx264
43 X264_COMMIT= 4d5c8b01a48f72f9c40651e92c39294326a0863f
44 X264_GITVER= ${X264_COMMIT:C/^(.......).*$/\1/g}
45 X264_SNAPSHOT= 20161202
48 USES+= gmake localbase shebangfix tar:bzip2
51 SHEBANG_FILES= configure
52 PLIST_FILES?= bin/x264
54 OPTIONS_DEFINE+= ASM DEBUG FFMS GCC LAVF PGO SWSCALE
56 OPTIONS_RADIO_MP4+= GPAC LSMASH
57 OPTIONS_DEFAULT+= ASM LSMASH
59 FFMS_DESC= FFmpeg Source input support
60 GPAC_DESC= GPAC library support
61 LAVF_DESC= libav* format input support (requires FFmpeg)
62 LSMASH_DESC= L-SMASH library support
63 MP4_DESC= MPEG-4 output
64 SWSCALE_DESC= Resize video filter
66 ASM_CONFIGURE_ENABLE= asm
68 DEBUG_CONFIGURE_ENABLE= debug
69 DEBUG_CONFIGURE_OFF= --enable-strip
71 FFMS_LIB_DEPENDS= libffms2.so:multimedia/ffms2
72 FFMS_CONFIGURE_ENABLE= ffms
77 GPAC_LIB_DEPENDS= libgpac.so:multimedia/gpac-libgpac
78 GPAC_CONFIGURE_ENABLE= gpac
80 LAVF_LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \
81 libavformat.so:multimedia/ffmpeg \
82 libavutil.so:multimedia/ffmpeg
83 LAVF_CONFIGURE_ENABLE= lavf
86 LSMASH_LIB_DEPENDS= liblsmash.so:multimedia/l-smash
87 LSMASH_CONFIGURE_ENABLE=lsmash
89 PGO_DISTFILES= ${Y4M_VIDEO_DISTFILE}:pgo
90 PGO_MAKE_ENV= VIDS="${WRKDIR}/${Y4M_VIDEO}"
91 PGO_ALL_TARGET= fprofiled
93 Y4M_VIDEO= example.y4m
94 Y4M_VIDEO_DISTFILE= example.y4m.bz2
95 PGO_VARS= USE_GCC=any \
96 RESTRICTED="${Y4M_VIDEO_DISTFILE} file may not be mirrored" \
97 RESTRICTED_FILES="${Y4M_VIDEO_DISTFILE}"
99 SWSCALE_LIB_DEPENDS= libavutil.so:multimedia/ffmpeg \
100 libswscale.so:multimedia/ffmpeg
101 SWSCALE_CONFIGURE_ENABLE= swscale
103 CONFIGURE_ARGS?= --system-libx264
104 CONFIGURE_ARGS+= --prefix="${PREFIX}" \
105 --extra-cflags="${CPPFLAGS} ${CFLAGS}" \
106 --extra-ldflags="${LDFLAGS}"
109 @${BZIP2_CMD} -dc ${DISTDIR}/${DIST_SUBDIR}/${Y4M_VIDEO_DISTFILE} \
110 >${WRKDIR}/${Y4M_VIDEO}
113 @${REINPLACE_CMD} -e ' \
114 s|gpac_static|gpac|g' \
116 @${REINPLACE_CMD} -e ' \
118 s|VER="x"|VER="${X264_REV} ${X264_GITVER}"|; \
119 s|VERSION=""|VERSION=" r${X264_REV} ${X264_GITVER}"|' \
122 .if !target(pre-build)
124 @(${RM} ${WRKSRC}/x264_config.h)
127 .include <bsd.port.mk>