Andreas Tille pushed to branch master at Debian Med / cmaple


Commits:
20153c4d by Andreas Tille at 2026-09-12T08:39:48+02:00
Build libcmaple.a and install public headers for libcmaple-dev

- - - - -


2 changed files:

- + debian/patches/install_headers+static_lib.patch
- debian/patches/series


Changes:

=====================================
debian/patches/install_headers+static_lib.patch
=====================================
@@ -0,0 +1,82 @@
+Description: Build libcmaple.a and install public headers for libcmaple-dev
+Author: Andreas Tille <[email protected]>
+Last-Update: 2026-09-12
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -91,6 +91,15 @@ else()
+     set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) # Enable IPO (LTO) by default
+ endif()
+ 
++# cmaple_static (see below) archives the very same object files that
++# cmaple_shared is linked from. With plain "-flto" GCC emits slim
++# (bytecode-only) objects, which makes libcmaple.a effectively empty
++# outside of a matching LTO link step. Fat objects keep real code in
++# the same .o, so the static archive is a normal, self-contained lib.
++if (CMAKE_INTERPROCEDURAL_OPTIMIZATION AND CMAKE_CXX_COMPILER_ID STREQUAL 
"GNU")
++    add_compile_options(-ffat-lto-objects)
++endif()
++
+ # The version number.
+ set (cmaple_VERSION_MAJOR 2)
+ set (cmaple_VERSION_MINOR 0)
+@@ -338,6 +347,23 @@ set_target_properties(cmaple_shared PROP
+ 
+ target_link_libraries(cmaple_shared PUBLIC ${ZLIB_LIBRARIES})
+ 
++# --- Build combined static library for Debian (libcmaple-dev) ---
++add_library(cmaple_static STATIC
++    $<TARGET_OBJECTS:maple>
++    $<TARGET_OBJECTS:cmaple_tree>
++    $<TARGET_OBJECTS:cmaple_model>
++    $<TARGET_OBJECTS:cmaple_alignment>
++    $<TARGET_OBJECTS:cmaple_utils>
++    $<TARGET_OBJECTS:ncl>
++    $<TARGET_OBJECTS:nclextra>
++)
++
++set_target_properties(cmaple_static PROPERTIES
++    OUTPUT_NAME "cmaple"
++)
++
++target_link_libraries(cmaple_static PUBLIC ${ZLIB_LIBRARIES})
++
+ ##################################################################
+ # the main executable
+ ##################################################################
+@@ -371,6 +397,25 @@ if (INSTALL_CMAPLE)
+     install (TARGETS cmaple_shared
+              LIBRARY DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}
+              ARCHIVE DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE})
++    install (TARGETS cmaple_static
++             ARCHIVE DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE})
++    install (FILES "${PROJECT_BINARY_DIR}/cmaple_config.h" DESTINATION 
"include/cmaple")
++    install (FILES "${PROJECT_SOURCE_DIR}/cmaple.h" DESTINATION 
"include/cmaple")
++    install (DIRECTORY "${PROJECT_SOURCE_DIR}/maple/"
++             DESTINATION "include/cmaple/maple"
++             FILES_MATCHING PATTERN "*.h")
++    install (DIRECTORY "${PROJECT_SOURCE_DIR}/tree/"
++             DESTINATION "include/cmaple/tree"
++             FILES_MATCHING PATTERN "*.h")
++    install (DIRECTORY "${PROJECT_SOURCE_DIR}/model/"
++             DESTINATION "include/cmaple/model"
++             FILES_MATCHING PATTERN "*.h")
++    install (DIRECTORY "${PROJECT_SOURCE_DIR}/alignment/"
++             DESTINATION "include/cmaple/alignment"
++             FILES_MATCHING PATTERN "*.h")
++    install (DIRECTORY "${PROJECT_SOURCE_DIR}/utils/"
++             DESTINATION "include/cmaple/utils"
++             FILES_MATCHING PATTERN "*.h")
+     if (USE_CMAPLE_AA)
+         install (TARGETS cmaple-aa DESTINATION bin)
+     endif()
+--- /dev/null
++++ b/cmaple.h
+@@ -0,0 +1,6 @@
++/* Convenience umbrella header for the CMAPLE public API, added for
++ * Debian packaging. Just forwards to upstream's own umbrella header.
++ */
++#pragma once
++
++#include "maple/cmaple.h"
+


=====================================
debian/patches/series
=====================================
@@ -1,3 +1,4 @@
 debian-packaged-libs.patch
 shared_libs_on.patch
 single_shared_lib.patch
+install_headers+static_lib.patch



View it on GitLab: 
https://salsa.debian.org/med-team/cmaple/-/commit/20153c4dcf654dfd48095fef1c37560117ff87a0

-- 
View it on GitLab: 
https://salsa.debian.org/med-team/cmaple/-/commit/20153c4dcf654dfd48095fef1c37560117ff87a0
You're receiving this email because of your account on salsa.debian.org. Manage 
all notifications: https://salsa.debian.org/-/profile/notifications | Help: 
https://salsa.debian.org/help


_______________________________________________
debian-med-commit mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to