summaryrefslogtreecommitdiff
path: root/x11/nvidia-hybrid-graphics/Makefile
blob: 5eea9fe8082a216e111d6cdd8844efef00d5c47d (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
PORTNAME=	nvidia-hybrid-graphics
PORTVERSION=	0.5
CATEGORIES=	x11
MASTER_SITES=	# none
DISTFILES=	# none

MAINTAINER=	theron.tarigo@gmail.com
COMMENT=	NVIDIA secondary GPU configuration - Optimus Technology support
WWW=		https://github.com/therontarigo/freebsd-gpu-headless

LICENSE=	BSD2CLAUSE

RUN_DEPENDS=	nvidia-xconfig:x11/nvidia-xconfig \
		${LOCALBASE}/bin/Xorg:x11-servers/xorg-server

FLAVORS=	default 390

NO_ARCH=	yes
NO_BUILD=	yes
WRKSRC=		${WRKDIR}/src

default_RUN_DEPENDS=	\
	nvidia-secondary-driver>=440.64:x11/nvidia-secondary-driver
390_RUN_DEPENDS=	\
	nvidia-secondary-driver-390>=390.87:x11/nvidia-secondary-driver-390

VIRTUALGL_RUN_DEPENDS=	${LOCALBASE}/VirtualGL/bin/vglrun:x11/virtualgl

390_PKGNAMESUFFIX=	-390

OPTIONS_DEFINE=		VIRTUALGL OPTIRUN
OPTIONS_DEFAULT=	VIRTUALGL OPTIRUN
OPTIONS_SUB=		OPTIRUN
VIRTUALGL_DESC=		Use VirtualGL for OpenGL redirection support
OPTIRUN_DESC=		Install "optirun" alias for nvrun-vgl
OPTIRUN_IMPLIES=	VIRTUALGL

scripts=	\
	bin/Xorg-nvidia-headless \
	bin/nvidia-headless-xconfig \
	bin/nvrun \
	bin/nvrun-vgl \
	libexec/nvidia-headless-utils/readconf \
	libexec/nvidia-settings-hybrid
configs=	\
	etc/X11/xorg-nvidia-headless-template.conf \
	etc/nvidia-headless.conf \
	etc/nvidia-hybrid.conf \

SUB_FILES=	pkg-message ${scripts:%=src/%} ${configs:%=src/%}
SUB_LIST+=	VGLRUN=${LOCALBASE}/VirtualGL/bin/vglrun

USE_RC_SUBR=	nvidia_xorg

do-extract:
.for f in ${SUB_FILES}
	${MKDIR} ${WRKDIR}/${f:H}
.endfor

do-install:
.for f in ${scripts}
	@${MKDIR} ${STAGEDIR}${PREFIX}/${f:H}
	${INSTALL_SCRIPT} ${WRKSRC}/${f} ${STAGEDIR}${PREFIX}/${f}
.endfor
.for f in ${configs}
	@${MKDIR} ${STAGEDIR}${PREFIX}/${f:H}
	${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${PREFIX}/${f}.sample
.endfor

post-install:
	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/X11/xorg-nvidia-headless.conf.d

post-install-OPTIRUN-on:
	@${RLN} ${STAGEDIR}${PREFIX}/bin/nvrun-vgl \
		${STAGEDIR}${PREFIX}/bin/optirun

.include <bsd.port.mk>