git: eb367c0419d8 - main - www/linux-brave: add new port (+)

From: Dima Panov <fluffy_at_FreeBSD.org>
Date: Thu, 07 Nov 2024 12:21:18 UTC
The branch main has been updated by fluffy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=eb367c0419d8cf4fb42ed4531159980be2287ccc

commit eb367c0419d8cf4fb42ed4531159980be2287ccc
Author:     Dima Panov <fluffy@FreeBSD.org>
AuthorDate: 2024-11-07 12:18:10 +0000
Commit:     Dima Panov <fluffy@FreeBSD.org>
CommitDate: 2024-11-07 12:21:08 +0000

    www/linux-brave: add new port (+)
    
    The chrome-driven web browser from Brave Software, Inc.
    
    Block ads. Save data. And get way faster webpages.
    
    Sponsored by:   Future Crew, LLC
---
 www/Makefile                           |   1 +
 www/linux-brave/Makefile               |  58 ++++++++++++
 www/linux-brave/distinfo               |   3 +
 www/linux-brave/files/brave-browser.in |  20 ++++
 www/linux-brave/files/brave.json       |   3 +
 www/linux-brave/files/webrtc.json      |   3 +
 www/linux-brave/pkg-descr              |   2 +
 www/linux-brave/pkg-plist              | 164 +++++++++++++++++++++++++++++++++
 8 files changed, 254 insertions(+)

diff --git a/www/Makefile b/www/Makefile
index 187ee5a0c824..ea896914a4ae 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -320,6 +320,7 @@
     SUBDIR += linklint
     SUBDIR += links
     SUBDIR += links1
+    SUBDIR += linux-brave
     SUBDIR += linux-c7-qtwebkit
     SUBDIR += linux-chrome
     SUBDIR += linux-freetube
