summaryrefslogtreecommitdiff
path: root/multimedia/intel-media-sdk/Makefile
blob: 98c7b614716c52730eee6c6646308e9cc94a79ee (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
54
55
56
57
58
59
60
61
62
63

PORTNAME=	intel-media-sdk
DISTVERSIONPREFIX=	intel-mediasdk-
DISTVERSION=	21.1.3
CATEGORIES=	multimedia

MAINTAINER=	jbeich@FreeBSD.org
COMMENT=	Hardware video decoding/encoding/filtering on Intel GPUs

LICENSE=	MIT
LICENSE_FILE=	${WRKSRC}/LICENSE

ONLY_FOR_ARCHS=	amd64 i386
ONLY_FOR_ARCHS_REASON=	Only Intel GPUs on x86 are supported

LIB_DEPENDS=	libva.so:multimedia/libva
RUN_DEPENDS=	cmrtlib>0:multimedia/cmrtlib

USES=		cmake compiler:c++11-lib pkgconfig
USE_GITHUB=	yes
USE_LDCONFIG=	yes
GH_ACCOUNT=	Intel-Media-SDK
GH_PROJECT=	MediaSDK
CMAKE_ON=	BUILD_TOOLS
PLIST_SUB=	ARCH_SUFX=${ARCH:S/i386/32/:S/amd//:S/x86_//}
# https://github.com/Intel-Media-SDK/MediaSDK/issues/1844
LLD_UNSAFE=	yes

OPTIONS_DEFINE=	OPENCL TEST WAYLAND X11
OPTIONS_DEFAULT=OPENCL WAYLAND X11
OPTIONS_SUB=	yes

OPENCL_BUILD_DEPENDS=	${LOCALBASE}/include/CL/opencl.h:devel/opencl
OPENCL_LIB_DEPENDS=	libOpenCL.so:devel/ocl-icd
OPENCL_CMAKE_BOOL=	ENABLE_OPENCL

X11_BUILD_DEPENDS=	${LOCALBASE}/include/xcb/dri3.h:x11/libxcb
X11_LIB_DEPENDS=	libva-x11.so:multimedia/libva
X11_CMAKE_BOOL=		ENABLE_X11 ENABLE_X11_DRI3

WAYLAND_LIB_DEPENDS=	libdrm_intel.so:graphics/libdrm \
			libwayland-client.so:graphics/wayland
WAYLAND_CMAKE_BOOL=	ENABLE_WAYLAND

TEST_BUILD_DEPENDS=	googletest>0:devel/googletest
TEST_USES=		localbase:ldflags
TEST_CMAKE_BOOL=	BUILD_TESTS USE_SYSTEM_GTEST
TEST_TEST_TARGET=	test

post-patch:
# Pick git commit from port and use reproducible time
	@${REINPLACE_CMD} -e "/COMMAND/s/date/& -r `${AWK} '/TIMESTAMP/ \
			{ print \$$3 }' ${DISTINFO_FILE}`/" \
		-e '/set( *git_commit/s/"[^"]*"/"${DISTVERSIONFULL}"/' \
		${WRKSRC}/builder/FindFunctions.cmake \
		${WRKSRC}/builder/FindGlobals.cmake
# Don't assume GCC and glibc libraries are available
	@${REINPLACE_CMD} -e 's/ -lstdc++ -ldl//' \
		${WRKSRC}/api/mfx_dispatch/linux/pkg-config*.cmake

pre-install-TEST-on: do-test

.include <bsd.port.mk>