aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia/svt-av1/Makefile
blob: 01b777cb4bfa1f958bd895c09194d6d9cea095cf (plain) (blame)
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
54
# $FreeBSD$

PORTNAME=   svt-av1
DISTVERSIONPREFIX=  v
DISTVERSION=    0.5.0-88
DISTVERSIONSUFFIX=  -g592a5848
CATEGORIES= multimedia

MAINTAINER= jbeich@FreeBSD.org
COMMENT=    Scalable AV1 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-AV1
CMAKE_ON=   BUILD_SHARED_LIBS

post-patch:
# Default CFLAGS are already set by USES=cmake
    @${REINPLACE_CMD} -i .flags -E -e 's/ -mavx//' \
        -e 's/CMAKE_C_FLAGS "/&$${CMAKE_C_FLAGS} /' \
        -e '/C_FLAGS_(RELEASE|DEBUG)/d' \
        -e '/NASM_FLAGS_DEBUG/d' \
        ${WRKSRC}/CMakeLists.txt
    @${REINPLACE_CMD} -i .flags -e 's/-march=core-avx2/-mavx2/' \
        ${WRKSRC}/Source/Lib/Common/ASM_AVX2/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/Common/*/CMakeLists.txt
# 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}__/'
# Avoid -msse4.1 for (unused) function not under Source/Lib/ASM_SSE4_1/
    @${REINPLACE_CMD} -e '/_sse4_1/,/}/d; /smmintrin\.h/d' \
        ${WRKSRC}/Source/Lib/Common/Codec/EbInterPrediction.c

.include <bsd.port.mk>