git: 10eb33d8086a - main - editors/linux-r7-office: Assorted fixes.

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Mon, 06 Mar 2023 14:15:20 UTC
The branch main has been updated by arrowd:

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

commit 10eb33d8086a88ac5bcb55d34d86608d554071ac
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2023-03-06 13:55:52 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2023-03-06 14:15:00 +0000

    editors/linux-r7-office: Assorted fixes.
    
    - Fix paths in .desktop file.
    - Install icon file.
    - Override LC_CTYPE with ru_RU.UTF-8 value [*].
    
    [*] linux_base-c7 doesn't have C nor C.UTF-8 locales. This makes R7 Office
    render gibberish in file names in the "Open File ..." dialog. The LC_CTYPE
    override to ru_RU.UTF-8 makes most sense - the userbase of this suite is likely
    to consist of Russian-speaking users. Oterwise the user always may set LC_ALL to
    something else to switch R7 Office to the different locale.
    
    Reported by:    fluffy
    Sponsored by:   Serenity Cybersecurity, LLC
---
 editors/linux-r7-office/Makefile                   |  9 ++++----
 .../files/patch-usr_bin_r7-office-desktopeditors   | 26 +++++++++++++---------
 .../files/patch-usr_bin_r7-office-imageviewer      | 10 +++++++++
 .../files/patch-usr_bin_r7-office-videoplayer      | 10 +++++++++
 editors/linux-r7-office/pkg-plist                  |  1 +
 5 files changed, 42 insertions(+), 14 deletions(-)

diff --git a/editors/linux-r7-office/Makefile b/editors/linux-r7-office/Makefile
index 6aa3a661b237..4d242d6ef6e2 100644
--- a/editors/linux-r7-office/Makefile
+++ b/editors/linux-r7-office/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	r7-office
 PORTVERSION=	7.2.2
+PORTREVISION=	1
 CATEGORIES=	editors linux russian
 MASTER_SITES=	https://download.r7-office.ru/ubuntu/
 DISTNAME=	r7-office
@@ -32,10 +33,7 @@ post-extract:
 	cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} data.tar.xz ${EXTRACT_AFTER_ARGS}
 
 post-patch:
