summaryrefslogtreecommitdiff
path: root/multimedia/svt-vp9/Makefile
blob: 0985cb7982f6b20bc9ded323217bb7488d0609e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# $FreeBSD$

PORTNAME=	svt-vp9
PORTVERSION=	s20190620
CATEGORIES=	multimedia

MAINTAINER=	jbeich@FreeBSD.org
COMMENT=	Scalable VP9 encoder

LICENSE=	BSD2CLAUSE+PATENT
LICENSE_GROUPS=	FSF OSI COPYFREE
LICENSE_NAME=	BSD-2-Clause Plus Patent License
LICENSE_FILE=	${WRKSRC}/LICENSE.md
LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept

ONLY_FOR_ARCHS=	amd64
ONLY_FOR_ARCHS_REASON=	uses x86-64 assembly

BUILD_DEPENDS=	nasm:devel/nasm

USES=		cmake compiler:c11
USE_GITHUB=	yes
USE_LDCONFIG=	yes
GH_ACCOUNT=	OpenVisualCloud
GH_PROJECT=	SVT-VP9
GH_TAGNAME=	8f99fda

post-patch:
# Default CFLAGS are already set by USES=cmake
	@${REINPLACE_CMD} -i .flags -E -e 's/ -mavx//' \
		-e 's/-O2 -flto //' \
		-e '/C_FLAGS_(RELEASE|DEBUG)/d' \
		-e '/NASM_FLAGS_DEBUG/d' \
		${WRKSRC}/CMakeLists.txt
# Avoid devel/yasm dependency
	@${REINPLACE_CMD} -i .typo 's/MAKE_ASM_NASM_COMPILER/s&/' \
		${WRKSRC}/CMakeLists.txt
# Avoid lang/gcc* dependency
	@${REINPLACE_CMD} -i .gcc -e 's/gcc-//' \
		-e '/CMAKE_C/{ s/STREQUAL/MATCHES/; s/"GNU/&|Clang/; }' \
		${WRKSRC}/CMakeLists.txt \
		${WRKSRC}/Source/Lib/*/CMakeLists.txt
# Avoid conflict with standard types
	@${GREP} -Flr '_T_DEFINED' ${WRKSRC} | ${XARGS} \
		${REINPLACE_CMD} -i .types 's/_T_DEFINED/_DEFINED/'
# Avoid platform whitelists for generic non-Windows code
	@${REINPLACE_CMD} -i .opsys 's/Linux/${OPSYS}/' \
		${WRKSRC}/CMakeLists.txt \
		${WRKSRC}/Source/Lib/*/CMakeLists.txt
	@${GREP} --exclude='*/third_party/*' -Flr '__linux' ${WRKSRC} | ${XARGS} \
		${REINPLACE_CMD} -i .opsys -E 's/__linux(__)?/__${OPSYS}__/'

.include <bsd.port.mk>