Tweak multimedia/x264 version 0.142.2455_1
[dports.git] / multimedia / x264 / Makefile
1 # Created by: Michael Johnson <ahze@FreeBSD.org>
2 # $FreeBSD$
3 #
4 # Updating notes:
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
13 #
14 # distinfo for this port and libx264 should always be *identical*.
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=   1
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=        Front-end for encoding H.264/MPEG-4 AVC video
33
34 LICENSE=        GPLv2
35 LICENSE_FILE=   ${WRKSRC}/COPYING
36
37 BUILD_DEPENDS=  yasm>=1.2.0:${PORTSDIR}/devel/yasm \
38                 bash:${PORTSDIR}/shells/bash
39 LIB_DEPENDS=    libx264.so:${PORTSDIR}/multimedia/libx264
40
41 X264_BUILD=     142
42 X264_REV=       2455
43 X264_COMMIT=    021c0dc6c95c1bc239c9db78a80dd85fc856a4dd
44 X264_GITVER=    ${X264_COMMIT:C/^(.......).*$/\1/g}
45 X264_SNAPSHOT=  20140827
46
47 USES=           gmake pkgconfig tar:bzip2
48 USE_LDCONFIG=   yes
49 HAS_CONFIGURE=  yes
50
51 OPTIONS_DEFINE=         ASM DEBUG GCC GPAC LAVF PGO
52 OPTIONS_DEFAULT=        ASM GPAC
53
54 GCC_DESC=               Use current GCC
55 GPAC_DESC=              MPEG-4 output support
56 LAVF_DESC=              libav* format input/output support (requires FFmpeg)
57
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
67
68 CONFIGURE_ARGS+=        --extra-cflags="-I${LOCALBASE}/include" \
69                         --extra-ldflags="-L${LOCALBASE}/lib" \
70                         --disable-opencl \
71                         --system-libx264
72
73 CFLAGS_armv6+=          -mcpu=arm1136jf-s
74
75 PLIST_FILES=    bin/x264
76 PLIST_SUB+=     X264_BUILD=${X264_BUILD}
77
78 .include <bsd.port.options.mk>
79
80 .if ${PORT_OPTIONS:MGCC}
81 USE_GCC=        yes
82 .elif ${PORT_OPTIONS:MPGO}
83 USE_GCC=        any
84 .endif
85
86 .if ${PORT_OPTIONS:MPGO}
87 # y4m sample video
88 Y4M_VIDEO=              example.y4m
89 Y4M_VIDEO_DISTFILE=     example.y4m.bz2
90
91 DISTFILES+=     ${Y4M_VIDEO_DISTFILE}:pgo
92 ALL_TARGET=     fprofiled
93 MAKE_ENV+=      VIDS="${WRKDIR}/${Y4M_VIDEO}"
94
95 RESTRICTED=             ${Y4M_VIDEO_DISTFILE} file may not be mirrored
96 RESTRICTED_FILES=       ${Y4M_VIDEO_DISTFILE}
97 .endif
98
99 post-extract:
100 .if ${PORT_OPTIONS:MPGO}
101         @( cd ${WRKDIR} && ${BZIP2_CMD} -dc ${DISTDIR}/${DIST_SUBDIR}/${Y4M_VIDEO_DISTFILE} > ${Y4M_VIDEO} )
102 .endif
103
104 post-patch:
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' \
109                 ${WRKSRC}/configure
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}"|' \
113                 ${WRKSRC}/version.sh
114
115 pre-build:
116         @(${RM} ${WRKSRC}/x264_config.h)
117
118 post-install:
119         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/x264
120
121 .include <bsd.port.mk>