tilibs
tilibs copied to clipboard
Absolut paths?
Hello, I'm trying to package a snapshot of these libraries in Mageia using a rpm package. I use the sequence: cmake cmake build cmake install I use a chrooted environment for the package build (mock). The process ends badly with:
usr/bin/gmake -f libticonv/trunk/CMakeFiles/buildandinstall_libticonv.dir/build.make libticonv/trunk/CMakeFiles/buildandinstall_libticonv.dir/build
gmake[2]: Entering directory '/builddir/build/BUILD/tilibs-8ffa244e522a484146fe0d7c1130a554f8dba48e/build'
/usr/bin/cmake -P libticonv/trunk/cmake_install.cmake --config RelWithDebInfo
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/lib64/libticonv.so.9.0.4
CMake Error at libticonv/trunk/cmake_install.cmake:65 (file):
file INSTALL cannot copy file
"/builddir/build/BUILD/tilibs-8ffa244e522a484146fe0d7c1130a554f8dba48e/build/libticonv/trunk/libticonv.so.9.0.4"
to "/usr/lib64/libticonv.so.9.0.4": Permission denied.
It seems that the process try to write a file at a hardcoded place, this one not been allowed. Do I miss something?
Hi. Try using the autotools definitions, which remain the full-featured build system for libti*, gfm & tilp. The build dependencies are listed in the configure files, or the packaging definitions for other distros (which package these libraries separately): libtifiles, libticables and libticalcs depend on libticonv, and libticalcs additionally depends on libtifiles and libticables. This yields a libticonv, libtifiles, libticables, libticalcs build order.
Thanks, I will try that.
That said, you should be able to just override the paths with the standard cmake (gnu dirs?) variables when invoking it.
That said, you should be able to just override the paths with the standard cmake (gnu dirs?) variables when invoking it.
I didn't check just now, but using a %cmake_install directive in the rpm spec file, this should be added. This is what I have used for tilp2. Does the cmake build all the four libraries at the same time in the specified order?
Well the CMake stuff is also available in the tilibs repo. So if you build and install those, then tilp2 will be able to be installed.
Technically all this works fine on both my machine and CI machines so it must not be that broken :p However, it's done in an unorthodox way that I haven't fixed yet, which is basically installing the libs while building.
I have added the -DCMAKE_INSTALL_PREFIX=%{_buildroot} for the cmake install, but this is not better. Indeed, I see that after building libiconv, the process try to install it, I presume for building the remaining parts. The error occurs in this part of cmake_install.cmake in libiconv/trunk
if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT)
foreach(file
"$ENV{DESTDIR}/usr/lib64/libticonv.so.9.0.4"
"$ENV{DESTDIR}/usr/lib64/libticonv.so.9"
)
if(EXISTS "${file}" AND
NOT IS_SYMLINK "${file}")
file(RPATH_CHECK
FILE "${file}"
RPATH "")
endif()
endforeach()
list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES
"/usr/lib64/libticonv.so.9.0.4;/usr/lib64/libticonv.so.9")
if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
endif()
if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
endif()
file(INSTALL DESTINATION "/usr/lib64" TYPE SHARED_LIBRARY FILES
"/builddir/build/BUILD/tilibs-8ffa244e522a484146fe0d7c1130a554f8dba48e/build/libticonv/trunk/libticonv.so.9.0.4"
"/builddir/build/BUILD/tilibs-8ffa244e522a484146fe0d7c1130a554f8dba48e/build/libticonv/trunk/libticonv.so.9"
)
foreach(file
"$ENV{DESTDIR}/usr/lib64/libticonv.so.9.0.4"
"$ENV{DESTDIR}/usr/lib64/libticonv.so.9"
)
if(EXISTS "${file}" AND
NOT IS_SYMLINK "${file}")
if(CMAKE_INSTALL_DO_STRIP)
execute_process(COMMAND "/usr/bin/strip" "${file}")
endif()
endif()
endforeach()
endif()
on the line
file(INSTALL DESTINATION "/usr/lib64" TYPE SHARED_LIBRARY FILES
Well, I never set those paths myself, though ^^'
Seems like CMake (along with the included GNUInstallDirs
module) chose /usr/lib64/ on your system, which may be fine, but I guess requires sudo.
Which is part of what I said above about my "unorthodox" way of doing things (building things with deps by first installing the previously built ones).
Also, in the install
directive used by all libs it also uses standard cmake variables...
But I clearly wasn't a CMake expert when I did all that, and I'm still not one today despite a bit more experience ... any idea what should be changed?