Skip to content

Installation not DESTDIR-aware #10627

@Aethedor

Description

@Aethedor

I use mbed TLS in my project, the Hiawatha webserver. When building the package, the installation of the mbed TLS library files fails. I have to patch the file library/CMakeLists.txt to make it work:

diff -ur mbedtls/library/CMakeLists.txt mbedtls/library/CMakeLists.txt
--- mbedtls/library/CMakeLists.txt      2025-10-14 18:14:11.800256300 +0200
+++ mbedtls/library/CMakeLists.txt      2026-02-21 17:34:48.801654113 +0100
@@ -362,7 +362,7 @@
                     RENAME "libmbedcrypto.so.${MBEDTLS_VERSION}"
             )
             install(CODE "
-                set(_libdir \"\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\")
+                set(_libdir \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\")

                 execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink
                                 \"libmbedcrypto.so.${MBEDTLS_VERSION}\"

If you want to see for your self, try the Hiawatha source: https://hiawatha.leisink.net/files/hiawatha-12.0.tar.gz The script extra/make_debian_package builds the package I was talking about. That one sets the DESTDIR environment variable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component-platformPortability layer and build scriptsenhancementhelp-wantedThis issue is not being actively worked on, but PRs welcome.size-sEstimated task size: small (~2d)

    Projects

    Status

    Incoming

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions