summaryrefslogtreecommitdiff
path: root/www/linux-brave/Makefile
blob: ee68e029d7e262c52061cfce0118500707582924 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
PORTNAME=	brave
PORTVERSION=	${BRAVE_VER}
CATEGORIES=	www linux
MASTER_SITES=	https://github.com/${PORTNAME}/${PORTNAME}-browser/releases/download/v${PORTVERSION}/
PKGNAMEPREFIX=	linux-
DISTNAME=	${PORTNAME}-browser-${BRAVE_VER}-${BRAVE_BUILD}
DISTFILES_aarch64?=	${DISTNAME:S/$/${EXTRACT_SUFX_aarch64}/}
DISTFILES_amd64?=	${DISTNAME:S/$/${EXTRACT_SUFX_amd64}/}
EXTRACT_ONLY?=		${DISTFILES_${ARCH}:C/:[^:]+$//}

MAINTAINER=	emulation@FreeBSD.org
COMMENT=	Brave web browser based on WebKit
WWW=		https://www.brave.com

LICENSE=	MPL20

RUN_DEPENDS=	update-mime-database:misc/shared-mime-info

USES=		cpe desktop-file-utils gnome linux:rl9 shared-mime-info shebangfix
USE_LINUX=	alsalib alsa-plugins-oss alsa-plugins-pulseaudio at-spi2-atk \
		ca-certificates cairo cups-libs curl dbuslibs dri expat \
		ffmpeg-libs gnupg gstreamer1-libav gtk3 libxkbcommon \
		nspr nss p11-kit pango sqlite3 wget xorglibs
ONLY_FOR_ARCHS=	aarch64 amd64

SHEBANG_FILES=	opt/brave.com/brave/brave-browser

NO_BUILD=	yes
NO_WRKSUBDIR=	yes

EXTRACT_SUFX_aarch64?=	.aarch64.rpm
EXTRACT_SUFX_amd64?=	.x86_64.rpm

REINPLACE_ARGS=	-i ""

BRAVE_VER?=	1.84.141
BRAVE_BUILD?=	1

DATADIR=	${PREFIX}/share/${PORTNAME}
DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}

OPTIONS_DEFINE=	DOCS

SUB_FILES=	brave-browser

.if make(makesum) || make(checksum)
_ALL_DISTFILES=		${DISTFILES_aarch64} ${DISTFILES_amd64}
DISTFILES=		${_ALL_DISTFILES:O:u}
.      else
DISTFILES=		${DISTFILES_${ARCH}}
.endif

post-extract:
	@${REINPLACE_CMD} -e 's|/usr/bin/brave-browser-stable|${LOCALBASE}/bin/brave-browser|' \
		${WRKSRC}/usr/share/applications/brave-browser.desktop \
		${WRKSRC}/usr/share/applications/com.brave.Browser.desktop

do-install:
	${INSTALL_SCRIPT} ${WRKDIR}/brave-browser ${STAGEDIR}${PREFIX}/bin
	cd ${WRKSRC}/opt/brave.com && ${CP} -r brave ${STAGEDIR}${PREFIX}/share
	cd ${WRKSRC}/usr/share && ${COPYTREE_SHARE} \* ${STAGEDIR}${PREFIX}/share
.for sz in 16 24 32 48 64 128 256
	${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${sz}x${sz}/apps
	${CP} ${STAGEDIR}${DATADIR}/product_logo_${sz}.png ${STAGEDIR}${PREFIX}/share/icons/hicolor/${sz}x${sz}/apps/brave-browser.png
.endfor
	${MKDIR} ${STAGEDIR}/etc/brave/policies/managed
	${INSTALL_DATA} ${FILESDIR}/brave.json ${STAGEDIR}/etc/brave/policies/managed
	${INSTALL_DATA} ${FILESDIR}/webrtc.json ${STAGEDIR}/etc/brave/policies/managed

.include <bsd.port.mk>