[med-svn] [Git][med-team/cmaple][master] Splilt into separate lib and libdevel package; add autopkgtest

Andreas Tille (@tille) gitlab at salsa.debian.org
Sat Sep 12 22:38:26 BST 2026



Andreas Tille pushed to branch master at Debian Med / cmaple


Commits:
b1382776 by Andreas Tille at 2026-09-12T23:00:45+02:00
Splilt into separate lib and libdevel package; add autopkgtest

- - - - -


9 changed files:

- + debian/README.test
- + debian/cmaple.install
- debian/control
- + debian/libcmaple-dev.install
- + debian/libcmaple2.install
- + debian/tests/cli-smoke
- + debian/tests/control
- + debian/tests/dev-link
- + debian/tests/run-unit-test


Changes:

=====================================
debian/README.test
=====================================
@@ -0,0 +1,8 @@
+Notes on how this package can be tested.
+────────────────────────────────────────
+
+This package can be tested by running the provided test:
+
+    sh run-unit-test
+
+in order to confirm its integrity.


=====================================
debian/cmaple.install
=====================================
@@ -0,0 +1 @@
+usr/bin


=====================================
debian/control
=====================================
@@ -19,6 +19,7 @@ Homepage: https://github.com/iqtree/cmaple
 Package: cmaple
 Architecture: any
 Depends:
+ libcmaple2 (= ${binary:Version}),
  ${shlibs:Depends},
  ${misc:Depends},
 Description: phylogenetic inference method for pandemic-scale epidemiological genomic data
@@ -30,3 +31,41 @@ Description: phylogenetic inference method for pandemic-scale epidemiological ge
  Apart from a standalone software, a set of APIs is provided,
  which allow users to integrate CMAPLE into existing phylogenetic
  inference methods.
+
+Package: libcmaple2
+Section: libs
+Architecture: any
+Depends:
+ ${shlibs:Depends},
+ ${misc:Depends},
+Description: phylogenetic inference method for pandemic-scale epidemiological genomic data (lib)
+ CMAPLE is a C++ reimplementation of MAPLE - a novel likelihood-based
+ phylogenetic inference method for pandemic-scale epidemiological genomic
+ data. CMAPLE is highly optimized for performance and scalability with
+ many new features.
+ .
+ Apart from a standalone software, a set of APIs is provided,
+ which allow users to integrate CMAPLE into existing phylogenetic
+ inference methods.
+ .
+ This package provides the shared library.
+
+Package: libcmaple-dev
+Section: libdevel
+Architecture: any
+Depends:
+ libcmaple2 (= ${binary:Version}),
+ ${shlibs:Depends},
+ ${misc:Depends},
+Description: phylogenetic inference method for pandemic-scale epidemiological genomic data (devel)
+ CMAPLE is a C++ reimplementation of MAPLE - a novel likelihood-based
+ phylogenetic inference method for pandemic-scale epidemiological genomic
+ data. CMAPLE is highly optimized for performance and scalability with
+ many new features.
+ .
+ Apart from a standalone software, a set of APIs is provided,
+ which allow users to integrate CMAPLE into existing phylogenetic
+ inference methods.
+ .
+ This package provides the static library and the header files to
+ expose cmaple API.


=====================================
debian/libcmaple-dev.install
=====================================
@@ -0,0 +1,3 @@
+usr/lib/*/libcmaple.a
+usr/lib/*/libcmaple.so
+usr/include/cmaple
\ No newline at end of file


=====================================
debian/libcmaple2.install
=====================================
@@ -0,0 +1 @@
+usr/lib/*/libcmaple.so.*


=====================================
debian/tests/cli-smoke
=====================================
@@ -0,0 +1,23 @@
+#!/bin/sh
+# autopkgtest: smoke-test the cmaple binary
+set -e
+
+echo "== cmaple --help reports a version =="
+cmaple --help | grep -m1 -oE '[0-9]+(\.[0-9]+)+'
+
+WORKDIR="${AUTOPKGTEST_TMP:-$(mktemp -d)}"
+cp "$(dirname "$0")/data/example.maple" "$WORKDIR/example.maple"
+cp "$(dirname "$0")/data/tree.nwk" "$WORKDIR/tree.nwk"
+cd "$WORKDIR"
+
+echo "== running cmaple on upstream's own example (example.maple + tree.nwk) =="
+cmaple -aln example.maple -t tree.nwk --overwrite
+
+test -s example.maple.treefile
+echo "-- resulting tree (first 200 chars) --"
+head -c 200 example.maple.treefile; echo
+
+# sanity check: it should look like a Newick tree
+grep -q ';' example.maple.treefile
+
+echo "OK: cmaple produced a tree file"


=====================================
debian/tests/control
=====================================
@@ -0,0 +1,5 @@
+Tests: run-unit-test
+Depends: @
+
+Tests: dev-link
+Depends: @, g++, libsimde-dev


=====================================
debian/tests/dev-link
=====================================
@@ -0,0 +1,44 @@
+#!/bin/sh
+# autopkgtest: verify libcmaple-dev's headers and libraries are usable
+set -e
+
+WORKDIR="${AUTOPKGTEST_TMP:-$(mktemp -d)}"
+
+cat > "$WORKDIR/test.cpp" << 'EOF'
+#include <cmaple/cmaple.h>
+#include <iostream>
+
+int main() {
+    std::cout << "CMAPLE version: " << cmaple::getVersion() << std::endl;
+    return 0;
+}
+EOF
+
+# These flags mirror what upstream's own CMakeLists.txt sets when
+# building libcmaple itself, and headers depend on all of them:
+#
+# - utils/tools.h pulls in "#include <cmaple_config.h>" with angle
+#   brackets (not a relative include); that generated header lives at
+#   /usr/include/cmaple/cmaple_config.h, so besides the normal
+#   -I/usr/include we need -I/usr/include/cmaple explicitly.
+# - NUM_STATES is baked into template code throughout the headers
+#   (SeqRegion/SeqRegions etc.) via add_definitions(-DNUM_STATES=4);
+#   consumers must define it identically or these templates won't
+#   even parse.
+# - utils/matrix.h has SIMD (SIMDe) template code directly in the
+#   header, evaluated at the *consumer's* compile time, so the same
+#   -m... ISA flags used to build libcmaple are needed here too, or
+#   GCC warns about (and risks) an ABI mismatch.
+CMAPLE_CXXFLAGS="-I/usr/include/cmaple -DNUM_STATES=4 \
+-msse -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -mavx"
+
+echo "== compiling and linking against the shared library =="
+g++ -std=gnu++20 $CMAPLE_CXXFLAGS "$WORKDIR/test.cpp" -o "$WORKDIR/test_shared" -lcmaple
+"$WORKDIR/test_shared"
+
+echo "== compiling and linking against the static library =="
+g++ -std=gnu++20 -fopenmp $CMAPLE_CXXFLAGS "$WORKDIR/test.cpp" -o "$WORKDIR/test_static" \
+    -Wl,-Bstatic -lcmaple -Wl,-Bdynamic -lz
+"$WORKDIR/test_static"
+
+echo "OK: libcmaple-dev headers/shared/static libs all usable"


=====================================
debian/tests/run-unit-test
=====================================
@@ -0,0 +1,29 @@
+#!/bin/bash
+set -e
+
+pkg=cmaple
+
+export LC_ALL=C.UTF-8
+if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
+  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cp -a /usr/share/doc/${pkg}/examples/* "${AUTOPKGTEST_TMP}"
+
+cd "${AUTOPKGTEST_TMP}"
+
+echo "== cmaple --help reports a version =="
+cmaple --help | grep -m1 -oE '[0-9]+(\.[0-9]+)+'
+
+echo "== running cmaple on upstream example (example.maple + tree.nwk) =="
+cmaple -aln example.maple -t tree.nwk --overwrite
+
+test -s example.maple.treefile
+echo "-- resulting tree (first 200 chars) --"
+head -c 200 example.maple.treefile; echo
+
+# sanity check: it should look like a Newick tree
+grep -q ';' example.maple.treefile
+
+echo "OK: cmaple produced a tree file"



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

-- 
View it on GitLab: https://salsa.debian.org/med-team/cmaple/-/commit/b13827766c3d87dbc46c10494c126227c0d069b3
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/20260912/74769ecf/attachment-0001.htm>


More information about the debian-med-commit mailing list