[med-svn] [Git][med-team/gbwt][master] 7 commits: Build and package a shared libgbwt

Andreas Tille (@tille) gitlab at salsa.debian.org
Thu Oct 22 11:05:43 BST 2026



Andreas Tille pushed to branch master at Debian Med / gbwt


Commits:
7f82a568 by Andreas Tille at 2026-10-22T11:14:51+02:00
Build and package a shared libgbwt

Add a quilt patch that links the existing objects into libgbwt.so with
SONAME libgbwt.so.1.  Compile with -fPIC and install the versioned
library in a new libgbwt1 package, with the unversioned linker symlink
and static library remaining in libgbwt-dev.

Extend the autopkgtest to verify that the test program links against
the shared library rather than the static one.

- - - - -
0e724ec3 by Andreas Tille at 2026-10-22T11:15:46+02:00
Add ITP bug

- - - - -
419ae9d6 by Andreas Tille at 2026-10-22T11:21:59+02:00
Do not explicitly set DEB_HOST_MULTIARCH

- - - - -
2211ea81 by Andreas Tille at 2026-10-22T11:23:07+02:00
Add missing License paragraph

- - - - -
761ee188 by Andreas Tille at 2026-10-22T11:34:55+02:00
Use d-shlibs

- - - - -
5d600ca4 by Andreas Tille at 2026-10-22T11:41:06+02:00
Review DEP3 fields

- - - - -
e8cdbdc2 by Andreas Tille at 2026-10-22T11:43:31+02:00
Upload to unstable

- - - - -


10 changed files:

- debian/changelog
- debian/control
- debian/copyright
- − debian/libgbwt-dev.install
- debian/patches/add_ldflags_cppflags
- + debian/patches/build_shared_library
- debian/patches/series
- debian/patches/use_debian_sdsl
- debian/rules
- debian/tests/smoke


Changes:

=====================================
debian/changelog
=====================================
@@ -1,5 +1,5 @@
-gbwt (1.6-1) UNRELEASED; urgency=medium
+gbwt (1.6-1) unstable; urgency=medium
 
