Name libaom3
Description AV1 Video Codec Library
Version 3.12.1-1
Package Base aom
Homepage https://aomedia.googlesource.com/aom/
Maintainers ['Debian Multimedia Maintainers <debian-multimedia@lists.debian.org>']
Contributors ['James Cowgill <jcowgill@debian.org>']
Distro-repo https://salsa.debian.org/multimedia-team/aom
Sources ['https://sources.debian.org/data/main/a/aom/3.12.1-1/debian/watch', 'https://sources.debian.org/src/aom/3.12.1-1/debian/patches/0001-doc-Use-libjs-mathjax-rather-than-cloudflare-copy.patch', 'https://sources.debian.org/src/aom/3.12.1-1/debian/patches/0002-use-system-libyuv.patch', 'https://sources.debian.org/src/aom/3.12.1-1/debian/patches/0003-use-system-libwebm.patch', 'https://sources.debian.org/src/aom/3.12.1-1/debian/patches/series']
Dependencies ['libc6']
Optional-Dependencies []
Build-Dependencies ['cmake', 'debhelper-compat', 'libyuv-dev', 'libwebm-dev', 'pkgconf', 'yasm [any-amd64 any-i386]', 'ffmpeg <!nocheck>', 'bc <!nocheck>']
Provides []
Builddate
Architecture amd64
Distro-Version trixie
Licenses []
Hash 16321210c4a3e27bf5ad1d56c1f09c9f7958f0c8ec3b8ae894ea1be322c5d055
#!/usr/bin/make -f

include /usr/share/dpkg/default.mk
include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS := hardening=+all
export DEB_LDFLAGS_MAINT_APPEND := -Wl,-z,defs

# In the normative branch, we need to manually set the target cpu to
# enable optimisation
ifeq ($(DEB_HOST_ARCH_CPU),arm64)
  TARGET_CPU = arm64
else ifeq ($(DEB_HOST_ARCH_CPU)_$(DEB_HOST_ARCH_ABI),arm_eabihf)
  TARGET_CPU = armv7
  # Explicitly disable NEON for Debian armhf baseline requirement
  CONFIG_EXTRA := -DENABLE_NEON=0
else ifneq ($(filter mips64%, $(DEB_HOST_ARCH_CPU)),)
  TARGET_CPU = mips64
else ifneq ($(filter mips%, $(DEB_HOST_ARCH_CPU)),)
  TARGET_CPU = mips32
else ifneq ($(filter ppc% powerpc%, $(DEB_HOST_ARCH_CPU)),)
  TARGET_CPU = ppc
else ifeq ($(DEB_HOST_ARCH_CPU)_$(DEB_HOST_ARCH_ABI),amd64_base)
  TARGET_CPU = x86_64
else ifeq ($(DEB_HOST_ARCH_CPU),i386)
  TARGET_CPU = x86
else
  TARGET_CPU = generic
endif

# Disable AltiVec on powerpcspe
ifeq ($(DEB_HOST_ARCH),powerpcspe)
  CONFIG_EXTRA := -DENABLE_VSX=OFF
endif

# Explicitly set internal flag CONFIG_BIG_ENDIAN, because
# aom CMake buildsystem does not detect endian issue and
# cannot set this internal flag correctly.
# Ref: https://bugs.chromium.org/p/aomedia/issues/detail?id=3487#c20
ifeq ($(DEB_BUILD_ARCH_ENDIAN),little)
  CONFIG_EXTRA_ENDIAN := -DCONFIG_BIG_ENDIAN=0
else
  CONFIG_EXTRA_ENDIAN := -DCONFIG_BIG_ENDIAN=1
endif


# Use -Bbuild-debian to locate built documentation
%:
	dh $@ -Bbuild-debian

# Force building with system libyuv and webm
execute_before_dh_auto_configure:
	rm -rf $(CURDIR)/third_party/libyuv
	rm -rf $(CURDIR)/third_party/libwebm

# Tests disabled because they require network access to download test
#  data.
#
# Setting GIT_EXECUTABLE to some invalid file prevents the version
#  being taken from git if we're on a Debian packaging git branch.
#
# For FORCE_HIGHBITDEPTH_DECODING, see git commit
# 2dd87d9b05b36811aaf19d3c4e47e6e04ccf9de8.
#
override_dh_auto_configure:
	dh_auto_configure -- \
		-DBUILD_SHARED_LIBS=1 \
		-DFORCE_HIGHBITDEPTH_DECODING=0 \
		-DCONFIG_LIBYUV=1 \
		-DCONFIG_MULTITHREAD=1 \
		-DENABLE_TESTS=0 \
		-DGIT_EXECUTABLE=/nonexistant-binary \
		-DAOM_TARGET_CPU=$(TARGET_CPU) \
		$(CONFIG_EXTRA_ENDIAN) \
		$(CONFIG_EXTRA)

# Do not compress html changelog which breaks documentation
override_dh_compress:
	dh_compress -Xchangelog.html

override_dh_auto_test:
	dh_auto_test
	PATH=$$PATH:$(CURDIR)/build-debian AUTOPKGTEST_TMP=build-debian ./debian/tests/encode-decode
	CFLAGS=-I$(CURDIR) LDFLAGS="-laom -L$(CURDIR)/build-debian" AUTOPKGTEST_TMP=build-debian ./debian/tests/library-build

# Currently manually invoked before build. Not invoked during build.
help2man:
	help2man --version-string='$(DEB_VERSION_UPSTREAM)' -n 'AOMedia Project AV1 Encoder' -N --no-discard-stderr debian/tmp/usr/bin/aomenc > debian/aomenc.1
	help2man --version-string='$(DEB_VERSION_UPSTREAM)' -n 'AOMedia Project AV1 Decoder' -N --no-discard-stderr debian/tmp/usr/bin/aomdec > debian/aomdec.1

.PHONY: help2man