-	${REINPLACE_CMD} 's|/opt/r7-office/|${DATADIR}/|' ${WRKDIR}/usr/bin/r7-office-*
-	${RM} ${WRKDIR}/usr/bin/*.bak
-	${REINPLACE_CMD} 's|/usr/bin/|${PREFIX}/|' ${WRKDIR}/usr/share/applications/*.desktop
-	${RM} ${WRKDIR}/usr/share/applications/*.bak
+	${REINPLACE_CMD} -i '' 's|/usr/bin/|${PREFIX}/bin/|' ${WRKDIR}/usr/share/applications/*.desktop
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKDIR}/usr/bin/r7-office-* ${STAGEDIR}${PREFIX}/bin/
@@ -43,6 +41,9 @@ do-install:
 	cd ${WRKDIR}/opt && ${CP} -r r7-office ${STAGEDIR}${PREFIX}/share
 	cd ${WRKDIR}/usr/share && ${COPYTREE_SHARE} \* ${STAGEDIR}${PREFIX}/share
 
+	${RLN} ${STAGEDIR}${DATADIR}/desktopeditors/asc-de-256.png \
+		${STAGEDIR}${PREFIX}/share/pixmaps/r7-office.png
+
 	${RM} ${STAGEDIR}${PREFIX}/share/flyfm/templates/.source/*
 .for f in new.docx new.pptx new.xlsx
 	${RLN} ${STAGEDIR}${DATADIR}/desktopeditors/converter/empty/${f} \
diff --git a/editors/linux-r7-office/files/patch-usr_bin_r7-office-desktopeditors b/editors/linux-r7-office/files/patch-usr_bin_r7-office-desktopeditors
index f54b184aee77..7de4e77687cc 100644
--- a/editors/linux-r7-office/files/patch-usr_bin_r7-office-desktopeditors
+++ b/editors/linux-r7-office/files/patch-usr_bin_r7-office-desktopeditors
@@ -1,17 +1,23 @@
 --- usr/bin/r7-office-desktopeditors.orig	2022-12-11 00:52:25 UTC
 +++ usr/bin/r7-office-desktopeditors
-@@ -82,7 +82,7 @@ check_templates() {
-     echo "system template's folder isn't found"
+@@ -73,7 +73,7 @@ check_templates() {
      return 0
    fi
--  
-+
-   TEMPLATE_DOCX="$TEMPLATE_DIR/$NEW_DOCX_NAME.docx"
-   TEMPLATE_XLSX="$TEMPLATE_DIR/$NEW_XLSX_NAME.xlsx"
-   TEMPLATE_PPTX="$TEMPLATE_DIR/$NEW_PPTX_NAME.pptx"
-@@ -111,4 +111,5 @@ export VLC_PLUGIN_PATH=$DIR_MV/plugins
- DIR_MV=/opt/r7-office/mediaviewer
+ 
+-  SOURCE_DOC_DIR="/opt/r7-office/desktopeditors/converter/empty"
++  SOURCE_DOC_DIR="/usr/local/share/r7-office/desktopeditors/converter/empty"
+ 
+   set_names_ru
+ 
+@@ -107,8 +107,9 @@ check_templates "$@"
+ 
+ check_templates "$@"
+ 
+-DIR=/opt/r7-office/desktopeditors
+-DIR_MV=/opt/r7-office/mediaviewer
++DIR=/usr/local/share/r7-office/desktopeditors
++DIR_MV=/usr/local/share/r7-office/mediaviewer
  export LD_LIBRARY_PATH=$DIR:$DIR/converter:$DIR_MV:$LD_LIBRARY_PATH
  export VLC_PLUGIN_PATH=$DIR_MV/plugins
-+export LANG=
++export LC_CTYPE=ru_RU.UTF-8
  exec $DIR/DesktopEditors "$@"
diff --git a/editors/linux-r7-office/files/patch-usr_bin_r7-office-imageviewer b/editors/linux-r7-office/files/patch-usr_bin_r7-office-imageviewer
new file mode 100644
index 000000000000..5960cd6c0c2e
--- /dev/null
+++ b/editors/linux-r7-office/files/patch-usr_bin_r7-office-imageviewer
@@ -0,0 +1,10 @@
+--- usr/bin/r7-office-imageviewer.orig	2022-12-11 00:52:25 UTC
++++ usr/bin/r7-office-imageviewer
+@@ -1,5 +1,6 @@
+ #!/bin/sh
+ 
+-DIR=/opt/r7-office/mediaviewer
++DIR=/usr/local/share/r7-office/mediaviewer
+ export LD_LIBRARY_PATH=$DIR:$LD_LIBRARY_PATH
++export LC_CTYPE=ru_RU.UTF-8
+ exec $DIR/ImageViewer "$@"
diff --git a/editors/linux-r7-office/files/patch-usr_bin_r7-office-videoplayer b/editors/linux-r7-office/files/patch-usr_bin_r7-office-videoplayer
new file mode 100644
index 000000000000..9dd1d6ce0258
--- /dev/null
+++ b/editors/linux-r7-office/files/patch-usr_bin_r7-office-videoplayer
@@ -0,0 +1,10 @@
+--- usr/bin/r7-office-videoplayer.orig	2022-12-11 00:52:25 UTC
++++ usr/bin/r7-office-videoplayer
+@@ -1,5 +1,6 @@
+ #!/bin/sh
+ 
+-DIR=/opt/r7-office/mediaviewer
++DIR=/usr/local/share/r7-office/mediaviewer
+ export LD_LIBRARY_PATH=$DIR:$LD_LIBRARY_PATH
++export LC_CTYPE=ru_RU.UTF-8
+ exec $DIR/VideoPlayer "$@"
diff --git a/editors/linux-r7-office/pkg-plist b/editors/linux-r7-office/pkg-plist
index 412a2dce8a77..1619fb54bbe6 100644
--- a/editors/linux-r7-office/pkg-plist
+++ b/editors/linux-r7-office/pkg-plist
@@ -12,6 +12,7 @@ share/flyfm/templates/.source/new.xlsx
 share/flyfm/templates/desktopeditors.docx.desktop
 share/flyfm/templates/desktopeditors.pptx.desktop
 share/flyfm/templates/desktopeditors.xlsx.desktop
+share/pixmaps/r7-office.png
 %%DATADIR%%/desktopeditors/3DPARTYLICENSE
 %%DATADIR%%/desktopeditors/DesktopEditors
 %%DATADIR%%/desktopeditors/LICENSE.htm