[med-svn] [Git][med-team/lsd2][master] Add library packages to enable linking against iqtree3

Andreas Tille (@tille) gitlab at salsa.debian.org
Tue Sep 15 10:00:35 BST 2026



Andreas Tille pushed to branch master at Debian Med / lsd2


Commits:
234b9280 by Andreas Tille at 2026-09-15T10:21:15+02:00
Add library packages to enable linking against iqtree3

- - - - -


6 changed files:

- debian/changelog
- debian/control
- + debian/patches/build-shared-and-static-lib.patch
- + debian/patches/main-cpp.patch
- + debian/patches/series
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+lsd2 (1.9.9+dfsg-2) UNRELEASED; urgency=medium
+
+  * Create library packages
+
+ -- Andreas Tille <tille at debian.org>  Tue, 15 Sep 2026 09:11:35 +0200
+
 lsd2 (1.9.9+dfsg-1) unstable; urgency=medium
 
   * Initial release (Closes: 1147568)


=====================================
debian/control
=====================================
@@ -3,7 +3,8 @@ Section: science
 Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
 Uploaders: Andreas Tille <tille at debian.org>
 Build-Depends: debhelper-compat (= 14),
-               cmake
+ d-shlibs,
+ cmake,
 Standards-Version: 4.7.4
 Vcs-Browser: https://salsa.debian.org/med-team/lsd2
 Vcs-Git: https://salsa.debian.org/med-team/lsd2.git
@@ -11,8 +12,10 @@ Homepage: https://github.com/tothuhien/lsd2
 
 Package: lsd2
 Architecture: any
-Depends: ${shlibs:Depends},
-         ${misc:Depends}
+Depends:
+ liblsd2-0 (= ${binary:Version}),
+ ${shlibs:Depends},
+ ${misc:Depends}
 Description: least-squares method to estimate rates and dates from phylogenies
  LSD2 (Least-Squares Dating) infers substitution rates and node dates
  on a fixed phylogenetic tree topology using least-squares criteria.
@@ -27,3 +30,50 @@ Description: least-squares method to estimate rates and dates from phylogenies
  .
  LSD2 is also integrated as a library into IQ-TREE for divergence-time
  estimation.
+
+Package: liblsd2-0
+Architecture: any
+Section: libs
+Depends:
+ ${shlibs:Depends},
+ ${misc:Depends}
+Description: least-squares method to estimate rates and dates from phylogenies (lib)
+ LSD2 (Least-Squares Dating) infers substitution rates and node dates
+ on a fixed phylogenetic tree topology using least-squares criteria.
+ .
+ Features include:
+  * rooted and unrooted input trees, with or without outgroups;
+  * flexible tip/internal-node date constraints (fixed dates, bounds,
+    or intervals), including trees with only partially known dates;
+  * multiple substitution rates via user-defined tree partitions;
+  * confidence interval estimation via parametric bootstrap;
+  * detection and removal of outlier tips/dates.
+ .
+ LSD2 is also integrated as a library into IQ-TREE for divergence-time
+ estimation.
+ .
+ This package contains the shared library.
+
+Package: liblsd2-dev
+Architecture: any
+Section: libdevel
+Depends:
+ liblsd2-0 (= ${binary:Version}),
+ ${shlibs:Depends},
+ ${misc:Depends}
+Description: least-squares method to estimate rates and dates from phylogenies (libdev)
+ LSD2 (Least-Squares Dating) infers substitution rates and node dates
+ on a fixed phylogenetic tree topology using least-squares criteria.
+ .
+ Features include:
+  * rooted and unrooted input trees, with or without outgroups;
+  * flexible tip/internal-node date constraints (fixed dates, bounds,
+    or intervals), including trees with only partially known dates;
+  * multiple substitution rates via user-defined tree partitions;
+  * confidence interval estimation via parametric bootstrap;
+  * detection and removal of outlier tips/dates.
+ .
+ LSD2 is also integrated as a library into IQ-TREE for divergence-time
+ estimation.
+ .
+ This package contains the static library and the header files.


