fix pkg-config libdir value

This commit is contained in:
FeRD (Frank Dana) 2023-02-03 12:56:56 -05:00
parent 763d5ebb2d
commit 4718c5afe5
2 changed files with 37 additions and 1 deletions

View File

@ -8,7 +8,7 @@
Name: tesseract
Version: 5.3.0
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Raw OCR Engine
License: Apache-2.0
@ -20,6 +20,10 @@ Source0: https://github.com/tesseract-ocr/tesseract/archive/%{version}%{?p
# Honour TESSDATA_PREFIX
# Build training libs statically
Patch0: tesseract_cmake.patch
# Generate correct libdir path in /usr/lib64/pkgconfig/tesseract.pc
# Already merged upstream, can be dropped at next release
# https://github.com/tesseract-ocr/tesseract/commit/5e116fa5cad249b8a08d22af652cf52f44fbb8cd
Patch1: tesseract_libdir.patch
BuildRequires: cmake
@ -242,6 +246,9 @@ cp -a doc/*.5 %{buildroot}%{_mandir}/man5/
%changelog
* Fri Feb 03 2023 FeRD (Frank Dana) <ferdnyc@gmail.com> - 5.3.0-5
- Add patch from upstream to fix pkg-config libdir value
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

29
tesseract_libdir.patch Normal file
View File

@ -0,0 +1,29 @@
From 5e116fa5cad249b8a08d22af652cf52f44fbb8cd Mon Sep 17 00:00:00 2001
From: Frank Dana <ferdnyc@gmail.com>
Date: Thu, 2 Feb 2023 19:57:59 -0500
Subject: [PATCH] Fix libdir in tesseract.pc from CMake
tesseract.pc.cmake was hardcoding libdir to
`{prefix}/lib`, which is wrong for systems that use
`/usr/lib64/` on 64-bit. `CMAKE_INSTALL_LIBDIR`
is already expected to contain the libdir path
relative to the install prefix.
---
tesseract.pc.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tesseract.pc.cmake b/tesseract.pc.cmake
index 7f36ce19..5469a398 100644
--- a/tesseract.pc.cmake
+++ b/tesseract.pc.cmake
@@ -1,6 +1,6 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}/bin
-libdir=${prefix}/lib
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/include
Name: @tesseract_NAME@
--
2.39.1