[Slackbuilds-users] Podofo and Cppunit

Luiz Carlos Ramos lramos.prof at yahoo.com.br
Sun Jan 28 22:55:23 UTC 2024


Hello,

just reporting some errors I got when compiling podofo and a workaround
that helped me here.

The problem happens with the build of podofo. After some time compiling,
it shows a lot of errors that suggest there's something wrong related to
Cppunit.

In my system, cppunit is installed (cppunit-1.15.1-x86_64-1_SBo).

After some thinking, I tried to uninstall cppunit before building
podofo, to see what happens. And it worked.

Next, I managed to do a trick in CMakeFiles.txt in order to allow doing
all the magic as if Cppunit was not installed. Then I got to this patch,
which is supposed to be applied to CMakeFiles.txt before building:

=== 01-dont-run-unit-test.patch =======================================
diff -urpN a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt	2024-01-27 20:22:44.720125177 -0300
+++ b/CMakeLists.txt	2024-01-27 20:27:51.120130890 -0300
@@ -382,6 +382,11 @@ ELSE(UNISTRING_FOUND)
 ENDIF(UNISTRING_FOUND)
 
 
+IF(PODOFO_BYPASS_UNIT_TESTS)
+  MESSAGE("Unit tests bypassed by user request")
+
+ELSE(PODOFO_BYPASS_UNIT_TESTS)
+
 IF(NOT PODOFO_BUILD_LIB_ONLY)
 
 FIND_PACKAGE(CppUnit)
@@ -396,6 +401,8 @@ ENDIF(CppUnit_FOUND)
 
 ENDIF(NOT PODOFO_BUILD_LIB_ONLY)
 
+ENDIF(PODOFO_BYPASS_UNIT_TESTS)
+
 FIND_PACKAGE(OpenSSL)
 
 FIND_PACKAGE(FREETYPE REQUIRED)
=== 01-dont-run-unit-test.patch =======================================

The intention is to bypass CppUnit detection when the key
PODOFO_BYPASS_UNIT_TESTS is set to TRUE by user request. When this
happens, a message is printed, allowing the user to know what is
happening, and CppUnit detection is bypassed, as if it was not present.

After that, I managed to change the SlackBuild, including that key in
the "cmake" invocation, like that:

    (...)
    -DWANT_BOOST:BOOL=1 \
    -DLIB_SUFFIX:STRING="$LIBDIRSUFFIX" \
    -DPODOFO_BYPASS_UNIT_TESTS:BOOL=TRUE \
    -DCMAKE_BUILD_TYPE=Release ..
    (...)

and it ultimately this worked (with some degree of surprise by myself).

So, this may save some time to people who are in the same context as I.
I think the first thing to check is if the Cppunit interference happens
as here (and if there is no other way to make it work).

Hope this helps,

Luiz Carlos Ramos
lramos.prof at yahoo.com.br
Sao Paulo - Brazil



More information about the SlackBuilds-users mailing list