=====================================
debian/patches/build-shared-and-static-lib.patch
=====================================
@@ -0,0 +1,49 @@
+Description: Build both a shared and a static liblsd2, plus main.cpp as the executable
+Author: Andreas Tille <tille at debian.org>
+Last-Update: 2026-09-15
+Forwarded: not needed
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -3,14 +3,18 @@
+ # Added by Bui Quang Minh in April 2020
+ ##################################################################
+ 
++cmake_minimum_required(VERSION 4.3)
++
+ # Build Release mode by default with compiler optimizations turned on (e.g. -O3)
+ if (NOT CMAKE_BUILD_TYPE)
+     set(CMAKE_BUILD_TYPE "Release")
+ endif()
+ 
+ if (USE_LSD2)
+-    # compile LSD2 as a library
+-    add_library(lsd2
++    # compile LSD2 as a shared and a static library, plus an
++    # executable (main.cpp, see debian/patches/main-cpp.patch) linked
++    # against the shared library
++    set(LSD2_SOURCES
+         src/confidence_interval.cpp
+         src/confidence_interval.h
+         src/date.h
+@@ -34,6 +38,20 @@ if (USE_LSD2)
+         src/utils.cpp
+         src/utils.h
+     )
++
++    add_library(lsd2_shared SHARED ${LSD2_SOURCES})
++    target_compile_definitions(lsd2_shared PRIVATE USE_LSD2)
++    set_target_properties(lsd2_shared PROPERTIES
++        OUTPUT_NAME lsd2
++        SOVERSION 0
++    )
++
++    add_library(lsd2_static STATIC ${LSD2_SOURCES})
++    target_compile_definitions(lsd2_static PRIVATE USE_LSD2)
++    set_target_properties(lsd2_static PROPERTIES OUTPUT_NAME lsd2)
++
++    add_executable(lsd2 main.cpp)
++    target_link_libraries(lsd2 lsd2_shared)
+ else()
+     # compile LSD2 as a stand-alone program
+     add_executable(lsd2


=====================================
debian/patches/main-cpp.patch
=====================================
@@ -0,0 +1,21 @@
+Description: Standalone entry point when building as library
+Author: Andreas Tille <tille at debian.org>
+Last-Update: 2026-09-15
+Forwarded: not needed
+
+--- /dev/null
++++ b/main.cpp
+@@ -0,0 +1,13 @@
++/* Standalone entry point for the lsd2 executable when building
++ * against the liblsd2 library (see CMakeLists.txt).
++ */
++#include <iostream>
++#include <string>
++using namespace std;
++
++#include "src/lsd.h"
++
++int main(int argc, char** argv) {
++    return lsd::buildTimeTree(argc, argv);
++}
++


=====================================
debian/patches/series
=====================================
@@ -0,0 +1,2 @@
+main-cpp.patch
+build-shared-and-static-lib.patch


=====================================
debian/rules
=====================================
@@ -7,3 +7,16 @@ export DEB_BUILD_MAINT_OPTIONS=hardening=+all
 
 %:
 	dh $@
+
+override_dh_auto_configure:
+	dh_auto_configure -- -DUSE_LSD2=True
+
+override_dh_install:
+	dh_install
+	d-shlibmove --commit \
+		    --multiarch \
+		    --devunversioned \
+		    --exclude-la \
+		    --movedev src/lsd.h usr/include \
+                    obj-*/*.so
+



View it on GitLab: https://salsa.debian.org/med-team/lsd2/-/commit/234b9280e10c6949a17b991c7aa9a392c0d44ce1

-- 
View it on GitLab: https://salsa.debian.org/med-team/lsd2/-/commit/234b9280e10c6949a17b991c7aa9a392c0d44ce1
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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20260915/c7f5a7cc/attachment-0001.htm>


More information about the debian-med-commit mailing list