2014-11-22 17:23:34 +01:00
|
|
|
#
|
2015-07-03 09:02:44 +02:00
|
|
|
# NOTES FOR UPDATING PORT:
|
|
|
|
#
|
|
|
|
# We use tarballs from the *stable* branch of the upstream git repository.
|
|
|
|
#
|
|
|
|
# X264_BUILD is the "core" number, and can be found in x264.h.
|
|
|
|
#
|
|
|
|
# X264_REV requires a checkout the git revision for the version the port
|
|
|
|
# is being updated to. Then run version.sh against it.
|
2014-11-22 17:23:34 +01:00
|
|
|
#
|
|
|
|
# Bumping PORTREVISION for dependent ports? This is useful:
|
2019-12-21 20:00:27 +01:00
|
|
|
# fgrep -lr --include='*/Makefile*' :multimedia/libx264 $PORTSDIR |
|
|
|
|
# sed 's,/Makefile.*,,' | xargs $PORTSDIR/Tools/scripts/bump-revision.sh
|
|
|
|
# or
|
|
|
|
# rg -l :multimedia/libx264 $PORTSDIR | xargs -n1 portedit bump-revision -i
|
2005-01-12 05:57:18 +01:00
|
|
|
|
|
|
|
PORTNAME= x264
|
2010-11-30 10:50:47 +01:00
|
|
|
PORTVERSION= 0.${X264_BUILD}.${X264_REV}
|
2023-04-27 14:00:54 +02:00
|
|
|
PORTREVISION?= 2
|
2005-01-12 05:57:18 +01:00
|
|
|
CATEGORIES= multimedia
|
2019-12-21 20:00:27 +01:00
|
|
|
MASTER_SITES= https://samples.mplayerhq.hu/yuv4mpeg2/:pgo
|
2009-02-27 02:51:39 +01:00
|
|
|
DIST_SUBDIR= x264
|
2012-07-23 21:27:25 +02:00
|
|
|
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
|
2005-01-12 05:57:18 +01:00
|
|
|
|
2022-03-08 03:09:14 +01:00
|
|
|
MAINTAINER= bofh@FreeBSD.org
|
2015-07-03 09:02:44 +02:00
|
|
|
COMMENT?= H.264/MPEG-4 AVC Video Encoding (Front End CLI)
|
2022-09-07 23:06:12 +02:00
|
|
|
WWW= https://www.videolan.org/x264.html
|
2010-04-18 11:32:09 +02:00
|
|
|
|
2012-04-25 16:19:00 +02:00
|
|
|
LICENSE= GPLv2
|
2023-09-28 21:55:09 +02:00
|
|
|
LICENSE_NAME_PGO= PGO
|
2014-12-27 11:17:54 +01:00
|
|
|
LICENSE_FILE= ${WRKSRC}/COPYING
|
2023-09-28 21:55:09 +02:00
|
|
|
LICENSE_PERMS_PGO= auto-accept
|
|
|
|
# ${Y4M_VIDEO_DISTFILE} file may not be mirrored
|
|
|
|
LICENSE_DISTFILES_PGO= ${Y4M_VIDEO_DISTFILE}
|
2012-04-25 16:19:00 +02:00
|
|
|
|
2017-07-15 01:41:54 +02:00
|
|
|
BUILD_DEPENDS= bash:shells/bash
|
2016-04-13 11:52:35 +02:00
|
|
|
LIB_DEPENDS?= libx264.so:multimedia/libx264
|
2008-04-10 15:32:02 +02:00
|
|
|
|
2022-06-02 00:31:50 +02:00
|
|
|
X264_BUILD= 164
|
|
|
|
X264_REV= 3095
|
2023-07-12 14:13:03 +02:00
|
|
|
X264_GITVER= ${GL_TAGNAME:C/^(.{7}).*/\1/}
|
2011-03-22 09:08:48 +01:00
|
|
|
|
2016-04-13 11:52:35 +02:00
|
|
|
USES?= pkgconfig
|
2019-12-21 20:00:27 +01:00
|
|
|
USES+= compiler:c11 gmake localbase shebangfix
|
|
|
|
USE_GITLAB= yes
|
|
|
|
GL_SITE= https://code.videolan.org
|
|
|
|
GL_ACCOUNT= videolan
|
2023-07-12 14:13:03 +02:00
|
|
|
GL_TAGNAME= baee400fa9ced6f5481a728138fed6e867b0ff7f
|
2023-09-28 21:55:09 +02:00
|
|
|
USE_LDCONFIG= yes
|
|
|
|
|
2016-04-13 11:52:35 +02:00
|
|
|
SHEBANG_FILES= configure
|
2023-09-28 21:55:09 +02:00
|
|
|
|
|
|
|
HAS_CONFIGURE= yes
|
|
|
|
CONFIGURE_ARGS?= --system-libx264
|
|
|
|
CONFIGURE_ARGS+= --prefix="${PREFIX}" \
|
|
|
|
--extra-cflags="${CPPFLAGS} ${CFLAGS}" \
|
|
|
|
--extra-ldflags="${LDFLAGS}"
|
|
|
|
|
2016-04-13 11:52:35 +02:00
|
|
|
PLIST_FILES?= bin/x264
|
2005-01-12 05:57:18 +01:00
|
|
|
|
2020-11-07 16:49:38 +01:00
|
|
|
OPTIONS_DEFINE+= BASH DEBUG FFMS LAVF PGO SWSCALE
|
2023-09-28 21:55:09 +02:00
|
|
|
OPTIONS_DEFAULT+= BASH FFMS LAVF LSMASH SWSCALE
|
2016-04-13 11:53:47 +02:00
|
|
|
OPTIONS_RADIO+= MP4
|
|
|
|
OPTIONS_RADIO_MP4+= GPAC LSMASH
|
2014-12-27 11:17:54 +01:00
|
|
|
|
2020-05-18 07:43:24 +02:00
|
|
|
.if make(makesum) # for optional distfiles
|
|
|
|
.MAKEFLAGS: WITH="${OPTIONS_DEFINE}"
|
|
|
|
.endif
|
|
|
|
|
2016-04-13 11:53:47 +02:00
|
|
|
FFMS_DESC= FFmpeg Source input support
|
|
|
|
GPAC_DESC= GPAC library support
|
2016-04-13 11:53:15 +02:00
|
|
|
LAVF_DESC= libav* format input support (requires FFmpeg)
|
2016-04-13 11:53:47 +02:00
|
|
|
LSMASH_DESC= L-SMASH library support
|
|
|
|
MP4_DESC= MPEG-4 output
|
|
|
|
SWSCALE_DESC= Resize video filter
|
2005-01-12 05:57:18 +01:00
|
|
|
|
2020-11-07 16:49:38 +01:00
|
|
|
BASH_BUILD_DEPENDS= bash-completion>0:shells/bash-completion
|
|
|
|
BASH_RUN_DEPENDS= bash-completion>0:shells/bash-completion
|
|
|
|
BASH_CONFIGURE_ENABLE= bashcompletion
|
|
|
|
BASH_PLIST_FILES= share/bash-completion/completions/x264
|
2015-07-03 09:02:44 +02:00
|
|
|
DEBUG_CONFIGURE_OFF= --enable-strip
|
2023-09-28 21:55:09 +02:00
|
|
|
DEBUG_CONFIGURE_ENABLE= debug
|
|
|
|
FFMS_IMPLIES= SWSCALE
|
2016-04-13 11:53:47 +02:00
|
|
|
FFMS_LIB_DEPENDS= libffms2.so:multimedia/ffms2
|
2016-09-23 15:14:54 +02:00
|
|
|
FFMS_CONFIGURE_ENABLE= ffms
|
2016-04-01 16:16:16 +02:00
|
|
|
GPAC_LIB_DEPENDS= libgpac.so:multimedia/gpac-libgpac
|
2016-09-23 15:14:54 +02:00
|
|
|
GPAC_CONFIGURE_ENABLE= gpac
|
2023-09-28 21:55:09 +02:00
|
|
|
LAVF_IMPLIES= SWSCALE
|
2016-04-01 16:16:16 +02:00
|
|
|
LAVF_LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \
|
|
|
|
libavformat.so:multimedia/ffmpeg \
|
2016-04-13 11:53:47 +02:00
|
|
|
libavutil.so:multimedia/ffmpeg
|
2016-09-23 15:14:54 +02:00
|
|
|
LAVF_CONFIGURE_ENABLE= lavf
|
2016-04-13 11:53:47 +02:00
|
|
|
LSMASH_LIB_DEPENDS= liblsmash.so:multimedia/l-smash
|
2016-09-23 15:14:54 +02:00
|
|
|
LSMASH_CONFIGURE_ENABLE=lsmash
|
2016-04-13 11:52:35 +02:00
|
|
|
PGO_DISTFILES= ${Y4M_VIDEO_DISTFILE}:pgo
|
|
|
|
PGO_MAKE_ENV= VIDS="${WRKDIR}/${Y4M_VIDEO}"
|
|
|
|
PGO_ALL_TARGET= fprofiled
|
2023-09-28 21:55:09 +02:00
|
|
|
PGO_USE= GCC=yes
|
|
|
|
PGO_VARS= LICENSE+=PGO LICENSE_COMB=multi
|
2016-04-13 11:53:47 +02:00
|
|
|
SWSCALE_LIB_DEPENDS= libavutil.so:multimedia/ffmpeg \
|
|
|
|
libswscale.so:multimedia/ffmpeg
|
2016-09-23 15:14:54 +02:00
|
|
|
SWSCALE_CONFIGURE_ENABLE= swscale
|
2016-04-13 11:53:47 +02:00
|
|
|
|
2023-09-28 21:55:09 +02:00
|
|
|
# y4m sample video
|
|
|
|
Y4M_VIDEO= example.y4m
|
|
|
|
Y4M_VIDEO_DISTFILE= example.y4m.bz2
|
2009-02-27 02:51:39 +01:00
|
|
|
|
2016-04-13 11:52:35 +02:00
|
|
|
post-extract-PGO-on:
|
|
|
|
@${BZIP2_CMD} -dc ${DISTDIR}/${DIST_SUBDIR}/${Y4M_VIDEO_DISTFILE} \
|
|
|
|
>${WRKDIR}/${Y4M_VIDEO}
|
2009-02-27 02:51:39 +01:00
|
|
|
|
2006-05-10 13:44:28 +02:00
|
|
|
post-patch:
|
2015-07-03 09:02:44 +02:00
|
|
|
@${REINPLACE_CMD} -e ' \
|
2010-11-30 10:50:47 +01:00
|
|
|
s|gpac_static|gpac|g' \
|
2006-05-10 13:44:28 +02:00
|
|
|
${WRKSRC}/configure
|
2015-07-03 09:02:44 +02:00
|
|
|
@${REINPLACE_CMD} -e ' \
|
|
|
|
s|bash|sh|; \
|
2014-11-22 17:23:34 +01:00
|
|
|
s|VER="x"|VER="${X264_REV} ${X264_GITVER}"|; \
|
|
|
|
s|VERSION=""|VERSION=" r${X264_REV} ${X264_GITVER}"|' \
|
|
|
|
${WRKSRC}/version.sh
|
2014-12-27 11:17:54 +01:00
|
|
|
|
2016-04-13 11:52:35 +02:00
|
|
|
.if !target(pre-build)
|
2014-12-27 11:17:54 +01:00
|
|
|
pre-build:
|
|
|
|
@(${RM} ${WRKSRC}/x264_config.h)
|
2015-07-03 09:02:44 +02:00
|
|
|
.endif
|
2014-01-29 00:04:38 +01:00
|
|
|
|
2023-07-26 02:44:22 +02:00
|
|
|
.include <bsd.port.pre.mk>
|
multimedia/x264: fix build with llvm 16
common/ppc/pixel.c:1576:31: error: incompatible function pointer types assigning to 'x264_pixel_cmp_x3_t' (aka 'void (*)(unsigned char *, unsigned char *, unsigned char *, unsigned char *, long, int *)') from 'int (uint8_t *, uint8_t *, uint8_t *, uint8_t *, intptr_t, int *)' (aka 'int (unsigned char *, unsigned char *, unsigned char *, unsigned char *, long, int *)') [-Wincompatible-function-pointer-types]
pixf->sad_x3[PIXEL_8x16] = pixel_sad_x3_8x16_altivec;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
common/ppc/pixel.c:1578:31: error: incompatible function pointer types assigning to 'x264_pixel_cmp_x3_t' (aka 'void (*)(unsigned char *, unsigned char *, unsigned char *, unsigned char *, long, int *)') from 'int (uint8_t *, uint8_t *, uint8_t *, uint8_t *, intptr_t, int *)' (aka 'int (unsigned char *, unsigned char *, unsigned char *, unsigned char *, long, int *)') [-Wincompatible-function-pointer-types]
pixf->sad_x3[PIXEL_8x8] = pixel_sad_x3_8x8_altivec;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
common/ppc/pixel.c:1581:31: error: incompatible function pointer types assigning to 'x264_pixel_cmp_x4_t' (aka 'void (*)(unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *, long, int *)') from 'int (uint8_t *, uint8_t *, uint8_t *, uint8_t *, uint8_t *, intptr_t, int *)' (aka 'int (unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *, long, int *)') [-Wincompatible-function-pointer-types]
pixf->sad_x4[PIXEL_8x16] = pixel_sad_x4_8x16_altivec;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
common/ppc/pixel.c:1583:31: error: incompatible function pointer types assigning to 'x264_pixel_cmp_x4_t' (aka 'void (*)(unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *, long, int *)') from 'int (uint8_t *, uint8_t *, uint8_t *, uint8_t *, uint8_t *, intptr_t, int *)' (aka 'int (unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *, long, int *)') [-Wincompatible-function-pointer-types]
pixf->sad_x4[PIXEL_8x8] = pixel_sad_x4_8x8_altivec;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
2023-06-26 00:50:27 +02:00
|
|
|
|
2023-09-28 21:55:09 +02:00
|
|
|
.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 160 && !${PORT_OPTIONS:MPGO}
|
multimedia/x264: fix build with llvm 16
common/ppc/pixel.c:1576:31: error: incompatible function pointer types assigning to 'x264_pixel_cmp_x3_t' (aka 'void (*)(unsigned char *, unsigned char *, unsigned char *, unsigned char *, long, int *)') from 'int (uint8_t *, uint8_t *, uint8_t *, uint8_t *, intptr_t, int *)' (aka 'int (unsigned char *, unsigned char *, unsigned char *, unsigned char *, long, int *)') [-Wincompatible-function-pointer-types]
pixf->sad_x3[PIXEL_8x16] = pixel_sad_x3_8x16_altivec;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
common/ppc/pixel.c:1578:31: error: incompatible function pointer types assigning to 'x264_pixel_cmp_x3_t' (aka 'void (*)(unsigned char *, unsigned char *, unsigned char *, unsigned char *, long, int *)') from 'int (uint8_t *, uint8_t *, uint8_t *, uint8_t *, intptr_t, int *)' (aka 'int (unsigned char *, unsigned char *, unsigned char *, unsigned char *, long, int *)') [-Wincompatible-function-pointer-types]
pixf->sad_x3[PIXEL_8x8] = pixel_sad_x3_8x8_altivec;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
common/ppc/pixel.c:1581:31: error: incompatible function pointer types assigning to 'x264_pixel_cmp_x4_t' (aka 'void (*)(unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *, long, int *)') from 'int (uint8_t *, uint8_t *, uint8_t *, uint8_t *, uint8_t *, intptr_t, int *)' (aka 'int (unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *, long, int *)') [-Wincompatible-function-pointer-types]
pixf->sad_x4[PIXEL_8x16] = pixel_sad_x4_8x16_altivec;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
common/ppc/pixel.c:1583:31: error: incompatible function pointer types assigning to 'x264_pixel_cmp_x4_t' (aka 'void (*)(unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *, long, int *)') from 'int (uint8_t *, uint8_t *, uint8_t *, uint8_t *, uint8_t *, intptr_t, int *)' (aka 'int (unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *, long, int *)') [-Wincompatible-function-pointer-types]
pixf->sad_x4[PIXEL_8x8] = pixel_sad_x4_8x8_altivec;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
2023-06-26 00:50:27 +02:00
|
|
|
CFLAGS+= -Wno-error=incompatible-function-pointer-types
|
|
|
|
.endif
|
|
|
|
|
2023-07-26 02:44:22 +02:00
|
|
|
.include <bsd.port.post.mk>
|