[med-svn] [Git][med-team/libpinchesandcacti][master] 3 commits: Fix build with new upstream fork

Andreas Tille (@tille) gitlab at salsa.debian.org
Tue Nov 3 10:04:14 GMT 2026



Andreas Tille pushed to branch master at Debian Med / libpinchesandcacti


Commits:
54b56f65 by Andreas Tille at 2026-10-29T11:46:35+01:00
Fix build with new upstream fork

Build the additional upstream sources and replace the sonLib list constructor that is not available in the packaged sonLib version.

- - - - -
18a0f8b9 by Andreas Tille at 2026-10-29T11:57:50+01:00
Run upstream test suite in build and autopkgtest

Use upstream's make test target at build time and ship the upstream tests as examples for the Debian Med style run-unit-test autopkgtest instead of a separate consumer program.

- - - - -
225eb9c1 by Andreas Tille at 2026-11-03T09:58:21+01:00
Build-/Test-Depends: libcutest-dev

- - - - -


12 changed files:

- debian/README.test
- debian/changelog
- debian/control
- debian/copyright
- debian/libpinchesandcacti-dev.examples
- + debian/patches/0001-Use-available-sonLib-list-constructor.patch
- + debian/patches/series
- debian/rules
- − debian/tests/consumer.c
- debian/tests/control
- debian/tests/run-unit-test
- debian/upstream/metadata


Changes:

=====================================
debian/README.test
=====================================
@@ -1,7 +1,7 @@
 Notes on how this package can be tested.
 ────────────────────────────────────────
 
-This package can be tested by running the provided test:
+This package can be tested by running the upstream unit test suite:
 
     sh run-unit-test
 


=====================================
debian/changelog
=====================================
@@ -3,6 +3,11 @@ libpinchesandcacti (0.0~git20261029.1d38818-1) UNRELEASED; urgency=medium
   * Change packaging to fork which immediately replaced non-free parts
   * New upstream version
   * Reflow Uploaders field (cme)
+  * Build the new upstream sources and use the available sonLib list
+    constructor
+  * Run the upstream unit test suite at build time and in the autopkgtest
+    instead of a separate consumer program
+  * Build-/Test-Depends: libcutest-dev
 
  -- Andreas Tille <tille at debian.org>  Thu, 29 Oct 2026 10:47:27 +0100
 


=====================================
debian/control
=====================================
@@ -7,6 +7,8 @@ Section: science
 Build-Depends:
  debhelper-compat (= 14),
  d-shlibs,
+ libcutest-dev,
+ libquicktree-dev,
  libsonlib-dev,
 Vcs-Browser: https://salsa.debian.org/med-team/libpinchesandcacti
 Vcs-Git: https://salsa.debian.org/med-team/libpinchesandcacti.git


=====================================
debian/copyright
=====================================
@@ -5,22 +5,26 @@ Files-Excluded:
  externalTools
 
 Files: *
-Copyright: 2009-2024 Benedict Paten <benedictpaten at gmail.com>
+Copyright: 2009-2026 Benedict Paten <benedictpaten at gmail.com>
 License: MIT
 
-Files: impl/stCactusGraphs.c
-Copyright: 2009-2024 Benedict Paten <benedictpaten at gmail.com>
-           2014 Erik Garrison
+Files: impl/stThreeEdgeConnected.c
+Copyright: 2014 Erik Garrison
 License: MIT
