git: 94da4f18e407 - main - finance/linux-tradingview: Desktop application for TradingView service

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Sun, 30 Jun 2024 11:02:46 UTC
The branch main has been updated by arrowd:

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

commit 94da4f18e407478c7d0d9e98bf2f3eb20f8e8f15
Author:     Alexey Donskov <aadonsk4@mts.ru>
AuthorDate: 2024-06-26 11:23:10 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2024-06-30 11:02:42 +0000

    finance/linux-tradingview: Desktop application for TradingView service
    
    Sponsored by:   Serenity Cybersecurity, LLC
---
 finance/Makefile                                   |  1 +
 finance/linux-tradingview/Makefile                 | 43 ++++++++++++
 finance/linux-tradingview/distinfo                 |  3 +
 .../files/com.tradingview.tradingview.appdata.xml  | 33 +++++++++
 finance/linux-tradingview/files/tradingview.in     |  8 +++
 finance/linux-tradingview/pkg-descr                |  1 +
 finance/linux-tradingview/pkg-plist                | 79 ++++++++++++++++++++++
 7 files changed, 168 insertions(+)

diff --git a/finance/Makefile b/finance/Makefile
index 3e8f627ce8b3..e084a747132d 100644
--- a/finance/Makefile
+++ b/finance/Makefile
@@ -46,6 +46,7 @@
     SUBDIR += libbtc
     SUBDIR += libofx
     SUBDIR += libstocks
+    SUBDIR += linux-tradingview
     SUBDIR += lnd
     SUBDIR += moneymanagerex
     SUBDIR += myphpmoney
