<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,</p>
<p>I use to compile from time to time the libkolabxml package on
debian current .<br>
</p>
<p>The build of php wrapper was always a pain but I had no time to
check the root cause until few weeks ago.</p>
<p>The problem is the strange way debian allocate the paths for php
libs. <br>
</p>
<p>For example the .so are currently in <span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">/usr/lib/php/20190902/
</span></span><span
style="color:#000000;background-color:#ffffff;">and each build </span>has
another directory probably to ensure coexistence of multiple
version.<span style="font-family:monospace"><br>
</span></p>
<p>The CMakeLists.txt use a lazzy guess method to find that path and
fail<span style="font-family:monospace">.</span> So I changed it
that way to use php-config for this task ( you can remove some
messages I added for debuging purposes).<br>
</p>
<p>Another issue is now debian will keep the dynamic libraries in
/usr/lib, not in /usr/lib64 so "make install" will put them in the
wrong folder</p>
<p>And finally, probably I still missed something because make
install will put <span
style="color:#000000;background-color:#ffffff;">kolabformat.php
in the dinamic lib folder instead of /usr/share/php where are
the static libs . I was aware of that so I move them manually,
didn't change the cmake file .</span><br>
</p>
<p>I guess this change will still work on redHat but I didn't tested
yet. I used the master branch from the repo.<br>
</p>
<p><span style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">root@machinet:/usr/src#
diff libkolabxml/src/php/CMakeLists.txt
/root/machinet/webservices/CMakeLists.txt </span><br>
6c6
<br>
< COMMAND ${SWIG} -v -c++ -php -o
${CMAKE_CURRENT_BINARY_DIR}/${KOLAB_SWIG_PHP_SOURCE_FILE}
../kolabformat.i
<br>
---
<br>
> COMMAND ${SWIG} -v -c++ -php7 -o
${CMAKE_CURRENT_BINARY_DIR}/${KOLAB_SWIG_PHP_SOURCE_FILE}
../kolabformat.i
<br>
32c32
<br>
< if(NOT DEFINED PHP_INSTALL_DIR)
<br>
---
<br>
> #if(NOT DEFINED PHP_INSTALL_DIR)
<br>
36a37,38
<br>
> <br>
> <br>
37a40,63
<br>
> <br>
> <br>
> <br>
> execute_process(COMMAND ${PHP_CONFIG_EXECUTABLE} --vernum
<br>
> OUTPUT_VARIABLE PHP_VERSION_ID
<br>
> <br>
> )
<br>
> message("version a: ${PHP_VERSION_ID}")
<br>
> <br>
> message("version a: ${PHP_CONFIG_EXECUTABLE}")
<br>
> <br>
> <br>
> execute_process(COMMAND ${PHP_CONFIG_EXECUTABLE}
--include-dir
<br>
> OUTPUT_VARIABLE PHP_INCLUDE_DIR
<br>
> <br>
> )
<br>
> <br>
> message("versionaa: ${PHP_INCLUDE_DIR}")
<br>
> <br>
> <br>
> string(REGEX REPLACE "\n" "" PHP_INCLUDE_DIR
"${PHP_INCLUDE_DIR}")
<br>
> string(REGEX REPLACE "\n" "" PHP_VERSION_ID
"${PHP_VERSION_ID}")
<br>
> <br>
> <br>
43c69
<br>
< endif()
<br>
---
<br>
> #endif()
<br>
72a99,101
<br>
> message("include: ${PHP_INCLUDE_DIR}")
<br>
> <br>
> message("version: ${PHP_VERSION_ID}")<br>
<br>
<br>
</span></p>
</body>
</html>