Package: primecount
Version: 8.1+ds-1
Severity: normal
Tags: patch upstream
The installed primecount.pc pkg-config file has an empty Version field.
Current (broken) primecount.pc:
prefix=/usr
bindir=/usr/bin
libdir=/usr/lib/x86_64-linux-gnu
includedir=/usr/include
Name: primecount
Description: Fast C/C++ prime counting function library
Version:
Requires.private: primesieve >= 11.0
Cflags: -I${includedir}
Libs: -L${libdir} -lprimecount
Libs.private: -lgomp -lpthread
The Version field is empty because the upstream primecount.pc.in template
uses @PRIMECOUNT_VERSION@, but CMakeLists.txt never defines a variable
called PRIMECOUNT_VERSION. The version is set via:
project(primecount VERSION 8.1)
which creates PROJECT_VERSION (= "8.1"), but not PRIMECOUNT_VERSION.
CMake's configure_file substitutes the undefined @PRIMECOUNT_VERSION@
with an empty string.
This has been fixed upstream on 2026-02-01 with the commit
"Fix missing version in .pc file":
https://github.com/kimwalisch/primecount/commit/HEAD
The fix changes primecount.pc.in from:
Version: @PRIMECOUNT_VERSION@
to:
Version: @PROJECT_VERSION@
Impact: Any software using "pkg-config --modversion primecount" gets an
empty string. Version constraints in Requires or Requires.private from
other packages that depend on primecount will also fail to evaluate
correctly.
Suggested fix: Either pick up the upstream fix by updating to a newer
release, or backport the one-line change to primecount.pc.in:
--- a/primecount.pc.in
+++ b/primecount.pc.in
@@ -6,7 +6,7 @@
Name: primecount
Description: Fast C/C++ prime counting function library
-Version: @PRIMECOUNT_VERSION@
+Version: @PROJECT_VERSION@
Requires.private: primesieve >= 11.0
How to reproduce:
apt install libprimecount-dev
pkg-config --modversion primecount
# Returns empty string instead of "8.1"
cat /usr/lib/x86_64-linux-gnu/pkgconfig/primecount.pc
# Observe "Version: " with no value
-- System Information:
Debian Release: forky/sid
APT prefers resolute
APT policy: (500, 'resolute')
Architecture: amd64 (x86_64)
Kernel: Linux 6.6.87.2-microsoft-standard-WSL2 (SMP w/24 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)