use better upstream fix for rootDir issue

epel9
Rex Dieter 11 years ago
parent e3de82bb60
commit a8098fdd23

@ -0,0 +1,64 @@
From 523288fa71bba2bb223e7ffbc68f5ebe55118ebd Mon Sep 17 00:00:00 2001
From: Harald Sitter <sitter@kde.org>
Date: Wed, 28 May 2014 16:22:58 +0200
Subject: [PATCH] import relative dir resolution workaround from
CMakePackageConfigHelpers
this prevents the install path resolution from going wrong when symlinks
are involved in /usr/lib* (e.g. the case on Fedora).
the result of not having this workaround is that the install dir will be
resolved as '/' resulting in bogus paths for cmake config users (e.g.
include dir would be set to //include/$soname)
note: this was not actually tested on an affected system, weeh
---
CMakeLists.txt | 19 +++++++++++++++++++
PhononConfig.cmake.in | 1 +
2 files changed, 20 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8d7f0d9..6130885 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -225,6 +225,25 @@ set(CMAKECONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/${PHONON_LIB_SONAME} )
# runtime different from the chosen CMAKE_INSTALL_PREFIX if under Windows the package was installed anywhere)
# This relative path will be configured into the PhononConfig.cmake
file(RELATIVE_PATH relInstallDir ${CMAKE_INSTALL_PREFIX}/${CMAKECONFIG_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX} )
+make_abs_install_path(absInstallDir ${CMAKECONFIG_INSTALL_DIR})
+
+# Exciting code copy from CMakePackageConfigHelpers to avoid the pain from porting
+# to it for the 4.x series.
+# The set variable is used by the PhononConfig.cmake.in to use a refined rootDir
+# resolution when installed to /usr/lib
+if("${absInstallDir}" MATCHES "^(/usr)?/lib(64)?/.+")
+ # Handle "/usr move" symlinks created by some Linux distros.
+ set(USR_SYMLINK_RESOLVER "
+ # Use original install prefix when loaded through a \"/usr move\"
+ # cross-prefix symbolic link such as /lib -> /usr/lib.
+ get_filename_component(_realCurr \"\${CMAKE_CURRENT_LIST_DIR}\" REALPATH)
+ get_filename_component(_realOrig \"${absInstallDir}\" REALPATH)
+ if(_realCurr STREQUAL _realOrig)
+ set(rootDir \"${CMAKE_INSTALL_PREFIX}\")
+ endif()
+ unset(_realOrig)
+ unset(_realCurr)")
+endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/PhononConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/${PHONON_LIB_SONAME_CAMEL}Config.cmake @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/PhononConfigVersion.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/${PHONON_LIB_SONAME_CAMEL}ConfigVersion.cmake @ONLY)
diff --git a/PhononConfig.cmake.in b/PhononConfig.cmake.in
index f3962cb..f1f3e7c 100644
--- a/PhononConfig.cmake.in
+++ b/PhononConfig.cmake.in
@@ -5,6 +5,7 @@ set(PHONON_VERSION "@PHONON_LIB_MAJOR_VERSION@.@PHONON_LIB_MINOR_VERSION@.@PHONO
get_filename_component(currentDir ${CMAKE_CURRENT_LIST_FILE} PATH) # get the directory where I myself am
get_filename_component(rootDir ${currentDir}/@relInstallDir@ ABSOLUTE) # get the chosen install prefix
+@USR_SYMLINK_RESOLVER@
set(PHONON_NO_GRAPHICSVIEW @PHONON_NO_GRAPHICSVIEW@)
set(PHONON_PULSESUPPORT @PHONON_PULSESUPPORT@)
--
1.9.3

@ -11,7 +11,7 @@
Summary: Multimedia framework api
Name: phonon
Version: 4.7.1
Release: 2%{?dist}
Release: 3%{?dist}
License: LGPLv2+
URL: http://phonon.kde.org/
%if 0%{?snap}
@ -22,7 +22,9 @@ Source0: http://download.kde.org/stable/phonon/%{version}/phonon-%{version}.tar.
Patch0: phonon-4.7.0-rpath_use_link_path.patch
# workaround cmake bogosity calculating relative dirs + /usr-move
Patch1: phonon-4.7.0-rootDir.patch
#Patch1: phonon-4.7.0-rootDir.patch
# better upstream fix (pulled from master branch currently)
Patch1: import-relative-dir-resolution-workaround-from-CMake.patch
## upstream patches
Patch103: 0003-sync-FindQt4-from-kdelibs-master-to-unbreak-build-wi.patch
@ -200,6 +202,9 @@ test "$(pkg-config --modversion phonon4qt5)" = "%{version}"
%changelog
* Wed May 28 2014 Rex Dieter <rdieter@fedoraproject.org> 4.7.1-3
- use better upstream fix for rootDir issue
* Wed Mar 26 2014 Rex Dieter <rdieter@fedoraproject.org> 4.7.1-2
- backport some upstream fixes, one that fixes building with cmake-3 particularly

Loading…
Cancel
Save