-Comment: The three-edge-connected component code is a C port of the independent
- MIT implementation in vg, src/algorithms/three_edge_connected_components.cpp,
- Copyright (c) 2014 Erik Garrison.  vg's bundled copy of pinchesAndCacti under
- deps/ was not used.
+Comment: The three-edge-connected component code is a C translation of the
+ independent MIT implementation in vg,
+ src/algorithms/three_edge_connected_components.cpp, Copyright (c) 2014 Erik
+ Garrison.  vg's bundled copy of pinchesAndCacti under deps/ was not used.
 
 Files: debian/*
 Copyright: 2026 Andreas Tille <tille at debian.org>
 License: MIT
 
+Files: debian/tests/CuTest.*
+Copyright: 2002-2003 Asim Jalis <asimjalis at gmail.com>
+License: Zlib
+Comment: CuTest 1.5, copied from sonLib's externalTools/cutest.
+
 License: MIT
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
@@ -39,3 +43,23 @@ License: MIT
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.
+
+License: Zlib
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+ .
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+ .
+ 1. The origin of this software must not be misrepresented; you must not
+    claim that you wrote the original software. If you use this software
+    in a product, an acknowledgment in the product documentation would be
+    appreciated but is not required.
+ .
+ 2. Altered source versions must be plainly marked as such, and must not
+    be misrepresented as being the original software.
+ .
+ 3. This notice may not be removed or altered from any source
+    distribution.


=====================================
debian/libpinchesandcacti-dev.examples
=====================================
@@ -1 +1,6 @@
-debian/tests/consumer.c
+debian/README.test
+debian/tests/run-unit-test
+debian/tests/CuTest.c
+debian/tests/CuTest.h
+debian/tests/CuTest.LICENSE
+tests/*


=====================================
debian/patches/0001-Use-available-sonLib-list-constructor.patch
=====================================
@@ -0,0 +1,19 @@
+Description: Use stList_construct() instead of stList_constructWithCapacity()
+ stList_constructWithCapacity() is not available in the sonLib version
+ packaged for Debian (1.1+git20220915).  It only preallocates the list
+ capacity, so stList_construct() is a drop-in replacement.
+Author: Andreas Tille <tille at debian.org>
+Last-Update: 2026-10-29
+Assisted-By: deepseek-v4.1-flash-free
+
+--- a/impl/stPinchGraphs.c
++++ b/impl/stPinchGraphs.c
+@@ -1478,7 +1478,7 @@
+     stList *adjacencyComponents = stList_construct3(0, (void(*)(void *)) stList_destruct);
+     for (int64_t i = 0; i < flat->numComponents; i++) {
+         stPinchComponent *component = stPinchAdjacencyComponents_get(flat, i);
+-        stList *adjacencyComponent = stList_constructWithCapacity(component->length > 0 ? component->length : 1, NULL);
++        stList *adjacencyComponent = stList_construct();
+         for (int64_t j = 0; j < component->length; j++) {
+             stList_append(adjacencyComponent, component->ends[j]);
+             stPinchEnd_setComponent(component->ends[j], adjacencyComponent);


=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+0001-Use-available-sonLib-list-constructor.patch


=====================================
debian/rules
=====================================
@@ -2,24 +2,24 @@
 
 export DH_VERBOSE = 1
 
-# Upstream's makefile wants a sonLib checkout next to the source tree (and
-# builds a CuTest test binary), so compile the library directly.  Its
-# DPkg::Buildsystem is therefore disabled and the *.install files take the
-# build products.
-SOURCES = impl/stPinchGraphs.c impl/stCactusGraphs.c
+# Upstream's makefile wants a sonLib checkout next to the source tree, so
+# compile the library directly.  Its DPkg::Buildsystem is therefore disabled
+# and the *.install files take the build products.
+SOURCES = impl/stPinchGraphs.c impl/stCactusGraphs.c \
+	  impl/stPinchPhylogeny.c impl/stThreeEdgeConnected.c
 INCLUDES = -Iinc -I/usr/include/sonLib
 # libsonlib.so.1 is linked with -z now and leaves the quicktree symbols it
 # needs undefined, so it cannot be loaded at all.  Do not link the shared
-# library against it: the sonLib symbols stay undefined there and the consumer
+# library against it: the sonLib symbols stay undefined there and the caller
 # supplies them from the static archive, exactly as it already has to for
 # libpinchesandcacti.a.
-LIBS = -l:libsonlib.a -lm -lpthread
 LIB = libpinchesandcacti.so
 SONAME = $(LIB).0
 REAL = $(LIB).0.0.0
 
 override_dh_auto_clean:
 	rm -rf obj libpinchesandcacti.a libpinchesandcacti.so*
+	rm -f *.o
 
 %:
 	dh $@ --buildsystem=none
@@ -46,7 +46,14 @@ execute_after_dh_install:
 
 override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-	$(CC) $(CPPFLAGS) $(CFLAGS) $(INCLUDES) debian/tests/consumer.c \
-		libpinchesandcacti.a $(LIBS) -o obj/consumer
-	obj/consumer
+	mkdir -p obj/sonLib
+	: > obj/sonLib/include.mk
+	$(MAKE) test \
+		sonLibRootDir=obj/sonLib \
+		BINDIR=obj LIBDIR=obj \
+		CC="$(CC)" AR="$(AR)" RANLIB=ranlib \
+		CPPFLAGS="$(CPPFLAGS) -Iinc -I/usr/include/sonLib -I debian/tests" \
+		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
+		LIBDEPENDS="debian/tests/CuTest.c" \
+		LDLIBS="debian/tests/CuTest.c -l:libsonlib.a -lquicktree -lm -lpthread"
 endif


=====================================
debian/tests/consumer.c deleted
=====================================
@@ -1,46 +0,0 @@
-#include <assert.h>
-#include <stdio.h>
-#include <stdint.h>
-#include "sonLib.h"
-#include "stPinchGraphs.h"
-#include "stCactusGraphs.h"
-
-static void *mergeNodeObjects(void *a, void *b) {
-    return *(int64_t *)a > *(int64_t *)b ? a : b;
-}
-
-int main(void) {
-    /* pinch graph */
-    stPinchThreadSet *ts = stPinchThreadSet_construct();
-    stPinchThread *t = stPinchThreadSet_addThread(ts, 1, 1, 100);
-    stPinchThread_split(t, 10);
-    stPinchThread_split(t, 11);
-    stPinchThread *t2 = stPinchThreadSet_addThread(ts, 2, 4, 10);
-    stPinchBlock *b = stPinchBlock_construct2(stPinchThread_getFirst(t));
-    stPinchBlock_construct3(stPinchThread_getFirst(t2), 1);
-    assert(stPinchBlock_getDegree(b) >= 1);
-    assert(stPinchThreadSet_getSize(ts) == 2);
-    assert(stPinchThread_getLength(stPinchThreadSet_getThread(ts, 1)) == 100);
-    stPinchThreadSet_destruct(ts);
-
-    /* cactus graph: triangle 1-2-3 with a leaf 4 and a self loop at 1 */
-    stCactusGraph *g = stCactusGraph_construct();
-    int64_t o1 = 1, o2 = 2, o3 = 3, o4 = 4;
-    stCactusNode *n1 = stCactusNode_construct(g, &o1);
-    stCactusNode *n2 = stCactusNode_construct(g, &o2);
-    stCactusNode *n3 = stCactusNode_construct(g, &o3);
-    stCactusNode *n4 = stCactusNode_construct(g, &o4);
-    stCactusEdgeEnd_construct(g, n1, n2, &o1, &o2);
-    stCactusEdgeEnd_construct(g, n2, n3, &o2, &o3);
-    stCactusEdgeEnd *e31 = stCactusEdgeEnd_construct(g, n3, n1, &o3, &o1);
-    assert(stCactusEdgeEnd_getOtherEdgeEnd(e31) != NULL);
-    stCactusEdgeEnd_construct(g, n3, n4, &o3, &o4);
-    stCactusEdgeEnd_construct(g, n1, n1, &o1, &o1);
-    assert(stCactusGraph_getNodeNumber(g) == 4);
-    stCactusGraph_collapseToCactus(g, mergeNodeObjects, n1);
-    assert(stCactusNode_getObject(n1) != NULL);
-    stCactusGraph_destruct(g);
-
-    printf("PINCHESANDCACTI-OK\n");
-    return 0;
-}


