summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@google.com>2023-05-08 17:18:28 -0400
committerGravatar Benjamin Barenblat <bbaren@google.com>2023-05-08 17:30:57 -0400
commit136c2572f4d6e6ab8ae02f74d691634874458184 (patch)
treee7a247d97d3d0f2c4bba7239eaac39b3b9a7d680 /debian
parentffe57f55ed4257bbdf5924112dc7031e094ab226 (diff)
Package test-only targets as static libraries
Abseil 20230125.3 exposes libraries that were formerly internal (“test-only”) so that other packages’ unit tests can refer to them [1]. Some of the new libraries depend on Google Mock, which Debian only ships as a static library; as a result, the new libraries can only be shipped statically as well. Historically, however, Abseil’s Debian packaging has linked Abseil’s unit tests dynamically to improve build speed. (Google Mock was built as a one-off shared library during this process, but it was only ever used in unit tests and was never shipped to users.) Static Abseil builds were unaware that Google Mock existed, which prevented sbuild from building the new libraries [2]. To rectify the situation, change Abseil’s Debian packaging to link Abseil unit tests statically and to ship the new libraries as static archives. Also make libabsl-dev recommend libgmock-dev, since the new libraries are useless without a corresponding Google Mock build. [1] https://github.com/abseil/abseil-cpp/pull/1442 [2] https://bugs.debian.org/1034908
Diffstat (limited to 'debian')
-rw-r--r--debian/control7
-rwxr-xr-xdebian/rules6
2 files changed, 6 insertions, 7 deletions
diff --git a/debian/control b/debian/control
index 9f799db0..b67ae5d7 100644
--- a/debian/control
+++ b/debian/control
@@ -18,7 +18,7 @@ Maintainer: Benjamin Barenblat <bbaren@debian.org>
Build-Depends:
cmake (>= 3.10),
debhelper-compat (= 12),
- googletest (>= 1.12) [!mipsel !ppc64] <!nocheck>
+ googletest (>= 1.12),
Rules-Requires-Root: no
Standards-Version: 4.6.1
Section: libs
@@ -39,7 +39,10 @@ Section: libdevel
Depends:
libabsl20230125 (= ${binary:Version}),
${misc:Depends},
-Recommends: cmake (>= 3.0) | pkg-config, g++ (>= 5.1)
+Recommends:
+ cmake (>= 3.0) | pkg-config,
+ g++ (>= 5.1),
+ libgmock-dev (>= 1.12),
Description: ${source:Synopsis} (development files)
${source:Extended-Description}
.
diff --git a/debian/rules b/debian/rules
index 4a36943e..16d92626 100755
--- a/debian/rules
+++ b/debian/rules
@@ -44,12 +44,8 @@ override_dh_auto_clean:
$(RM) -r $(CURDIR)/shared
override_dh_auto_configure:
- dh_auto_configure -Bstatic -- -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=OFF
-ifeq ($(ABSL_RUN_TESTS),ON)
- dh_auto_configure -Bshared -- -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DABSL_BUILD_TESTING=ON -DABSL_USE_GOOGLETEST_HEAD=OFF
-else
+ dh_auto_configure -Bstatic -- -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DABSL_BUILD_TESTING=ON -DABSL_USE_GOOGLETEST_HEAD=OFF
dh_auto_configure -Bshared -- -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=ON
-endif
override_dh_auto_build:
dh_auto_build -Bstatic