Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolut paths? #65

Open
papoteur-mga opened this issue Jun 16, 2022 · 7 comments
Open

Absolut paths? #65

papoteur-mga opened this issue Jun 16, 2022 · 7 comments

Comments

@papoteur-mga
Copy link

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?

@debrouxl
Copy link
Owner

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.

@papoteur-mga
Copy link
Author

Thanks, I will try that.

@adriweb
Copy link
Contributor

adriweb commented Jun 16, 2022

That said, you should be able to just override the paths with the standard cmake (gnu dirs?) variables when invoking it.

@papoteur-mga
Copy link
Author

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?

@adriweb
Copy link
Contributor

adriweb commented Jun 17, 2022 via email

@papoteur-mga
Copy link
Author

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

@adriweb
Copy link
Contributor

adriweb commented Jun 17, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants