Tweak multimedia/gstreamer version 0.10.36_5
[dports.git] / multimedia / x264 / Makefile
1 # Created by: Michael Johnson <ahze@FreeBSD.org>
2 # $FreeBSD$
3 #
4 # NOTES FOR UPDATING PORT:
5 #
6 # We use tarballs from the *stable* branch of the upstream git repository.
7 #
8 # X264_BUILD is the "core" number, and can be found in x264.h.
9 #
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
12 #
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.
15 #
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
19
20 PORTNAME=       x264
21 PORTVERSION=    0.${X264_BUILD}.${X264_REV}
22 PORTREVISION?=  0
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}
28 DIST_SUBDIR=    x264
29 EXTRACT_ONLY=   ${DISTNAME}${EXTRACT_SUFX}
30
31 MAINTAINER=     koobs@FreeBSD.org
32 COMMENT?=       H.264/MPEG-4 AVC Video Encoding (Front End CLI)
33
34 LICENSE=        GPLv2
35 LICENSE_FILE=   ${WRKSRC}/COPYING
36
37 BUILD_DEPENDS=  yasm>=1.2.0:devel/yasm \
38                 bash:shells/bash
39 LIB_DEPENDS?=   libx264.so:multimedia/libx264
40
41 X264_BUILD=     148
42 X264_REV=       2728
43 X264_COMMIT=    4d5c8b01a48f72f9c40651e92c39294326a0863f
44 X264_GITVER=    ${X264_COMMIT:C/^(.......).*$/\1/g}
45 X264_SNAPSHOT=  20161202
46
47 USES?=          pkgconfig
48 USES+=          gmake localbase shebangfix tar:bzip2
49 USE_LDCONFIG=   yes
50 HAS_CONFIGURE=  yes
51 SHEBANG_FILES=  configure
52 PLIST_FILES?=   bin/x264
53
54 OPTIONS_DEFINE+=        ASM DEBUG FFMS GCC LAVF PGO SWSCALE
55 OPTIONS_RADIO+=         MP4
56 OPTIONS_RADIO_MP4+=     GPAC LSMASH
57 OPTIONS_DEFAULT+=       ASM LSMASH
58
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
65
66 ASM_CONFIGURE_ENABLE=   asm
67
68 DEBUG_CONFIGURE_ENABLE= debug
69 DEBUG_CONFIGURE_OFF=    --enable-strip
70
71 FFMS_LIB_DEPENDS=       libffms2.so:multimedia/ffms2
72 FFMS_CONFIGURE_ENABLE=  ffms
73 FFMS_IMPLIES=           SWSCALE
74
75 GCC_VARS=               USE_GCC=yes
76
77 GPAC_LIB_DEPENDS=       libgpac.so:multimedia/gpac-libgpac
78 GPAC_CONFIGURE_ENABLE=  gpac
79
80 LAVF_LIB_DEPENDS=       libavcodec.so:multimedia/ffmpeg \
81                         libavformat.so:multimedia/ffmpeg \
82                         libavutil.so:multimedia/ffmpeg
83 LAVF_CONFIGURE_ENABLE=  lavf
84 LAVF_IMPLIES=           SWSCALE
85
86 LSMASH_LIB_DEPENDS=     liblsmash.so:multimedia/l-smash
87 LSMASH_CONFIGURE_ENABLE=lsmash
88
89 PGO_DISTFILES=          ${Y4M_VIDEO_DISTFILE}:pgo
90 PGO_MAKE_ENV=           VIDS="${WRKDIR}/${Y4M_VIDEO}"
91 PGO_ALL_TARGET=         fprofiled
92 # y4m sample video
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}"
98
99 SWSCALE_LIB_DEPENDS=    libavutil.so:multimedia/ffmpeg \
100                         libswscale.so:multimedia/ffmpeg
101 SWSCALE_CONFIGURE_ENABLE=       swscale
102
103 CONFIGURE_ARGS?=        --system-libx264
104 CONFIGURE_ARGS+=        --prefix="${PREFIX}" \
105                         --extra-cflags="${CPPFLAGS} ${CFLAGS}" \
106                         --extra-ldflags="${LDFLAGS}"
107
108 post-extract-PGO-on:
109         @${BZIP2_CMD} -dc ${DISTDIR}/${DIST_SUBDIR}/${Y4M_VIDEO_DISTFILE} \
110                 >${WRKDIR}/${Y4M_VIDEO}
111
112 post-patch:
113         @${REINPLACE_CMD} -e ' \
114                 s|gpac_static|gpac|g' \
115                 ${WRKSRC}/configure
116         @${REINPLACE_CMD} -e ' \
117                 s|bash|sh|; \
118                 s|VER="x"|VER="${X264_REV} ${X264_GITVER}"|; \
119                 s|VERSION=""|VERSION=" r${X264_REV} ${X264_GITVER}"|' \
120                 ${WRKSRC}/version.sh
121
122 .if !target(pre-build)
123 pre-build:
124         @(${RM} ${WRKSRC}/x264_config.h)
125 .endif
126
127 .include <bsd.port.mk>