Bug 431311

Summary: Discount (required version >= 2) can not be found
Product: [Applications] okular Reporter: Tomasz Paweł Gajc <tpgxyz>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED FIXED    
Severity: normal CC: nate, yurchor
Priority: NOR    
Version First Reported In: 20.12.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Build Log

Description Tomasz Paweł Gajc 2021-01-08 14:41:41 UTC
Created attachment 134660 [details]
Build Log

SUMMARY
I'm building Okular-20.12.1 with enabled Discount support. Unfortunately cmake cannot it find.

STEPS TO REPRODUCE
1. install discount-2.2.7
2. run okular build
3. 

OBSERVED RESULT
-- The following OPTIONAL packages have not been found:
 * Discount (required version >= 2)

EXPECTED RESULT
Discount is found and Okular is build with libmarkdown support

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: OpenMandriva Cooker 4.2 RC
(available in About System)
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Build logs with tracing enabled here https://abf.openmandriva.org/build_lists/932120
Comment 1 Yuri Chornoivan 2021-01-08 14:56:39 UTC
Hi,

It looks like the library has been built despite the CMake warning (same here under Mageia 7).

Can you check it?

Thanks in advance for your answer.
Comment 2 Nate Graham 2021-01-08 21:40:35 UTC
Did you make sure to install the dev library too?
Comment 3 Tomasz Paweł Gajc 2021-01-08 21:59:11 UTC
Yes libmarkdown-devel is installed in buildroot, you can notice that on logs I did attach.

-- Found discount: /usr/lib64/libmarkdown.so

Seems like okularGenerator_md.so is linked to libmarkdown.so.2(), so came is somehow broken with its false positive tests.
Comment 4 Bug Janitor Service 2021-01-08 23:22:40 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/359
Comment 5 Albert Astals Cid 2021-01-24 11:51:50 UTC
Git commit 084631d11eddadb0802f0adbcd4a56c18ea68efc by Albert Astals Cid.
Committed on 24/01/2021 at 11:16.
Pushed by aacid into branch 'master'.

Use more standard cmake functionality to search for discount

Instead of rolling our own, that's harder to understand and buggy anyway

M  +3    -3    autotests/CMakeLists.txt
M  +6    -27   cmake/modules/FindDiscount.cmake
M  +3    -3    generators/CMakeLists.txt
M  +1    -1    generators/markdown/CMakeLists.txt

https://invent.kde.org/graphics/okular/commit/084631d11eddadb0802f0adbcd4a56c18ea68efc