diff options
author | jbeich <jbeich@FreeBSD.org> | 2016-04-13 17:52:35 +0800 |
---|---|---|
committer | jbeich <jbeich@FreeBSD.org> | 2016-04-13 17:52:35 +0800 |
commit | 91e2b69ec229c112badfa18a3397c0b91567be06 (patch) | |
tree | 6c29ddd23aa0195c990c51b743854117875e04ad /multimedia | |
parent | 3ae8ddc4c4a87c99b4a15db779df7e8023476c7f (diff) | |
download | freebsd-ports-gnome-91e2b69ec229c112badfa18a3397c0b91567be06.tar.gz freebsd-ports-gnome-91e2b69ec229c112badfa18a3397c0b91567be06.tar.zst freebsd-ports-gnome-91e2b69ec229c112badfa18a3397c0b91567be06.zip |
multimedia/{,lib}x264: modernize
- Convert to option helpers
- Convert to USES=localbase + respect CPPFLAGS
- Convert to USES=shebangfix (can be zsh->bash symlink)
- Simplify SLAVE_PORT conditionals into ?=, += and !target()
- Drop unnecessary `cd` before PGO sample
- Drop no longer necessary .include <bsd.port.options.mk>
Approved by: koobs (maintainer, via private mail)
Differential Revision: https://reviews.freebsd.org/D5862
Diffstat (limited to 'multimedia')
-rw-r--r-- | multimedia/libx264/Makefile | 13 | ||||
-rw-r--r-- | multimedia/x264/Makefile | 66 |
2 files changed, 34 insertions, 45 deletions
diff --git a/multimedia/libx264/Makefile b/multimedia/libx264/Makefile index d18c637f3f16..1a2541e49e21 100644 --- a/multimedia/libx264/Makefile +++ b/multimedia/libx264/Makefile @@ -9,23 +9,26 @@ COMMENT= H.264/MPEG-4 AVC Video Encoding (Library) MASTERDIR= ${.CURDIR}/../x264 PLIST= ${.CURDIR}/pkg-plist -USES= gmake pathfix tar:bzip2 +LIB_DEPENDS= # -OPTIONS_DEFINE= ASM DEBUG GCC HI10P PGO -OPTIONS_EXCLUDE= GPAC LAV +USES= pathfix -DEBUG_CONFIGURE_OFF= --enable-strip +OPTIONS_DEFINE= HI10P +OPTIONS_EXCLUDE= GPAC LAVF HI10P_DESC= Enable High 10 Profile 10-bit encoding HI10P_CONFIGURE_ON= --bit-depth=10 -CONFIGURE_ARGS= ${CONFIGURE_COMMON_ARGS} \ +CONFIGURE_ARGS= \ --enable-static \ --enable-shared \ --disable-cli PATHFIX_MAKEFILEIN= Makefile +PLIST_FILES= # PLIST_SUB+= X264_BUILD=${X264_BUILD} +pre-build: + .include "${MASTERDIR}/Makefile" diff --git a/multimedia/x264/Makefile b/multimedia/x264/Makefile index 961bbef70f65..b999d32f52dc 100644 --- a/multimedia/x264/Makefile +++ b/multimedia/x264/Makefile @@ -36,6 +36,7 @@ LICENSE_FILE= ${WRKSRC}/COPYING BUILD_DEPENDS= yasm>=1.2.0:devel/yasm \ bash:shells/bash +LIB_DEPENDS?= libx264.so:multimedia/libx264 X264_BUILD= 144 X264_REV= 2533 @@ -43,12 +44,15 @@ X264_COMMIT= c8a773ebfca148ef04f5a60d42cbd7336af0baf6 X264_GITVER= ${X264_COMMIT:C/^(.......).*$/\1/g} X264_SNAPSHOT= 20150629 -USES?= gmake pkgconfig tar:bzip2 +USES?= pkgconfig +USES+= gmake localbase shebangfix tar:bzip2 USE_LDCONFIG= yes HAS_CONFIGURE= yes +SHEBANG_FILES= configure +PLIST_FILES?= bin/x264 -OPTIONS_DEFINE?= ASM DEBUG GCC GPAC LAVF PGO -OPTIONS_DEFAULT?= ASM GPAC +OPTIONS_DEFINE+= ASM DEBUG GCC GPAC LAVF PGO +OPTIONS_DEFAULT+= ASM GPAC GPAC_DESC= MPEG-4 output support LAVF_DESC= libav* format input/output support (requires FFmpeg) @@ -58,6 +62,8 @@ ASM_CONFIGURE_OFF= --disable-asm DEBUG_CONFIGURE_ON= --enable-debug DEBUG_CONFIGURE_OFF= --enable-strip +GCC_VARS= USE_GCC=yes + GPAC_CONFIGURE_OFF= --disable-gpac GPAC_LIB_DEPENDS= libgpac.so:multimedia/gpac-libgpac @@ -67,50 +73,30 @@ LAVF_LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \ libavutil.so:multimedia/ffmpeg \ libswscale.so:multimedia/ffmpeg -CONFIGURE_COMMON_ARGS= --prefix=${PREFIX} \ - --extra-cflags="-I${LOCALBASE}/include" \ - --extra-ldflags="-L${LOCALBASE}/lib" \ - --disable-opencl \ - -CONFIGURE_ARGS?= ${CONFIGURE_COMMON_ARGS} \ - --system-libx264 - -CFLAGS_armv6+= -mcpu=arm1136jf-s - -.include <bsd.port.options.mk> - -.if ${SLAVE_PORT} == "no" -PLIST_FILES+= bin/x264 -LIB_DEPENDS+= libx264.so:multimedia/libx264 -.endif - -.if ${PORT_OPTIONS:MGCC} -USE_GCC= yes -.elif ${PORT_OPTIONS:MPGO} -USE_GCC= any -.endif - -.if ${PORT_OPTIONS:MPGO} +PGO_DISTFILES= ${Y4M_VIDEO_DISTFILE}:pgo +PGO_MAKE_ENV= VIDS="${WRKDIR}/${Y4M_VIDEO}" +PGO_ALL_TARGET= fprofiled # y4m sample video Y4M_VIDEO= example.y4m Y4M_VIDEO_DISTFILE= example.y4m.bz2 +PGO_VARS= USE_GCC=any \ + RESTRICTED="${Y4M_VIDEO_DISTFILE} file may not be mirrored" \ + RESTRICTED_FILES="${Y4M_VIDEO_DISTFILE}" + +CONFIGURE_ARGS?= --system-libx264 +CONFIGURE_ARGS+= --prefix="${PREFIX}" \ + --extra-cflags="${CPPFLAGS} ${CFLAGS}" \ + --extra-ldflags="${LDFLAGS}" \ + --disable-opencl \ -DISTFILES+= ${Y4M_VIDEO_DISTFILE}:pgo -ALL_TARGET= fprofiled -MAKE_ENV+= VIDS="${WRKDIR}/${Y4M_VIDEO}" - -RESTRICTED= ${Y4M_VIDEO_DISTFILE} file may not be mirrored -RESTRICTED_FILES= ${Y4M_VIDEO_DISTFILE} -.endif +CFLAGS_armv6+= -mcpu=arm1136jf-s -post-extract: -.if ${PORT_OPTIONS:MPGO} - @( cd ${WRKDIR} && ${BZIP2_CMD} -dc ${DISTDIR}/${DIST_SUBDIR}/${Y4M_VIDEO_DISTFILE} > ${Y4M_VIDEO} ) -.endif +post-extract-PGO-on: + @${BZIP2_CMD} -dc ${DISTDIR}/${DIST_SUBDIR}/${Y4M_VIDEO_DISTFILE} \ + >${WRKDIR}/${Y4M_VIDEO} post-patch: @${REINPLACE_CMD} -e ' \ - s|/bin/bash|${LOCALBASE}/bin/bash|; \ s|gpac_static|gpac|g' \ ${WRKSRC}/configure @${REINPLACE_CMD} -e ' \ @@ -119,7 +105,7 @@ post-patch: s|VERSION=""|VERSION=" r${X264_REV} ${X264_GITVER}"|' \ ${WRKSRC}/version.sh -.if ${SLAVE_PORT} == "no" +.if !target(pre-build) pre-build: @(${RM} ${WRKSRC}/x264_config.h) .endif |