From b8263a2f8d6df42b2a37c2efc2f7a3ac2b1d658a Mon Sep 17 00:00:00 2001 From: Florian Apolloner and John Knottenbelt Date: Fri, 19 Feb 2016 01:27:36 +0100 Subject: [PATCH 1/2] CPack/Deb Create DEBIAN directory for dpkg-shlibdeps If CMAKE_INSTALL_RPATH is set and contains $ORIGIN then dpkg-shlibdeps searches for the DEBIAN directory in order to resolve $ORIGIN in the rpath to a directory. We need to create the DEBIAN directory for this to work. --- Modules/CPackDeb.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index 2aaef6161..b41d926ff 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -504,6 +504,9 @@ function(cpack_deb_prepare_package_vars) file(MAKE_DIRECTORY ${CPACK_TEMPORARY_DIRECTORY}/debian) file(WRITE ${CPACK_TEMPORARY_DIRECTORY}/debian/control "") + # Create a DEBIAN directory so that dpkg-shlibdeps can find the package dir when resolving $ORIGIN. + file(MAKE_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}/DEBIAN") + # Add --ignore-missing-info if the tool supports it execute_process(COMMAND env LC_ALL=C ${SHLIBDEPS_EXECUTABLE} --help OUTPUT_VARIABLE _TMP_HELP @@ -544,6 +547,9 @@ function(cpack_deb_prepare_package_vars) # Remove blank control file # Might not be safe if package actual contain file or directory named debian file(REMOVE_RECURSE "${CPACK_TEMPORARY_DIRECTORY}/debian") + + # remove temporary directory that was created only for dpkg-shlibdeps execution + file(REMOVE_RECURSE "${CPACK_TEMPORARY_DIRECTORY}/DEBIAN") else() if(CPACK_DEBIAN_PACKAGE_DEBUG) message(AUTHOR_WARNING "CPackDeb Debug: Using only user-provided depends because package does not contain executable files that link to shared libraries.") From e8daee5bd0b68936b89a26e565b010f3387dc158 Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Fri, 19 Feb 2016 01:42:19 +0100 Subject: [PATCH 2/2] CPack/Deb $ORIGIN handling in rpath Release not for fix of bug 12431 --- Help/release/dev/cpack-deb-autodep-ORIGIN-RPATH.rst | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Help/release/dev/cpack-deb-autodep-ORIGIN-RPATH.rst diff --git a/Help/release/dev/cpack-deb-autodep-ORIGIN-RPATH.rst b/Help/release/dev/cpack-deb-autodep-ORIGIN-RPATH.rst new file mode 100644 index 000000000..b0d61964d --- /dev/null +++ b/Help/release/dev/cpack-deb-autodep-ORIGIN-RPATH.rst @@ -0,0 +1,6 @@ +cpack-deb-autodep-ORIGIN-RPATH +-------------------------------- + +* The "CPackDeb" module learned how to handle ``$ORIGIN`` + in ``CMAKE_INSTALL_RPATH`` when :variable:`CPACK_DEBIAN_PACKAGE_SHLIBDEPS` + is used for dependency auto detection.