www/firefox-esr: use an awk oneliner to append 'ESR' suffix to Name lines in desktop file

this way one can differentiate firefox from firefox-esr in desktop
environments.
while here also fix Exec lines for alternate Desktop Actions.
patch from Juan Picca, thanks !
This commit is contained in:
landry 2022-05-25 07:24:44 +00:00
parent a602ff945d
commit b9ff24a0f8
2 changed files with 20 additions and 1 deletions

View File

@ -6,6 +6,7 @@ MOZILLA_BRANCH = release
MOZILLA_PROJECT = firefox-esr MOZILLA_PROJECT = firefox-esr
MOZILLA_CODENAME = browser MOZILLA_CODENAME = browser
MOZILLA_DIST = firefox MOZILLA_DIST = firefox
REVISION = 0
WRKDIST = ${WRKDIR}/${MOZILLA_DIST}-${MOZILLA_DIST_VERSION:C/esr//} WRKDIST = ${WRKDIR}/${MOZILLA_DIST}-${MOZILLA_DIST_VERSION:C/esr//}
HOMEPAGE = https://www.mozilla.org/firefox/organizations/ HOMEPAGE = https://www.mozilla.org/firefox/organizations/
@ -73,7 +74,10 @@ post-install:
${PREFIX}/lib/${MOZILLA_PROJECT}/distribution/distribution.ini ${PREFIX}/lib/${MOZILLA_PROJECT}/distribution/distribution.ini
# install desktop file # install desktop file
${INSTALL_DATA_DIR} ${PREFIX}/share/applications/ ${INSTALL_DATA_DIR} ${PREFIX}/share/applications/
${SUBST_DATA} ${WRKSRC}/taskcluster/docker/firefox-snap/firefox.desktop \ awk '/^\[/{ if ($$0 == "[Desktop Entry]") flag=1; else flag=0} /^Name/{if (flag) print $$0, "- ESR"; else print} !/^Name/' \
${WRKSRC}/taskcluster/docker/firefox-snap/firefox.desktop \
> ${WRKSRC}/taskcluster/docker/firefox-snap/firefox.desktop.fixed
${SUBST_DATA} ${WRKSRC}/taskcluster/docker/firefox-snap/firefox.desktop.fixed \
${PREFIX}/share/applications/${MOZILLA_PROJECT}.desktop ${PREFIX}/share/applications/${MOZILLA_PROJECT}.desktop
# make sure TwemojiMozilla.ttf is found # make sure TwemojiMozilla.ttf is found

View File

@ -18,3 +18,18 @@ Index: taskcluster/docker/firefox-snap/firefox.desktop
Categories=GNOME;GTK;Network;WebBrowser; Categories=GNOME;GTK;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall; MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;
StartupNotify=true StartupNotify=true
@@ -197,7 +197,7 @@
Name[vi]=Mở cửa sổ mới
Name[zh_CN]=新建窗口
Name[zh_TW]=開啟新視窗
-Exec=firefox -new-window
+Exec=${MOZILLA_PROJECT} -new-window
[Desktop Action NewPrivateWindow]
Name=Open a New Private Window
@@ -216,4 +216,4 @@
Name[tr]=Yeni bir pencere aç
Name[uk]=Відкрити нове вікно у потайливому режимі
Name[zh_TW]=開啟新隱私瀏覽視窗
-Exec=firefox -private-window
+Exec=${MOZILLA_PROJECT} -private-window