From 01f8831f3bdccc768e6bd1eb1718ea9f6c3b9b02 Mon Sep 17 00:00:00 2001 From: Jens Georg Date: Wed, 8 May 2013 11:00:58 -0700 Subject: [PATCH] make install doesn't respect --prefix: Closes #6001 Also fixed was code to detect location of installed .desktop file. --- THANKS | 1 + cmake/FindIntltool.cmake | 2 +- src/client/geary-application.vala | 7 +++---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/THANKS b/THANKS index 78b01737..4e8e4e2d 100644 --- a/THANKS +++ b/THANKS @@ -11,6 +11,7 @@ Jon Dowland Christian Dywan Victor Eduardo Daniel Foré +Jens Georg Michael George Sven Hagemann Mathias Hasselmann diff --git a/cmake/FindIntltool.cmake b/cmake/FindIntltool.cmake index 7bfcdaa1..cbe07824 100644 --- a/cmake/FindIntltool.cmake +++ b/cmake/FindIntltool.cmake @@ -17,7 +17,7 @@ if (INTLTOOL_MERGE_FOUND) ${INTLTOOL_MERGE_EXECUTABLE} --desktop-style ${CMAKE_SOURCE_DIR}/${po_dir} ${CMAKE_CURRENT_SOURCE_DIR}/${desktop_id}.desktop.in ${desktop_id}.desktop ) - install (FILES ${CMAKE_CURRENT_BINARY_DIR}/geary.desktop DESTINATION /usr/share/applications) + install (FILES ${CMAKE_CURRENT_BINARY_DIR}/geary.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) endmacro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir) endif (INTLTOOL_MERGE_FOUND) diff --git a/src/client/geary-application.vala b/src/client/geary-application.vala index a069c02f..f4b62fb7 100644 --- a/src/client/geary-application.vala +++ b/src/client/geary-application.vala @@ -76,8 +76,6 @@ along with Geary; if not, write to the Free Software Foundation, Inc., } public Configuration config { get; private set; } - public File system_desktop_file_directory { get; private set; - default = File.new_for_path("/usr/share/applications/"); } private static GearyApplication _instance = null; @@ -383,8 +381,9 @@ along with Geary; if not, write to the Free Software Foundation, Inc., } public File? get_desktop_file() { - File desktop_file = is_installed() - ? system_desktop_file_directory.get_child("geary.desktop") + File? install_dir = get_install_dir(); + File desktop_file = (install_dir != null) + ? install_dir.get_child("geary.desktop") : File.new_for_path(SOURCE_ROOT_DIR).get_child("build").get_child("desktop").get_child("geary.desktop"); return desktop_file.query_exists() ? desktop_file : null;