Name re2
Description
Version 20240702-3
Package Base
Homepage
Maintainers ['Stefano Rivera <stefanor@debian.org>']
Contributors []
Distro-repo https://salsa.debian.org/debian/re2
Sources ['https://sources.debian.org/data/main/r/re2/20240702-3/debian/watch', 'https://sources.debian.org/src/re2/20240702-3/debian/patches/debian-unicode-data.patch', 'https://sources.debian.org/src/re2/20240702-3/debian/patches/parallel-test-runner.patch', 'https://sources.debian.org/src/re2/20240702-3/debian/patches/python-existing-dir.patch', 'https://sources.debian.org/src/re2/20240702-3/debian/patches/python-no-bazel.patch', 'https://sources.debian.org/src/re2/20240702-3/debian/patches/series']
Dependencies []
Optional-Dependencies []
Build-Dependencies ['debhelper-compat', 'dh-python', 'libabsl-dev', 'libbenchmark-dev', 'libgtest-dev', 'pkgconf', 'pybuild-plugin-pyproject', 'python3', 'python3-absl', 'python3-all-dev', 'python3-pybind11', 'python3-setuptools', 'unicode-data']
Provides []
Builddate
Architecture amd64
Distro-Version trixie
Licenses []
Hash
#!/usr/bin/make -f

export DEB_CXXFLAGS_MAINT_APPEND=-pthread -Wall -std=c++14
export DEB_LDFLAGS_MAINT_APPEND=-pthread
export CXXFLAGS=$(shell dpkg-buildflags --get CXXFLAGS | sed s/-O2/-O3/)

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIB_PKG = libre2-11
ABI_PKG = $(LIB_PKG)-absl$(shell pkgconf --modversion absl_base)

%:
	dh $@ --with python3

execute_after_dh_auto_clean:
	dh_auto_clean --sourcedir=python --buildsystem pybuild

execute_after_dh_auto_configure:
	dh_auto_configure --sourcedir=python --buildsystem pybuild

override_dh_auto_build:
	rm -f re2/perl_groups.cc re2/unicode_casefold.cc re2/unicode_groups.cc
	dh_auto_build -- REBUILD_TABLES=1
	dh_auto_build --sourcedir=python --buildsystem pybuild

override_dh_auto_install:
	dh_auto_install -- prefix=/usr libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
	dh_auto_install --sourcedir=python --buildsystem pybuild

execute_after_dh_auto_test:
	dh_auto_test --sourcedir=python --buildsystem pybuild -- \
	             --test-custom \
	             --test-args="cd {build_dir} && cp {dir}/re2_test.py . && LD_LIBRARY_PATH=$(CURDIR)/obj/so {interpreter} re2_test.py; rm -f re2_test.py"

override_dh_makeshlibs:
	echo "re2:Provides=$(ABI_PKG)" >> debian/$(LIB_PKG).substvars
	dh_makeshlibs -p$(LIB_PKG) -V "$(ABI_PKG)"
	dh_makeshlibs --remaining-packages

override_dh_installdocs:
	dh_installdocs --link-doc=$(LIB_PKG)

override_dh_gencontrol:
	dh_gencontrol -- -VBuilt-Using='$(shell dpkg-query -f'$${source:Package} (= $${source:Version})' -W unicode-data)'