-  * Initial release. (Closes: #XXXXXX)
+  * Initial release. (Closes: #1151617)
 
- -- Andreas Tille <tille at debian.org>  Wed, 21 Oct 2026 17:25:54 +0200
+ -- Andreas Tille <tille at debian.org>  Thu, 22 Oct 2026 11:41:18 +0200


=====================================
debian/control
=====================================
@@ -7,6 +7,7 @@ Uploaders:
 Section: science
 Build-Depends:
  debhelper-compat (= 14),
+ d-shlibs,
  libgtest-dev,
  libsdsl-dev (>= 2.4),
  libzstd-dev,
@@ -15,11 +16,27 @@ Vcs-Browser: https://salsa.debian.org/med-team/gbwt
 Vcs-Git: https://salsa.debian.org/med-team/gbwt.git
 Homepage: https://github.com/jltsiren/gbwt
 
+Package: libgbwt1
+Architecture: any
+Section: libs
+Depends:
+ ${shlibs:Depends},
+ ${misc:Depends},
+Description: Substring index for paths in a graph - shared library
+ Graph BWT is an independent implementation of the graph extension (gPBWT) of
+ the positional Burrows-Wheeler transform (PBWT). Its initial purpose is to
+ embed observed haplotypes in a variation graph. Haplotypes are essentially
+ sequences of nodes in the variation graph, and GBWT is best seen as the
+ multi-string BWT of the node sequences.
+ .
+ This package contains the shared library.
+
 Package: libgbwt-dev
 Architecture: any
 Section: libdevel
 Depends:
  ${misc:Depends},
+ libgbwt1 (= ${binary:Version}),
  libsdsl-dev (>= 2.4),
  libzstd-dev,
 Description: Substring index for paths in a graph


=====================================
debian/copyright
=====================================
@@ -7,7 +7,26 @@ Copyright: 2017, 2018, Jouni Siren
  2015-2017, Genome Research Ltd.
 License: Expat
 
-
 Files: debian/*
-Copyright: © 2018 Michael R. Crusoe <michael.crusoe at gmail.com>
+Copyright: 2018 Michael R. Crusoe <michael.crusoe at gmail.com>
+           2026 Andreas Tille <tille at debian.org>
+License: Expat
+
 License: Expat
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ 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.


=====================================
debian/libgbwt-dev.install deleted
=====================================
@@ -1 +0,0 @@
-include/gbwt/ /usr/include


=====================================
debian/patches/add_ldflags_cppflags
=====================================
@@ -1,5 +1,7 @@
 Description: Add CPPFLAGS, CXXFLAGS and LDFLAGS to the test build
-Assisted-By: opencode/deepseek-v4.1-flash-free
+Author: Michael R. Crusoe <michael.crusoe at gmail.com>
+Last-Update: 2026-10-22
+
 --- a/tests/Makefile
 +++ b/tests/Makefile
 @@ -65,10 +65,10 @@


=====================================
debian/patches/build_shared_library
=====================================
@@ -0,0 +1,36 @@
+Description: Build a shared library in addition to the static one
+ Build libgbwt.so with SONAME libgbwt.so.1, so it can be shipped in a
+ shared-library package.  debian/rules compiles the objects with -fPIC.
+Last-Update: 2026-10-22
+Author: Andreas Tille <tille at debian.org>
+Assisted-By: opencode/deepseek-v4.1-flash-free
+
+--- a/Makefile
++++ b/Makefile
+@@ -58,12 +58,13 @@ CXX_FLAGS=$(MY_CXX_FLAGS) $(PARALLEL_FLA
+ HEADERS=$(wildcard include/gbwt/*.h)
+ LIBOBJS=$(addprefix $(BUILD_OBJ)/,algorithms.o bwtmerge.o cached_gbwt.o dynamic_gbwt.o fast_locate.o files.o gbwt.o internal.o metadata.o support.o test.o utils.o variants.o)
+ LIBRARY=$(BUILD_LIB)/libgbwt.a
++LIBRARY_SHARED=$(BUILD_LIB)/libgbwt.so.1.6
+ 
+ PROGRAMS=$(addprefix $(BUILD_BIN)/,build_gbwt build_ri merge_gbwt benchmark metadata_tool remove_seq)
+ OBSOLETE=build_gbwt build_ri merge_gbwt benchmark metadata_tool remove_seq
+ 
+ .PHONY: all clean directories test
+-all: directories $(LIBRARY) $(PROGRAMS)
++all: directories $(LIBRARY) $(LIBRARY_SHARED) $(PROGRAMS)
+ 
+ directories: $(BUILD_BIN) $(BUILD_LIB) $(BUILD_OBJ)
+ 
+@@ -82,6 +83,11 @@ $(BUILD_OBJ)/%.o:$(SOURCE_DIR)/%.cpp $(H
+ $(LIBRARY):$(LIBOBJS)
+ 	ar rcs $@ $(LIBOBJS)
+ 
++$(LIBRARY_SHARED):$(LIBOBJS)
++	$(MY_CXX) -shared -Wl,-soname,libgbwt.so.1 $(LDFLAGS) $(CXXFLAGS) $(CXX_FLAGS) -o $@ $(LIBOBJS) $(LIBS)
++	ln -sf $(notdir $@) $(BUILD_LIB)/libgbwt.so.1
++	ln -sf libgbwt.so.1 $(BUILD_LIB)/libgbwt.so
++
+ $(BUILD_BIN)/%:$(BUILD_OBJ)/%.o $(LIBRARY)
+ 	$(MY_CXX) $(LDFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(CXX_FLAGS) -o $@ $< $(LIBRARY) $(LIBS)
+ 


=====================================
debian/patches/series
=====================================
@@ -1,2 +1,3 @@
+build_shared_library
 use_debian_sdsl
 add_ldflags_cppflags


=====================================
debian/patches/use_debian_sdsl
=====================================
@@ -1,6 +1,7 @@
 Author: Michael R. Crusoe <michael.crusoe at gmail.com>
 Description: Use sdsl from libsdsl-dev
-Assisted-By: opencode/deepseek-v4.1-flash-free
+Last-Update: 2026-10-26
+
 --- a/Makefile
 +++ b/Makefile
 @@ -1,6 +1,3 @@


=====================================
debian/rules
=====================================
@@ -8,7 +8,7 @@ include /usr/share/dpkg/default.mk
 # for hardening you might like to uncomment this:
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
 CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
-CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) -DNDEBUG
+CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) -DNDEBUG -fPIC
 LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
 
 %:
@@ -17,8 +17,14 @@ LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
 override_dh_auto_build:
 	dh_auto_build -- CPPFLAGS="$(CPPFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" MY_CXX=g++ INC_DIR=/usr/include LIB_DIR=/usr/lib
 
-override_dh_auto_install:
-	install -D -m 0644 lib/libgbwt.a debian/libgbwt-dev/usr/lib/$(shell dpkg-architecture --query DEB_HOST_MULTIARCH)/libgbwt.a
+execute_after_dh_install:
+	d-shlibmove --commit \
+		    --multiarch \
+		    --devunversioned \
+		    --exclude-la \
+		    --override 's/libsdsl4-dev/libsdsl-dev/' \
+                    --movedev include/gbwt usr/include \
+                    lib/libgbwt.so
 
 override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))


=====================================
debian/tests/smoke
=====================================
@@ -10,4 +10,5 @@ cp "$(dirname "$0")/smoke.cpp" "$AUTOPKGTEST_TMP/"
 cd "$AUTOPKGTEST_TMP"
 
 g++ -std=c++17 -O2 -Wall -Wextra -fopenmp -o smoke smoke.cpp -lgbwt -lsdsl -lzstd
+ldd ./smoke | grep -q 'libgbwt\.so'
 ./smoke



View it on GitLab: https://salsa.debian.org/med-team/gbwt/-/compare/4cfa17cc0a264f61b904f27a3b9ee970f690f10f...e8cdbdc25221ac1b36b1f408148f81d9b49f0dd3

-- 
View it on GitLab: https://salsa.debian.org/med-team/gbwt/-/compare/4cfa17cc0a264f61b904f27a3b9ee970f690f10f...e8cdbdc25221ac1b36b1f408148f81d9b49f0dd3
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/20261022/67c05563/attachment-0001.htm>


More information about the debian-med-commit mailing list