Accepting request 702829 from KDE:Extra

- Add 0001-Make-sure-the-defined-variables-are-relative-before-.patch
  to fix runtime issues.

OBS-URL: https://build.opensuse.org/request/show/702829
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gammaray?expand=0&rev=10
This commit is contained in:
Dominique Leuenberger 2019-06-07 10:18:57 +00:00 committed by Git OBS Bridge
commit a0b328aead
3 changed files with 75 additions and 2 deletions

View File

@ -0,0 +1,66 @@
From f36b102b16711efe03ea3d1908daa80c04693fd8 Mon Sep 17 00:00:00 2001
From: Christophe Giboudeaux <christophe@krop.fr>
Date: Mon, 13 May 2019 19:22:35 +0200
Subject: [PATCH] Make sure the defined variables are relative before setting
'GAMMARAY_INVERSE_*'
If absolute paths are used when running CMake, config-gammaray.h may contain
bogus values for GAMMARAY_INVERSE_* variables.
This can cause runtime errors and/or warnings when GammaRay tries to locate the
gammaray-launcher binary or the documentation files.
---
CMakeLists.txt | 8 ++++++--
cmake/GammaRayMacrosInternal.cmake | 7 +++++++
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 86d7db47..5a81156f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -669,19 +669,23 @@ else()
include(GNUInstallDirs)
set(BIN_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}") # relative, usually "bin"
+ gammaray_convert_to_relative_path(BIN_INSTALL_DIR)
if(GAMMARAY_INSTALL_QT_LAYOUT)
set(LIB_INSTALL_DIR "lib") # Qt always uses "lib"
else()
- set(LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}") # "lib" or "lib64"
+ set(LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}") # "lib" or "lib64"
+ gammaray_convert_to_relative_path(LIB_INSTALL_DIR)
endif()
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/gammaray")
set(CMAKECONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/GammaRay)
set(DATAROOTDIR "${CMAKE_INSTALL_DATAROOTDIR}" CACHE PATH "Define install directory for read-only architecture-independent data")
+ gammaray_convert_to_relative_path(DATAROOTDIR)
set(XDG_APPS_INSTALL_DIR "${DATAROOTDIR}/applications")
set(APPDATA_INSTALL_DIR "${DATAROOTDIR}/appdata")
set(ICON_INSTALL_DIR "${DATAROOTDIR}/icons")
set(MAN_INSTALL_DIR "${DATAROOTDIR}/man/man1")
- set(QCH_INSTALL_DIR "${CMAKE_INSTALL_DOCDIR}" CACHE STRING "Install location of Qt Assistant help files.")
+ set(QCH_INSTALL_DIR "${CMAKE_INSTALL_DOCDIR}" CACHE PATH "Install location of Qt Assistant help files.")
+ gammaray_convert_to_relative_path(QCH_INSTALL_DIR)
if(WIN32)
set(PLUGIN_INSTALL_DIR "plugins/gammaray")
set(LIBEXEC_INSTALL_DIR "${BIN_INSTALL_DIR}")
diff --git a/cmake/GammaRayMacrosInternal.cmake b/cmake/GammaRayMacrosInternal.cmake
index 7ef4851a..9044e9b2 100644
--- a/cmake/GammaRayMacrosInternal.cmake
+++ b/cmake/GammaRayMacrosInternal.cmake
@@ -94,6 +94,13 @@ macro(gammaray_join_list _var _sep)
endforeach()
endmacro()
+macro(gammaray_convert_to_relative_path _var)
+ # Make sure _var is a relative path
+ if(IS_ABSOLUTE "${${_var}}")
+ file(RELATIVE_PATH ${_var} "${CMAKE_INSTALL_PREFIX}" "${${_var}}")
+ endif()
+endmacro()
+
macro(gammaray_inverse_dir _var _prefix)
# strip out relative components, those break the following on OSX
get_filename_component(_clean_prefix "${CMAKE_INSTALL_PREFIX}/${_prefix}" ABSOLUTE)
--
2.21.0

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue May 14 11:52:44 UTC 2019 - Christophe Giboudeaux <christophe@krop.fr>
- Add 0001-Make-sure-the-defined-variables-are-relative-before-.patch
to fix runtime issues.
-------------------------------------------------------------------
Wed Apr 10 18:04:06 UTC 2019 - Christophe Giboudeaux <christophe@krop.fr>

View File

@ -29,6 +29,8 @@ Source: https://github.com/KDAB/GammaRay/releases/download/v%{version}/%
Patch0: Fix_icons_installation.patch
# PATCH-FIX-UPSTREAM fix-build-with-qt-5.13.patch
Patch1: fix-build-with-qt-5.13.patch
# PATCH-FIX-UPSTREAM 0001-Make-sure-the-defined-variables-are-relative-before-.patch
Patch2: 0001-Make-sure-the-defined-variables-are-relative-before-.patch
BuildRequires: binutils-devel
BuildRequires: cmake >= 3.1
BuildRequires: doxygen
@ -106,8 +108,7 @@ and debugging utilities specifically tailored for the various
frameworks in Qt. Development files.
%prep
%setup -q
%autopatch -p1
%autosetup -p1
%build
%cmake \