diff --git a/finance/linux-tradingview/Makefile b/finance/linux-tradingview/Makefile
new file mode 100644
index 000000000000..2992a03002f1
--- /dev/null
+++ b/finance/linux-tradingview/Makefile
@@ -0,0 +1,43 @@
+PORTNAME=	tradingview
+PORTVERSION=	2.7.8
+CATEGORIES=	finance linux
+MASTER_SITES=	https://tvd-packages.tradingview.com/ubuntu/stable/latest/jammy/
+PKGNAMEPREFIX=	linux-
+DISTNAME=	tradingview_amd64
+EXTRACT_SUFX=	.deb
+EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX}
+
+MAINTAINER=	aadonsk4@mts.ru
+COMMENT=	Desktop trading application
+WWW=		https://www.tradingview.com
+
+LICENSE=	PROPRIETARY
+LICENSE_NAME=	PROPRIETARY
+LICENSE_TEXT=	https://www.tradingview.com/desktop/
+LICENSE_PERMS=	none
+
+ONLY_FOR_ARCHS=	amd64
+
+USES=		desktop-file-utils linux:rl9
+
+USE_LINUX=	alsalib at-spi2-core cups-libs gtk3 libdrm libsecret nss
+
+SUB_FILES=	tradingview
+NO_BUILD=	yes
+
+post-extract:
+	cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} data.tar.xz ${EXTRACT_AFTER_ARGS}
+
+do-install:
+	cd ${WRKDIR}/opt/TradingView && ${COPYTREE_SHARE} \* ${STAGEDIR}${DATADIR}
+	${CHMOD} +x ${STAGEDIR}${DATADIR}/tradingview
+	${INSTALL_SCRIPT} ${WRKDIR}/tradingview ${STAGEDIR}${PREFIX}/bin
+	${SED} 's|/opt/TradingView/tradingview|${PREFIX}/bin/tradingview|g' ${WRKDIR}/usr/share/applications/tradingview.desktop > ${STAGEDIR}${DESKTOPDIR}/tradingview.desktop
+	@${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/512x512/apps
+	${INSTALL_DATA} ${WRKDIR}/usr/share/icons/hicolor/512x512/apps/tradingview.png ${STAGEDIR}${PREFIX}/share/icons/hicolor/512x512/apps
+	@${MKDIR} ${STAGEDIR}${PREFIX}/share/metainfo
+	${INSTALL_DATA} ${FILESDIR}/com.tradingview.tradingview.appdata.xml ${STAGEDIR}${PREFIX}/share/metainfo/
+	${STRIP_CMD} ${STAGEDIR}${DATADIR}/libvulkan.so.1
+	${STRIP_CMD} ${STAGEDIR}${DATADIR}/chrome-sandbox
+
+.include <bsd.port.mk>
diff --git a/finance/linux-tradingview/distinfo b/finance/linux-tradingview/distinfo
new file mode 100644
index 000000000000..c2cd53bdcc22
--- /dev/null
+++ b/finance/linux-tradingview/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1719325143
+SHA256 (tradingview_amd64.deb) = 9dae1892f578bfb3c24f45201afd011f1cb757026706eb66f847f3252ac04df6
+SIZE (tradingview_amd64.deb) = 83806256
diff --git a/finance/linux-tradingview/files/com.tradingview.tradingview.appdata.xml b/finance/linux-tradingview/files/com.tradingview.tradingview.appdata.xml
new file mode 100644
index 000000000000..5f14d6d7ac07
--- /dev/null
+++ b/finance/linux-tradingview/files/com.tradingview.tradingview.appdata.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component type="desktop-application">
+    <id>com.tradingview.tradingview</id>
+    <metadata_license>CC0-1.0</metadata_license>
+    <project_license>LicenseRef-EULA-1</project_license>
+    <name>TradingView</name>
+    <name xml:lang="ru">TradingView</name>
+    <summary>TradingView desktop application</summary>
+    <summary xml:lang="ru">Приложение TradingView</summary>
+    <description>
+        <p>Experience extra power, extra speed and extra flexibility, all with the same UX you know and love.</p>
+        <p xml:lang="ru">Ощутите дополнительную мощность, дополнительную скорость и дополнительную гибкость — и все это с тем же пользовательским интерфейсом, который вы знаете и любите.</p>
+    </description>
+    <url type="homepage">https://www.tradingview.com/desktop/</url>
+    <url type="help">https://www.tradingview.com/support/</url>
+    <screenshots>
+        <screenshot type="default">
+            <caption>Interface</caption>
+            <caption xml:lang="ru">Интерфейс</caption>
+            <image>https://dashboard.snapcraft.io/site_media/appmedia/2021/07/Desktop-experience-4.png</image>
+        </screenshot>
+        <screenshot type="default">
+            <caption>Multi-monitor support</caption>
+            <caption xml:lang="ru">Поддержка нескольких мониторов</caption>
+            <image>https://dashboard.snapcraft.io/site_media/appmedia/2021/07/Monitors-banner-4.png</image>
+        </screenshot>
+    </screenshots>
+    <launchable type="desktop-id">tradingview.desktop</launchable>
+    <content_rating type="oars-1.0"/>
+    <provides>
+        <binary>tradingview</binary>
+    </provides>
+</component>
diff --git a/finance/linux-tradingview/files/tradingview.in b/finance/linux-tradingview/files/tradingview.in
new file mode 100644
index 000000000000..c81783933056
--- /dev/null
+++ b/finance/linux-tradingview/files/tradingview.in
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# workaround Chromium bug https://bugs.chromium.org/p/chromium/issues/detail?id=918234
+if [ "$DBUS_SESSION_BUS_ADDRESS" = "" ]; then
+    export DBUS_SESSION_BUS_ADDRESS="autolaunch:"
+fi
+
+exec %%DATADIR%%/tradingview --no-sandbox "$@"
diff --git a/finance/linux-tradingview/pkg-descr b/finance/linux-tradingview/pkg-descr
new file mode 100644
index 000000000000..252096d28e50
--- /dev/null
+++ b/finance/linux-tradingview/pkg-descr
@@ -0,0 +1 @@
+Electron-based desktop trading application for TradingView
diff --git a/finance/linux-tradingview/pkg-plist b/finance/linux-tradingview/pkg-plist
new file mode 100644
index 000000000000..e8f3fff4ec2c
--- /dev/null
+++ b/finance/linux-tradingview/pkg-plist
@@ -0,0 +1,79 @@
+bin/tradingview
+share/applications/tradingview.desktop
+%%DATADIR%%/LICENSE.electron.txt
+%%DATADIR%%/LICENSES.chromium.html
+%%DATADIR%%/chrome-sandbox
+%%DATADIR%%/chrome_100_percent.pak
+%%DATADIR%%/chrome_200_percent.pak
+%%DATADIR%%/chrome_crashpad_handler
+%%DATADIR%%/icudtl.dat
+%%DATADIR%%/libEGL.so
+%%DATADIR%%/libGLESv2.so
+%%DATADIR%%/libffmpeg.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%%/resources.pak
+%%DATADIR%%/resources/app.asar
+%%DATADIR%%/resources/app.asar.unpacked/keytar.node
+%%DATADIR%%/resources/app.asar.unpacked/native/tvdbridge.node
+%%DATADIR%%/snapshot_blob.bin
+%%DATADIR%%/tradingview
+%%DATADIR%%/v8_context_snapshot.bin
+%%DATADIR%%/vk_swiftshader_icd.json
+share/icons/hicolor/512x512/apps/tradingview.png
+share/metainfo/com.tradingview.tradingview.appdata.xml