freebsd-ports/multimedia/x264/Makefile

134 lines
3.8 KiB
Makefile
Raw Normal View History

#
multimedia/{lib}x264: Update to 0.144.2533 and major refactor - Update to 0.144.2533 (from upstream stable branch) [1] - Switch x264 and libx264 ports to master/slave ports respectively - Bump PORTREVISION for dependent ports as the shared library version has changed. multimedia/x264: - Clean up and update "updating instructions" in Makefile header - Tweak COMMENT - Only LIB_DEPENDS on libx264 and add PLIST_FILES if this isn't the libx264 port. - Allow COMMENT, USES, OPTIONS_*, CONFIGURE_ARGS to be overriden in libx264 port. - Place common configure arguments in a CONFIGURE_COMMON_ARGS variable to make overriding values without duplication easier. - Use --prefix configure argument over post-patch replacements - Enable stripping of binaries and libraries if DEBUG is off. Remove post-install target STRIP_CMD accordingly. - Delete patch-Makefile in favour of patching WRKSRC/configure to identify amd64, arm64 and mipsn32. powerpc and powerpc64 are now covered upstream without needing patches. - Patch out a bogus compiler argument check (cc_check) that results in -Wno-maybe-uninitialized being added to CFLAGS causing causes warnings when clang is cc. The cc_check function checks for basename $CC to identify compiler type (icl, clang, gcc, etc). multimedia/libx264: - Remove all Makefile entries that are duplicated or common and found in the master port (x264). - Set lib as the PKGNAMEPREFIX - Tweak COMMENT - Delete upstreamed ARM patches [1] - Delete all but one patch, as they duplicate those in x264. - Dont remove pkgconfig/libdata directory Changes: https://git.videolan.org/?p=x264.git;a=shortlog;h=refs/heads/stable Based on: PR: 201260 [1] Submitted by: Andrey Cherkashin <andoriyu gmail com> [1]
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.
#
# Bumping PORTREVISION for dependent ports? This is useful:
# 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
PORTNAME= x264
2010-11-30 10:50:47 +01:00
PORTVERSION= 0.${X264_BUILD}.${X264_REV}
PORTREVISION?= 2
CATEGORIES= multimedia
MASTER_SITES= https://samples.mplayerhq.hu/yuv4mpeg2/:pgo
DIST_SUBDIR= x264
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
2022-03-08 03:09:14 +01:00
MAINTAINER= bofh@FreeBSD.org
multimedia/{lib}x264: Update to 0.144.2533 and major refactor - Update to 0.144.2533 (from upstream stable branch) [1] - Switch x264 and libx264 ports to master/slave ports respectively - Bump PORTREVISION for dependent ports as the shared library version has changed. multimedia/x264: - Clean up and update "updating instructions" in Makefile header - Tweak COMMENT - Only LIB_DEPENDS on libx264 and add PLIST_FILES if this isn't the libx264 port. - Allow COMMENT, USES, OPTIONS_*, CONFIGURE_ARGS to be overriden in libx264 port. - Place common configure arguments in a CONFIGURE_COMMON_ARGS variable to make overriding values without duplication easier. - Use --prefix configure argument over post-patch replacements - Enable stripping of binaries and libraries if DEBUG is off. Remove post-install target STRIP_CMD accordingly. - Delete patch-Makefile in favour of patching WRKSRC/configure to identify amd64, arm64 and mipsn32. powerpc and powerpc64 are now covered upstream without needing patches. - Patch out a bogus compiler argument check (cc_check) that results in -Wno-maybe-uninitialized being added to CFLAGS causing causes warnings when clang is cc. The cc_check function checks for basename $CC to identify compiler type (icl, clang, gcc, etc). multimedia/libx264: - Remove all Makefile entries that are duplicated or common and found in the master port (x264). - Set lib as the PKGNAMEPREFIX - Tweak COMMENT - Delete upstreamed ARM patches [1] - Delete all but one patch, as they duplicate those in x264. - Dont remove pkgconfig/libdata directory Changes: https://git.videolan.org/?p=x264.git;a=shortlog;h=refs/heads/stable Based on: PR: 201260 [1] Submitted by: Andrey Cherkashin <andoriyu gmail com> [1]
2015-07-03 09:02:44 +02:00
COMMENT?= H.264/MPEG-4 AVC Video Encoding (Front End CLI)
WWW= https://www.videolan.org/x264.html
2012-04-25 16:19:00 +02:00
LICENSE= GPLv2
LICENSE_NAME_PGO= PGO
LICENSE_FILE= ${WRKSRC}/COPYING
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
BUILD_DEPENDS= bash:shells/bash
LIB_DEPENDS?= libx264.so:multimedia/libx264
X264_BUILD= 164
X264_REV= 3095
X264_GITVER= ${GL_TAGNAME:C/^(.{7}).*/\1/}
2011-03-22 09:08:48 +01:00
USES?= pkgconfig
USES+= compiler:c11 gmake localbase shebangfix
USE_GITLAB= yes
GL_SITE= https://code.videolan.org
GL_ACCOUNT= videolan
GL_TAGNAME= baee400fa9ced6f5481a728138fed6e867b0ff7f
USE_LDCONFIG= yes
SHEBANG_FILES= configure
HAS_CONFIGURE= yes
CONFIGURE_ARGS?= --system-libx264
CONFIGURE_ARGS+= --prefix="${PREFIX}" \
--extra-cflags="${CPPFLAGS} ${CFLAGS}" \
--extra-ldflags="${LDFLAGS}"
PLIST_FILES?= bin/x264
OPTIONS_DEFINE+= BASH DEBUG FFMS LAVF PGO SWSCALE
OPTIONS_DEFAULT+= BASH FFMS LAVF LSMASH SWSCALE
OPTIONS_RADIO+= MP4
OPTIONS_RADIO_MP4+= GPAC LSMASH
.if make(makesum) # for optional distfiles
.MAKEFLAGS: WITH="${OPTIONS_DEFINE}"
.endif
FFMS_DESC= FFmpeg Source input support
GPAC_DESC= GPAC library support
LAVF_DESC= libav* format input support (requires FFmpeg)
LSMASH_DESC= L-SMASH library support
MP4_DESC= MPEG-4 output
SWSCALE_DESC= Resize video filter
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
multimedia/{lib}x264: Update to 0.144.2533 and major refactor - Update to 0.144.2533 (from upstream stable branch) [1] - Switch x264 and libx264 ports to master/slave ports respectively - Bump PORTREVISION for dependent ports as the shared library version has changed. multimedia/x264: - Clean up and update "updating instructions" in Makefile header - Tweak COMMENT - Only LIB_DEPENDS on libx264 and add PLIST_FILES if this isn't the libx264 port. - Allow COMMENT, USES, OPTIONS_*, CONFIGURE_ARGS to be overriden in libx264 port. - Place common configure arguments in a CONFIGURE_COMMON_ARGS variable to make overriding values without duplication easier. - Use --prefix configure argument over post-patch replacements - Enable stripping of binaries and libraries if DEBUG is off. Remove post-install target STRIP_CMD accordingly. - Delete patch-Makefile in favour of patching WRKSRC/configure to identify amd64, arm64 and mipsn32. powerpc and powerpc64 are now covered upstream without needing patches. - Patch out a bogus compiler argument check (cc_check) that results in -Wno-maybe-uninitialized being added to CFLAGS causing causes warnings when clang is cc. The cc_check function checks for basename $CC to identify compiler type (icl, clang, gcc, etc). multimedia/libx264: - Remove all Makefile entries that are duplicated or common and found in the master port (x264). - Set lib as the PKGNAMEPREFIX - Tweak COMMENT - Delete upstreamed ARM patches [1] - Delete all but one patch, as they duplicate those in x264. - Dont remove pkgconfig/libdata directory Changes: https://git.videolan.org/?p=x264.git;a=shortlog;h=refs/heads/stable Based on: PR: 201260 [1] Submitted by: Andrey Cherkashin <andoriyu gmail com> [1]
2015-07-03 09:02:44 +02:00
DEBUG_CONFIGURE_OFF= --enable-strip
DEBUG_CONFIGURE_ENABLE= debug
FFMS_IMPLIES= SWSCALE
FFMS_LIB_DEPENDS= libffms2.so:multimedia/ffms2
FFMS_CONFIGURE_ENABLE= ffms
GPAC_LIB_DEPENDS= libgpac.so:multimedia/gpac-libgpac
GPAC_CONFIGURE_ENABLE= gpac
LAVF_IMPLIES= SWSCALE
LAVF_LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \
libavformat.so:multimedia/ffmpeg \
libavutil.so:multimedia/ffmpeg
LAVF_CONFIGURE_ENABLE= lavf
LSMASH_LIB_DEPENDS= liblsmash.so:multimedia/l-smash
LSMASH_CONFIGURE_ENABLE=lsmash
PGO_DISTFILES= ${Y4M_VIDEO_DISTFILE}:pgo
PGO_MAKE_ENV= VIDS="${WRKDIR}/${Y4M_VIDEO}"
PGO_ALL_TARGET= fprofiled
PGO_USE= GCC=yes
PGO_VARS= LICENSE+=PGO LICENSE_COMB=multi
SWSCALE_LIB_DEPENDS= libavutil.so:multimedia/ffmpeg \
libswscale.so:multimedia/ffmpeg
SWSCALE_CONFIGURE_ENABLE= swscale
# y4m sample video
Y4M_VIDEO= example.y4m
Y4M_VIDEO_DISTFILE= example.y4m.bz2
post-extract-PGO-on:
@${BZIP2_CMD} -dc ${DISTDIR}/${DIST_SUBDIR}/${Y4M_VIDEO_DISTFILE} \
>${WRKDIR}/${Y4M_VIDEO}
post-patch:
multimedia/{lib}x264: Update to 0.144.2533 and major refactor - Update to 0.144.2533 (from upstream stable branch) [1] - Switch x264 and libx264 ports to master/slave ports respectively - Bump PORTREVISION for dependent ports as the shared library version has changed. multimedia/x264: - Clean up and update "updating instructions" in Makefile header - Tweak COMMENT - Only LIB_DEPENDS on libx264 and add PLIST_FILES if this isn't the libx264 port. - Allow COMMENT, USES, OPTIONS_*, CONFIGURE_ARGS to be overriden in libx264 port. - Place common configure arguments in a CONFIGURE_COMMON_ARGS variable to make overriding values without duplication easier. - Use --prefix configure argument over post-patch replacements - Enable stripping of binaries and libraries if DEBUG is off. Remove post-install target STRIP_CMD accordingly. - Delete patch-Makefile in favour of patching WRKSRC/configure to identify amd64, arm64 and mipsn32. powerpc and powerpc64 are now covered upstream without needing patches. - Patch out a bogus compiler argument check (cc_check) that results in -Wno-maybe-uninitialized being added to CFLAGS causing causes warnings when clang is cc. The cc_check function checks for basename $CC to identify compiler type (icl, clang, gcc, etc). multimedia/libx264: - Remove all Makefile entries that are duplicated or common and found in the master port (x264). - Set lib as the PKGNAMEPREFIX - Tweak COMMENT - Delete upstreamed ARM patches [1] - Delete all but one patch, as they duplicate those in x264. - Dont remove pkgconfig/libdata directory Changes: https://git.videolan.org/?p=x264.git;a=shortlog;h=refs/heads/stable Based on: PR: 201260 [1] Submitted by: Andrey Cherkashin <andoriyu gmail com> [1]
2015-07-03 09:02:44 +02:00
@${REINPLACE_CMD} -e ' \
2010-11-30 10:50:47 +01:00
s|gpac_static|gpac|g' \
${WRKSRC}/configure
multimedia/{lib}x264: Update to 0.144.2533 and major refactor - Update to 0.144.2533 (from upstream stable branch) [1] - Switch x264 and libx264 ports to master/slave ports respectively - Bump PORTREVISION for dependent ports as the shared library version has changed. multimedia/x264: - Clean up and update "updating instructions" in Makefile header - Tweak COMMENT - Only LIB_DEPENDS on libx264 and add PLIST_FILES if this isn't the libx264 port. - Allow COMMENT, USES, OPTIONS_*, CONFIGURE_ARGS to be overriden in libx264 port. - Place common configure arguments in a CONFIGURE_COMMON_ARGS variable to make overriding values without duplication easier. - Use --prefix configure argument over post-patch replacements - Enable stripping of binaries and libraries if DEBUG is off. Remove post-install target STRIP_CMD accordingly. - Delete patch-Makefile in favour of patching WRKSRC/configure to identify amd64, arm64 and mipsn32. powerpc and powerpc64 are now covered upstream without needing patches. - Patch out a bogus compiler argument check (cc_check) that results in -Wno-maybe-uninitialized being added to CFLAGS causing causes warnings when clang is cc. The cc_check function checks for basename $CC to identify compiler type (icl, clang, gcc, etc). multimedia/libx264: - Remove all Makefile entries that are duplicated or common and found in the master port (x264). - Set lib as the PKGNAMEPREFIX - Tweak COMMENT - Delete upstreamed ARM patches [1] - Delete all but one patch, as they duplicate those in x264. - Dont remove pkgconfig/libdata directory Changes: https://git.videolan.org/?p=x264.git;a=shortlog;h=refs/heads/stable Based on: PR: 201260 [1] Submitted by: Andrey Cherkashin <andoriyu gmail com> [1]
2015-07-03 09:02:44 +02:00
@${REINPLACE_CMD} -e ' \
s|bash|sh|; \
s|VER="x"|VER="${X264_REV} ${X264_GITVER}"|; \
s|VERSION=""|VERSION=" r${X264_REV} ${X264_GITVER}"|' \
${WRKSRC}/version.sh
.if !target(pre-build)
pre-build:
@(${RM} ${WRKSRC}/x264_config.h)
multimedia/{lib}x264: Update to 0.144.2533 and major refactor - Update to 0.144.2533 (from upstream stable branch) [1] - Switch x264 and libx264 ports to master/slave ports respectively - Bump PORTREVISION for dependent ports as the shared library version has changed. multimedia/x264: - Clean up and update "updating instructions" in Makefile header - Tweak COMMENT - Only LIB_DEPENDS on libx264 and add PLIST_FILES if this isn't the libx264 port. - Allow COMMENT, USES, OPTIONS_*, CONFIGURE_ARGS to be overriden in libx264 port. - Place common configure arguments in a CONFIGURE_COMMON_ARGS variable to make overriding values without duplication easier. - Use --prefix configure argument over post-patch replacements - Enable stripping of binaries and libraries if DEBUG is off. Remove post-install target STRIP_CMD accordingly. - Delete patch-Makefile in favour of patching WRKSRC/configure to identify amd64, arm64 and mipsn32. powerpc and powerpc64 are now covered upstream without needing patches. - Patch out a bogus compiler argument check (cc_check) that results in -Wno-maybe-uninitialized being added to CFLAGS causing causes warnings when clang is cc. The cc_check function checks for basename $CC to identify compiler type (icl, clang, gcc, etc). multimedia/libx264: - Remove all Makefile entries that are duplicated or common and found in the master port (x264). - Set lib as the PKGNAMEPREFIX - Tweak COMMENT - Delete upstreamed ARM patches [1] - Delete all but one patch, as they duplicate those in x264. - Dont remove pkgconfig/libdata directory Changes: https://git.videolan.org/?p=x264.git;a=shortlog;h=refs/heads/stable Based on: PR: 201260 [1] Submitted by: Andrey Cherkashin <andoriyu gmail com> [1]
2015-07-03 09:02:44 +02:00
.endif
.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
.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
.include <bsd.port.post.mk>