=====================================
debian/tests/control
=====================================
@@ -1,3 +1,3 @@
 Tests: run-unit-test
-Depends: @, build-essential
+Depends: @, build-essential, libcutest-dev, libquicktree-dev, libsonlib-dev
 Restrictions: allow-stderr


=====================================
debian/tests/run-unit-test
=====================================
@@ -13,12 +13,12 @@ fi
 cp -a /usr/share/doc/${pkg}/examples/* "${AUTOPKGTEST_TMP}"
 cd "${AUTOPKGTEST_TMP}"
 
-gcc -O2 -Wall -I/usr/include/pinchesAndCacti -I/usr/include/sonLib \
-	consumer.c -l:libpinchesandcacti.a -l:libsonlib.a -lm -lpthread \
-	-o consumer-static
-./consumer-static | grep -qx PINCHESANDCACTI-OK
+gcc -O2 -Wall -I/usr/include/pinchesAndCacti -I/usr/include/sonLib -I. \
+	*.c -l:libpinchesandcacti.a -l:libsonlib.a -lquicktree \
+	-lm -lpthread -o allTests-static
+./allTests-static
 
-gcc -O2 -Wall -I/usr/include/pinchesAndCacti -I/usr/include/sonLib \
-	consumer.c -lpinchesandcacti -l:libsonlib.a -lm -lpthread \
-	-o consumer-shared
-./consumer-shared | grep -qx PINCHESANDCACTI-OK
+gcc -O2 -Wall -I/usr/include/pinchesAndCacti -I/usr/include/sonLib -I. \
+	*.c -lpinchesandcacti -l:libsonlib.a -lquicktree \
+	-lm -lpthread -o allTests-shared
+./allTests-shared


=====================================
debian/upstream/metadata
=====================================
@@ -1,4 +1,4 @@
-Bug-Database: https://github.com/benedictpaten/pinchesAndCacti/issues
-Bug-Submit: https://github.com/benedictpaten/pinchesAndCacti/issues/new
-Repository: https://github.com/benedictpaten/pinchesAndCacti.git
-Repository-Browse: https://github.com/benedictpaten/pinchesAndCacti
+Bug-Database: https://github.com/ComparativeGenomicsToolkit/pinchesAndCacti/issues
+Bug-Submit: https://github.com/ComparativeGenomicsToolkit/pinchesAndCacti/issues/new
+Repository: https://github.com/ComparativeGenomicsToolkit/pinchesAndCacti.git
+Repository-Browse: https://github.com/ComparativeGenomicsToolkit/pinchesAndCacti



View it on GitLab: https://salsa.debian.org/med-team/libpinchesandcacti/-/compare/a6900f8caaa1e139d0af01f7c6817989015912a1...225eb9c1be656816fb369b53f0af45b4aa387e59

-- 
View it on GitLab: https://salsa.debian.org/med-team/libpinchesandcacti/-/compare/a6900f8caaa1e139d0af01f7c6817989015912a1...225eb9c1be656816fb369b53f0af45b4aa387e59
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/20261103/779f2fdd/attachment-0001.htm>


More information about the debian-med-commit mailing list