Incorrect prefix in .pc files

Bug #1876042 reported by Mikhail Elhimov
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
googletest (Debian)
Fix Released
Unknown
googletest (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

All pkg-config files contain wrong prefix. It is specified as
prefix=${pcfiledir}/../..
which is resolved to /usr/lib while it should be /usr

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: googletest 1.10.0-2
ProcVersionSignature: Ubuntu 5.4.0-26.30-generic 5.4.30
Uname: Linux 5.4.0-26-generic x86_64
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Thu Apr 30 09:33:19 2020
Dependencies:

DistributionChannelDescriptor:
 # This is a distribution channel descriptor
 # For more information see http://wiki.ubuntu.com/DistributionChannelDescriptor
 canonical-oem-somerville-xenial-amd64-20160624-2
InstallationDate: Installed on 2017-11-08 (903 days ago)
InstallationMedia: Ubuntu 16.04 "Xenial" - Build amd64 LIVE Binary 20160624-10:47
PackageArchitecture: all
SourcePackage: googletest
UpgradeStatus: Upgraded to focal on 2020-04-28 (1 days ago)

Revision history for this message
Mikhail Elhimov (elhimov) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in googletest (Ubuntu):
status: New → Confirmed
Revision history for this message
Max (m-gorodok) wrote :

I believe, this bug deserves Stable Release Update. It is fixed in Ubuntu-20.10 eoan and Debian testing (bullseye) googletest-1.10.0-3 package

Changes are small http://launchpadlibrarian.net/477912854/googletest_1.10.0-2_1.10.0-3.diff.gz
and if there is any reason to worry, the fix for debbug 958659 could be dropped for focal.
I hope this is enough to add "patch" tag.

In respect to CMake, the bug have workaround through using lower level interface
(other ways to include gtest independent of pkg-config are available as well)

    find_package(PkgConfig REQUIRED)
    pkg_search_module(GTEST REQUIRED gtest_main)
    add_executable(test test.cc)
    target_compile_options(test PRIVATE ${GTEST_CFLAGS})
    target_link_libraries(test ${GTEST_LDFLAGS})

However such approach is against CMake best practices in respect to imported libraries
https://rix0r.nl/blog/2015/08/13/cmake-guide/
Due to unfortunate mistake in pkg-config files higher level interface is unavailable,
it is necessary to use CFLAGS and LDFLAGS directly,
the following does not work

    find_package(PkgConfig REQUIRED)
    pkg_check_modules(gtest_main REQUIRED IMPORTED_TARGET gtest_main)
    add_executable(test test.cc)
    target_compile_options(test PkgConfig::gtest_main)

I hope, steps to reproduce in debian bug are clear
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=958099

googletest in ubuntu is something unlucky. Prebuilt libraries returned to libgtest-dev
soon after bionic release (see debbug 896559). Now focal has been release with broken
pkg-config file.

Please, consider googletest-1.10.0-3 release for focal,
required changes are small and safe and allows to avoid
impression of slightly broken package requiring special treatment.

tags: added: patch
Changed in googletest (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.