Bug 367481

Summary: libktorrent fails to build against libgcrypt version 1.7.2-beta
Product: [Applications] ktorrent Reporter: jm.ouwerkerk
Component: generalAssignee: Joris Guisson <joris.guisson>
Status: RESOLVED FIXED    
Severity: major    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description jm.ouwerkerk 2016-08-18 08:04:45 UTC
FindLibGcrypt cmake rejects the version string 1.7.2-beta and wrong considers it to be less (older) than "1.4.5" apparently. At a guess, this is due to the "-beta" breaking version string parsing.

As a result building from source is broken on systems with libgcrypt 1.7.2-beta. Presumably the issue will reappear every time a beta version of libgcrypt is used.


Reproducible: Always

Steps to Reproduce:
1. apt-get install <dependencies>, including libgcrypt20-dev
2. Setup kdesrc-build
3. Execute kdesrc-build libktorrent

Actual Results:  
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find LibGcrypt: Found unsuitable version "#define GCRYPT_VERSION
  "1.7.2-beta".#define GCRYPT_VERSION "1.7.2-beta".#define GCRYPT_VERSION
  "1.7.2-beta"", but required is at least "1.4.5" (found /usr/include)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:386 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindLibGcrypt.cmake:108 (find_package_handle_standard_args)
  CMakeLists.txt:59 (find_package)5

Expected Results:  
I'd expect the cmake file to accept libgcrypt 1.7.2. beta as a valid instance of the libgcrypt dependency.

sudo apt-cache policy libgcrypt20-dev
libgcrypt20-dev:
  Installed: 1.7.2-2
  Candidate: 1.7.2-2
  Version table:
 *** 1.7.2-2 500
        500 http://ftp.nl.debian.org/debian sid/main amd64 Packages
        500 http://ftp.nl.debian.org/debian testing/main amd64 Packages
        100 /var/lib/dpkg/status
Comment 1 jm.ouwerkerk 2016-08-18 09:16:12 UTC
I've posted a possible fix to reviewboard; see also: https://git.reviewboard.kde.org/r/128706/
Comment 2 jm.ouwerkerk 2016-08-27 12:53:30 UTC
Pushed the fix to master just now.