Hello community,

here is the log from the commit of package fmt for openSUSE:Factory checked in 
at 2020-06-25 16:47:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fmt (Old)
 and      /work/SRC/openSUSE:Factory/.fmt.new.3060 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "fmt"

Thu Jun 25 16:47:05 2020 rev:9 rq:816648 version:6.2.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/fmt/fmt.changes  2020-05-14 23:24:43.564972023 
+0200
+++ /work/SRC/openSUSE:Factory/.fmt.new.3060/fmt.changes        2020-06-25 
16:47:18.276926099 +0200
@@ -1,0 +2,5 @@
+Tue Jun 23 16:02:53 UTC 2020 - Luigi Baldoni <[email protected]>
+
+- Add fmt-6.2.1-fix_pkgconfig_paths.patch (fix for boo#1173270)
+
+-------------------------------------------------------------------

New:
----
  fmt-6.2.1-fix_pkgconfig_paths.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ fmt.spec ++++++
--- /var/tmp/diff_new_pack.AX2z7t/_old  2020-06-25 16:47:18.972927372 +0200
+++ /var/tmp/diff_new_pack.AX2z7t/_new  2020-06-25 16:47:18.972927372 +0200
@@ -25,6 +25,8 @@
 URL:            http://fmtlib.net/
 Source0:        
https://github.com/fmtlib/fmt/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
 Source1:        baselibs.conf
+# PATCH-FIX-UPSTREAM fmt-6.2.1-fix_pkgconfig_paths.patch
+Patch0:         fmt-6.2.1-fix_pkgconfig_paths.patch
 BuildRequires:  cmake
 BuildRequires:  gcc-c++
 BuildRequires:  pkgconfig

++++++ fmt-6.2.1-fix_pkgconfig_paths.patch ++++++
>From 78f041ab5b40a1145ba686aeb8013e8788b08cd2 Mon Sep 17 00:00:00 2001
From: Jan Tojnar <[email protected]>
Date: Thu, 30 Apr 2020 22:23:38 +0200
Subject: [PATCH] build: Fix installation paths

It is not generally true that `CMAKE_INSTALL_<dir>` variables are relative 
paths:

https://github.com/jtojnar/cmake-snips#concatenating-paths-when-building-pkg-config-files
---
 CMakeLists.txt                | 21 +++++++++++++--------
 support/cmake/JoinPaths.cmake | 26 ++++++++++++++++++++++++++
 support/cmake/fmt.pc.in       |  4 ++--
 3 files changed, 41 insertions(+), 10 deletions(-)
 create mode 100644 support/cmake/JoinPaths.cmake

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0ce38e7b8..3a487ce7b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -81,6 +81,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
 
 include(cxx14)
 include(CheckCXXCompilerFlag)
+include(JoinPaths)
 
 list(FIND CMAKE_CXX_COMPILE_FEATURES "cxx_variadic_templates" index)
 if (${index} GREATER -1)
@@ -239,8 +240,8 @@ if (FMT_INSTALL)
   include(GNUInstallDirs)
   include(CMakePackageConfigHelpers)
   set_verbose(FMT_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/fmt CACHE STRING
-              "Installation directory for cmake files, relative to "
-              "${CMAKE_INSTALL_PREFIX}.")
+              "Installation directory for cmake files, a relative path "
+              "that will be joined to ${CMAKE_INSTALL_PREFIX}, or an arbitrary 
absolute path.")
   set(version_config ${PROJECT_BINARY_DIR}/fmt-config-version.cmake)
   set(project_config ${PROJECT_BINARY_DIR}/fmt-config.cmake)
   set(pkgconfig ${PROJECT_BINARY_DIR}/fmt.pc)
@@ -252,22 +253,26 @@ if (FMT_INSTALL)
   endif ()
 
   set_verbose(FMT_LIB_DIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING
-              "Installation directory for libraries, relative to "
-              "${CMAKE_INSTALL_PREFIX}.")
+              "Installation directory for libraries, a relative path "
+              "that will be joined to ${CMAKE_INSTALL_PREFIX}, or an arbitrary 
absolute path.")
 
   set_verbose(FMT_INC_DIR ${CMAKE_INSTALL_INCLUDEDIR}/fmt CACHE STRING
-              "Installation directory for include files, relative to "
-              "${CMAKE_INSTALL_PREFIX}.")
+              "Installation directory for include files, a relative path "
+              "that will be joined to ${CMAKE_INSTALL_PREFIX}, or an arbitrary 
absolute path.")
 
   set_verbose(FMT_PKGCONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig CACHE PATH
-              "Installation directory for pkgconfig (.pc) files, relative to "
-              "${CMAKE_INSTALL_PREFIX}.")
+              "Installation directory for pkgconfig (.pc) files, a relative 
path "
+              "that will be joined to ${CMAKE_INSTALL_PREFIX}, or an arbitrary 
absolute path.")
 
   # Generate the version, config and target files into the build directory.
   write_basic_package_version_file(
     ${version_config}
     VERSION ${FMT_VERSION}
     COMPATIBILITY AnyNewerVersion)
+
+  join_paths(libdir_for_pc_file "\${exec_prefix}" "${CMAKE_INSTALL_LIBDIR}")
+  join_paths(includedir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")
+
   configure_file(
     "${PROJECT_SOURCE_DIR}/support/cmake/fmt.pc.in"
     "${pkgconfig}"
diff --git a/support/cmake/JoinPaths.cmake b/support/cmake/JoinPaths.cmake
new file mode 100644
index 000000000..32d6d6685
--- /dev/null
+++ b/support/cmake/JoinPaths.cmake
@@ -0,0 +1,26 @@
+# This module provides function for joining paths
+# known from from most languages
+#
+# Original license:
+# SPDX-License-Identifier: (MIT OR CC0-1.0)
+# Explicit permission given to distribute this module under
+# the terms of the project as described in /LICENSE.rst.
+# Copyright 2020 Jan Tojnar
+# https://github.com/jtojnar/cmake-snips
+#
+# Modelled after Python’s os.path.join
+# https://docs.python.org/3.7/library/os.path.html#os.path.join
+# Windows not supported
+function(join_paths joined_path first_path_segment)
+    set(temp_path "${first_path_segment}")
+    foreach(current_segment IN LISTS ARGN)
+        if(NOT ("${current_segment}" STREQUAL ""))
+            if(IS_ABSOLUTE "${current_segment}")
+                set(temp_path "${current_segment}")
+            else()
+                set(temp_path "${temp_path}/${current_segment}")
+            endif()
+        endif()
+    endforeach()
+    set(${joined_path} "${temp_path}" PARENT_SCOPE)
+endfunction()
diff --git a/support/cmake/fmt.pc.in b/support/cmake/fmt.pc.in
index 4e030afdf..29976a8af 100644
--- a/support/cmake/fmt.pc.in
+++ b/support/cmake/fmt.pc.in
@@ -1,7 +1,7 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+libdir=@libdir_for_pc_file@
+includedir=@includedir_for_pc_file@
 
 Name: fmt
 Description: A modern formatting library

Reply via email to