Tweak multimedia/mpeg_stat version 2.2b
[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?=  3
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=     144
42 X264_REV=       2533
43 X264_COMMIT=    c8a773ebfca148ef04f5a60d42cbd7336af0baf6
44 X264_GITVER=    ${X264_COMMIT:C/^(.......).*$/\1/g}
45 X264_SNAPSHOT=  20150629
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_OFF=      --disable-asm
67
68 DEBUG_CONFIGURE_ON=     --enable-debug
69 DEBUG_CONFIGURE_OFF=    --enable-strip
70
71 FFMS_LIB_DEPENDS=       libffms2.so:multimedia/ffms2
72 FFMS_CONFIGURE_OFF=     --disable-ffms
73 FFMS_IMPLIES=           SWSCALE
74
75 GCC_VARS=               USE_GCC=yes
76
77 GPAC_CONFIGURE_OFF=     --disable-gpac
78 GPAC_LIB_DEPENDS=       libgpac.so:multimedia/gpac-libgpac
79
80 LAVF_CONFIGURE_OFF=     --disable-lavf
81 LAVF_LIB_DEPENDS=       libavcodec.so:multimedia/ffmpeg \
82                         libavformat.so:multimedia/ffmpeg \
83                         libavutil.so:multimedia/ffmpeg
84 LAVF_IMPLIES=           SWSCALE
85
86 LSMASH_LIB_DEPENDS=     liblsmash.so:multimedia/l-smash
87 LSMASH_CONFIGURE_OFF=   --disable-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_CONFIGURE_OFF=  --disable-swscale
100 SWSCALE_LIB_DEPENDS=    libavutil.so:multimedia/ffmpeg \
101                         libswscale.so:multimedia/ffmpeg
102
103 CONFIGURE_ARGS?=        --system-libx264
104 CONFIGURE_ARGS+=        --prefix="${PREFIX}" \
105                         --extra-cflags="${CPPFLAGS} ${CFLAGS}" \
106                         --extra-ldflags="${LDFLAGS}" \
107                         --disable-opencl \
108
109 CFLAGS_armv6+=          -mcpu=arm1136jf-s
110
111 post-extract-PGO-on:
112         @${BZIP2_CMD} -dc ${DISTDIR}/${DIST_SUBDIR}/${Y4M_VIDEO_DISTFILE} \
113                 >${WRKDIR}/${Y4M_VIDEO}
114
115 post-patch:
116         @${REINPLACE_CMD} -e ' \
117                 s|gpac_static|gpac|g' \
118                 ${WRKSRC}/configure
119         @${REINPLACE_CMD} -e ' \
120                 s|bash|sh|; \
121                 s|VER="x"|VER="${X264_REV} ${X264_GITVER}"|; \
122                 s|VERSION=""|VERSION=" r${X264_REV} ${X264_GITVER}"|' \
123                 ${WRKSRC}/version.sh
124
125 .if !target(pre-build)
126 pre-build:
127         @(${RM} ${WRKSRC}/x264_config.h)
128 .endif
129
130 .include <bsd.port.mk>