diff --git a/www/linux-brave/Makefile b/www/linux-brave/Makefile
new file mode 100644
index 000000000000..fbf239b43dd2
--- /dev/null
+++ b/www/linux-brave/Makefile
@@ -0,0 +1,58 @@
+PORTNAME=	brave
+PORTVERSION=	${BRAVE_VER}
+CATEGORIES=	www linux
+MASTER_SITES=	https://github.com/${PORTNAME}/${PORTNAME}-browser/releases/download/v${PORTVERSION}/
+DISTNAME=	${PORTNAME}-browser-${BRAVE_VER}-${BRAVE_BUILD}${EXTRACT_SUFX_${ARCH}}
+PKGNAMEPREFIX=	linux-
+
+MAINTAINER=	emulation@FreeBSD.org
+COMMENT=	Brave web browser based on WebKit
+WWW=		https://www.brave.com
+
+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 ca-certificates \
+		cups-libs curl dbuslibs dri ffmpeg-libs gnupg gstreamer1-libav \
+		gtk3 libunistring nss p11-kit sqlite3 wget xorglibs
+ONLY_FOR_ARCHS=	amd64
+
+SHEBANG_FILES=	opt/brave.com/brave/brave-browser
+
+NO_BUILD=	yes
+NO_WRKSUBDIR=	yes
+
+EXTRACT_SUFX?=		.rpm
+EXTRACT_SUFX_aarch64?=	.aarch64
+EXTRACT_SUFX_amd64?=	.x86_64
+SRC_SUFX?=		.src${EXTRACT_SUFX}
+
+REINPLACE_ARGS=	-i ""
+
+BRAVE_VER?=	1.71.123
+BRAVE_BUILD?=	1
+
+DATADIR=	${PREFIX}/share/${PORTNAME}
+DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}
+
+OPTIONS_DEFINE=	DOCS
+
+SUB_FILES=	brave-browser
+
+post-extract:
+	@${REINPLACE_CMD} -e 's|/usr/bin/brave-browser-stable|${LOCALBASE}/bin/brave-browser|' \
+		${WRKSRC}/usr/share/applications/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>
diff --git a/www/linux-brave/distinfo b/www/linux-brave/distinfo
new file mode 100644
index 000000000000..39fe5bbc9948
--- /dev/null
+++ b/www/linux-brave/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1730981377
+SHA256 (brave-browser-1.71.123-1.x86_64.rpm) = 2db4d840b82bb87b76cb7ea6c02c7717bd0338d4204c11241759bc2a71e1fa4e
+SIZE (brave-browser-1.71.123-1.x86_64.rpm) = 122338289
diff --git a/www/linux-brave/files/brave-browser.in b/www/linux-brave/files/brave-browser.in
new file mode 100644
index 000000000000..ead841ed1121
--- /dev/null
+++ b/www/linux-brave/files/brave-browser.in
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+get_pa_sock_path()
+{
+	PA_SOCK_PATH=$(sockstat | awk -v me=$(whoami) -F'[ \t]+' '
+		$1 == me && $2 == "pulseaudio" && $6 ~ /native/ {
+			print $6;
+			exit 0
+		}'
+	)
+}
+
+get_pa_sock_path
+[ -S "$PA_SOCK_PATH" ] && export PULSE_SERVER=unix:$PA_SOCK_PATH && export PULSE_COOKIE="~/.config/pulse/cookie"
+
+export BRAVE_PATH="%%DATADIR%%/brave"
+export BRAVE_WRAPPER="$(readlink -f "$0")"
+export LIBGL_DRI3_DISABLE=1
+/usr/local/bin/brave-watch &
+exec "$BRAVE_PATH" --no-sandbox --no-zygote --test-type --v=0 "$@"
diff --git a/www/linux-brave/files/brave.json b/www/linux-brave/files/brave.json
new file mode 100644
index 000000000000..48e0f5dabb33
--- /dev/null
+++ b/www/linux-brave/files/brave.json
@@ -0,0 +1,3 @@
+{
+    "BraveRewardsDisabled": true
+}
diff --git a/www/linux-brave/files/webrtc.json b/www/linux-brave/files/webrtc.json
new file mode 100644
index 000000000000..e341c9248ec9
--- /dev/null
+++ b/www/linux-brave/files/webrtc.json
@@ -0,0 +1,3 @@
+{
+    "WebRtcIPHandling": "default_public_interface_only"
+}
diff --git a/www/linux-brave/pkg-descr b/www/linux-brave/pkg-descr
new file mode 100644
index 000000000000..9b2e84bc1a29
--- /dev/null
+++ b/www/linux-brave/pkg-descr
@@ -0,0 +1,2 @@
+The web browser from Brave
+Browse faster by blocking ads and trackers that violate your privacy and cost you time and money.
diff --git a/www/linux-brave/pkg-plist b/www/linux-brave/pkg-plist
new file mode 100644
index 000000000000..b6ae87254b04
--- /dev/null
+++ b/www/linux-brave/pkg-plist
@@ -0,0 +1,164 @@
+bin/brave-browser
+/%%ETCDIR%%/policies/managed/brave.json
+/%%ETCDIR%%/policies/managed/webrtc.json
+share/applications/brave-browser.desktop
+share/appdata/brave-browser.appdata.xml
+%%DATADIR%%/LICENSE
+%%DATADIR%%/MEIPreload/manifest.json
+%%DATADIR%%/MEIPreload/preloaded_data.pb
+%%DATADIR%%/PrivacySandboxAttestationsPreloaded/manifest.json
+%%DATADIR%%/PrivacySandboxAttestationsPreloaded/privacy-sandbox-attestations.dat
+%%DATADIR%%/brave
+%%DATADIR%%/brave-browser
+%%DATADIR%%/brave_100_percent.pak
+%%DATADIR%%/brave_200_percent.pak
+%%DATADIR%%/brave_resources.pak
+%%DATADIR%%/chrome-management-service
+%%DATADIR%%/chrome-sandbox
+%%DATADIR%%/chrome_100_percent.pak
+%%DATADIR%%/chrome_200_percent.pak
+%%DATADIR%%/chrome_crashpad_handler
+%%DATADIR%%/default-app-block
+%%DATADIR%%/icudtl.dat
+%%DATADIR%%/libEGL.so
+%%DATADIR%%/libGLESv2.so
+%%DATADIR%%/libqt5_shim.so
+%%DATADIR%%/libqt6_shim.so
+%%DATADIR%%/libvk_swiftshader.so
+%%DATADIR%%/libvulkan.so.1
+%%DATADIR%%/locales/af.pak
+%%DATADIR%%/locales/am.pak
+%%DATADIR%%/locales/ar.pak
+%%DATADIR%%/locales/bg.pak
+%%DATADIR%%/locales/bn.pak
+%%DATADIR%%/locales/ca.pak
+%%DATADIR%%/locales/cs.pak
+%%DATADIR%%/locales/da.pak
+%%DATADIR%%/locales/de.pak
+%%DATADIR%%/locales/el.pak
+%%DATADIR%%/locales/en-GB.pak
+%%DATADIR%%/locales/en-US.pak
+%%DATADIR%%/locales/es-419.pak
+%%DATADIR%%/locales/es.pak
+%%DATADIR%%/locales/et.pak
+%%DATADIR%%/locales/fa.pak
+%%DATADIR%%/locales/fi.pak
+%%DATADIR%%/locales/fil.pak
+%%DATADIR%%/locales/fr.pak
+%%DATADIR%%/locales/gu.pak
+%%DATADIR%%/locales/he.pak
+%%DATADIR%%/locales/hi.pak
+%%DATADIR%%/locales/hr.pak
+%%DATADIR%%/locales/hu.pak
+%%DATADIR%%/locales/id.pak
+%%DATADIR%%/locales/it.pak
+%%DATADIR%%/locales/ja.pak
+%%DATADIR%%/locales/kn.pak
+%%DATADIR%%/locales/ko.pak
+%%DATADIR%%/locales/lt.pak
+%%DATADIR%%/locales/lv.pak
+%%DATADIR%%/locales/ml.pak
+%%DATADIR%%/locales/mr.pak
+%%DATADIR%%/locales/ms.pak
+%%DATADIR%%/locales/nb.pak
+%%DATADIR%%/locales/nl.pak
+%%DATADIR%%/locales/pl.pak
+%%DATADIR%%/locales/pt-BR.pak
+%%DATADIR%%/locales/pt-PT.pak
+%%DATADIR%%/locales/ro.pak
+%%DATADIR%%/locales/ru.pak
+%%DATADIR%%/locales/sk.pak
+%%DATADIR%%/locales/sl.pak
+%%DATADIR%%/locales/sr.pak
+%%DATADIR%%/locales/sv.pak
+%%DATADIR%%/locales/sw.pak
+%%DATADIR%%/locales/ta.pak
+%%DATADIR%%/locales/te.pak
+%%DATADIR%%/locales/th.pak
+%%DATADIR%%/locales/tr.pak
+%%DATADIR%%/locales/uk.pak
+%%DATADIR%%/locales/ur.pak
+%%DATADIR%%/locales/vi.pak
+%%DATADIR%%/locales/zh-CN.pak
+%%DATADIR%%/locales/zh-TW.pak
+%%DATADIR%%/product_logo_128.png
+%%DATADIR%%/product_logo_16.png
+%%DATADIR%%/product_logo_24.png
+%%DATADIR%%/product_logo_256.png
+%%DATADIR%%/product_logo_32.png
+%%DATADIR%%/product_logo_32.xpm
+%%DATADIR%%/product_logo_48.png
+%%DATADIR%%/product_logo_64.png
+%%DATADIR%%/resources.pak
+%%DATADIR%%/resources/brave_extension/_locales/af/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/am/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/ar/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/bg/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/bn/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/ca/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/cs/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/da/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/de/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/el/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/en_GB/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/en_US/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/es/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/es_419/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/et/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/fa/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/fi/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/fil/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/fr/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/gu/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/he/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/hi/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/hr/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/hu/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/id/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/it/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/ja/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/kn/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/ko/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/lt/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/lv/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/ml/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/mr/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/ms/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/nb/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/nl/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/pl/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/pt_BR/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/pt_PT/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/ro/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/ru/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/sk/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/sl/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/sr/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/sv/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/sw/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/ta/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/te/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/th/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/tr/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/uk/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/ur/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/vi/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/zh_CN/messages.json
+%%DATADIR%%/resources/brave_extension/_locales/zh_TW/messages.json
+%%DATADIR%%/v8_context_snapshot.bin
+%%DATADIR%%/vk_swiftshader_icd.json
+%%DATADIR%%/xdg-mime
+%%DATADIR%%/xdg-settings
+share/gnome-control-center/default-apps/brave-browser.xml
+share/icons/hicolor/128x128/apps/brave-browser.png
+share/icons/hicolor/16x16/apps/brave-browser.png
+share/icons/hicolor/24x24/apps/brave-browser.png
+share/icons/hicolor/256x256/apps/brave-browser.png
+share/icons/hicolor/32x32/apps/brave-browser.png
+share/icons/hicolor/48x48/apps/brave-browser.png
+share/icons/hicolor/64x64/apps/brave-browser.png
+share/man/man1/brave-browser-stable.1.gz
+share/man/man1/brave-browser.1.gz
+@dir /%%ETCDIR%%/policies/managed
+@dir /%%ETCDIR%%/policies
+@dir /%%ETCDIR%%