From dc6f6f2591ee8bdbc152ab486aa6b8efefcf23b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20C=2E=20Guimar=C3=A3es?= Date: Tue, 27 Aug 2019 16:37:27 +0000 Subject: [PATCH] net-p2p/transmission-gtk: Fix .desktop file when NLS disabled. When the NLS option is disabled the installed transmission-gtk.desktop file contains fields that start with and underscore, like _Name instead of Name. When the NLS option is enabled these are replaced by translations. The attached patch adds a simple sed command that removes the underscores when NLS is disabled. PR: 240125 Submitted by: tijl Approved by: tcberner (mentor) --- .../files/patch-gtk_CMakeLists.txt | 36 +++++++++++++++++++ net-p2p/transmission-gtk/Makefile | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 net-p2p/transmission-cli/files/patch-gtk_CMakeLists.txt diff --git a/net-p2p/transmission-cli/files/patch-gtk_CMakeLists.txt b/net-p2p/transmission-cli/files/patch-gtk_CMakeLists.txt new file mode 100644 index 000000000000..6c037681645b --- /dev/null +++ b/net-p2p/transmission-cli/files/patch-gtk_CMakeLists.txt @@ -0,0 +1,36 @@ +--- gtk/CMakeLists.txt.orig 2018-05-01 17:18:29 UTC ++++ gtk/CMakeLists.txt +@@ -48,15 +48,22 @@ add_custom_command( + ${CMAKE_CURRENT_SOURCE_DIR} + ) + ++set(${PROJECT_NAME}_DESKTOP_FILE "${PROJECT_BINARY_DIR}/${TR_NAME}-gtk.desktop") + if(ENABLE_NLS) + find_program(INTLTOOL_MERGE_EXECUTABLE intltool-merge REQUIRED) +- set(${PROJECT_NAME}_DESKTOP_FILE "${PROJECT_BINARY_DIR}/${TR_NAME}-gtk.desktop") + add_custom_command( + OUTPUT ${${PROJECT_NAME}_DESKTOP_FILE} + COMMAND ${INTLTOOL_MERGE_EXECUTABLE} --desktop-style --utf8 ${CMAKE_SOURCE_DIR}/po ${PROJECT_SOURCE_DIR}/transmission-gtk.desktop.in ${${PROJECT_NAME}_DESKTOP_FILE} + DEPENDS ${PROJECT_SOURCE_DIR}/transmission-gtk.desktop.in + VERBATIM + ) ++else() ++ add_custom_command( ++ OUTPUT ${${PROJECT_NAME}_DESKTOP_FILE} ++ COMMAND sed s/^_// ${PROJECT_SOURCE_DIR}/transmission-gtk.desktop.in > ${${PROJECT_NAME}_DESKTOP_FILE} ++ DEPENDS ${PROJECT_SOURCE_DIR}/transmission-gtk.desktop.in ++ VERBATIM ++ ) + endif() + + set(${PROJECT_NAME}_SOURCES +@@ -186,8 +193,4 @@ if(INSTALL_DOC) + install(FILES ${TR_NAME}-gtk.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) + endif() + +-if(ENABLE_NLS) +- install(FILES ${${PROJECT_NAME}_DESKTOP_FILE} DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) +-else() +- install(FILES transmission-gtk.desktop.in DESTINATION ${CMAKE_INSTALL_DATADIR}/applications RENAME ${TR_NAME}-gtk.desktop) +-endif() ++install(FILES ${${PROJECT_NAME}_DESKTOP_FILE} DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) diff --git a/net-p2p/transmission-gtk/Makefile b/net-p2p/transmission-gtk/Makefile index 2b90fb63ef7b..7f08266236d8 100644 --- a/net-p2p/transmission-gtk/Makefile +++ b/net-p2p/transmission-gtk/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -PORTREVISION= 4 +PORTREVISION= 5 PKGNAMESUFFIX= -gtk LIB_DEPENDS= libdbus-glib-1.so:devel/dbus-glib \