Name libjxl0.11
Description JPEG XL Image Coding System - "JXL" (shared libraries)
Version 0.11.1-4
Package Base jpeg-xl
Homepage https://github.com/libjxl/libjxl
Maintainers ['Debian PhotoTools Maintainers <pkg-phototools-devel@lists.alioth.debian.org>']
Contributors ['Mathieu Malaterre <malat@debian.org>']
Distro-repo https://salsa.debian.org/debian-phototools-team/libjxl
Sources ['https://sources.debian.org/data/main/j/jpeg-xl/0.11.1-4/debian/watch', 'https://sources.debian.org/src/jpeg-xl/0.11.1-4/debian/patches/0008-Fix-conformance-test.patch', 'https://sources.debian.org/src/jpeg-xl/0.11.1-4/debian/patches/bigendian.patch', 'https://sources.debian.org/src/jpeg-xl/0.11.1-4/debian/patches/extras_codec_symbols.patch', 'https://sources.debian.org/src/jpeg-xl/0.11.1-4/debian/patches/help_return_no_error.patch', 'https://sources.debian.org/src/jpeg-xl/0.11.1-4/debian/patches/hwy.patch', 'https://sources.debian.org/src/jpeg-xl/0.11.1-4/debian/patches/manpages.patch', 'https://sources.debian.org/src/jpeg-xl/0.11.1-4/debian/patches/series']
Dependencies ['libbrotli1', 'libc6', 'libgcc-s1', 'libhwy1t64', 'liblcms2-2', 'libstdc++6']
Optional-Dependencies []
Build-Dependencies ['asciidoc-base', 'gcc-13 [hppa powerpc ppc64 riscv64 sparc64 s390x]', 'g++-13 [hppa powerpc ppc64 riscv64 sparc64 s390x]', 'cmake', 'debhelper-compat', 'default-jdk [amd64 arm64 armel armhf i386 mips64el ppc64el riscv64 s390x alpha ia64 m68k powerpc ppc64 sh4 sparc64 x32] <!nojava>', 'docbook-xml', 'help2man', 'libavif-dev', 'libbrotli-dev', 'libgdk-pixbuf-2.0-dev', 'libgflags-dev', 'libgif-dev', 'libgmock-dev <!nocheck>', 'libgoogle-perftools-dev [amd64 arm64 armel armhf mips64el ppc64el riscv64 s390x loong64 powerpc ppc64 x32]', 'libgtest-dev <!nocheck>', 'libhwy-dev', 'libjpeg-dev', 'libjxl-testdata', 'liblcms-dev | liblcms2-dev', 'libopenexr-dev', 'libpng-dev', 'libwebp-dev', 'ninja-build', 'pkgconf']
Provides []
Builddate
Architecture amd64
Distro-Version trixie
Licenses []
Hash ea52c69c6032692b357574a3c149f78ad0d3da2939660eaa3371478b2b5c236e
#!/usr/bin/make -f

include /usr/share/dpkg/default.mk

GCC_13_ARCHS=hppa powerpc ppc64 riscv64 sparc64 s390x
ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),$(GCC_13_ARCHS)))
  export CC=gcc-13
  export CXX=g++-13
endif
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# keep same order as https://buildd.debian.org/status/package.php?p=google-perftools&suite=sid
# purposely remove i386 for Ubuntu compat
TCMALLOC_ARCHS=amd64 arm64 armel armhf mips64el ppc64el riscv64 s390x loong64 powerpc ppc64 x32
ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),$(TCMALLOC_ARCHS)))
  ENABLE_TCMALLOC=ON
else
  ENABLE_TCMALLOC=OFF
endif

# https://buildd.debian.org/status/package.php?p=openjdk-21
JAVA_ARCHS=amd64 arm64 armel armhf i386 mips64el ppc64el riscv64 s390x alpha ia64 m68k powerpc ppc64 sh4 sparc64 x32
ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),$(JAVA_ARCHS)))
  ENABLE_JNI=ON
else
  ENABLE_JNI=OFF
endif

# Override if profile states so:
ifneq (,$(filter nojava,$(DEB_BUILD_PROFILES)))
  ENABLE_JNI=OFF
endif

# Temp fix for 0.7.0-10.x i386/s390x build; see https://bugs.debian.org/1053641
DEB_CXXFLAGS_MAINT_APPEND += -fexcess-precision=fast

ifneq (,$(filter $(DEB_HOST_ARCH), arm64 armel armhf ppc64el))
  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728
  DEB_CXXFLAGS_MAINT_APPEND += -Wno-psabi
endif
export DEB_CXXFLAGS_MAINT_APPEND

ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
  ENABLE_OPENEXR=OFF
else
  ENABLE_OPENEXR=ON
endif

# Copy/paste from ci.sh `cmd_opt`:
DEB_CXXFLAGS_MAINT_APPEND += -DJXL_DEBUG_WARNING -DJXL_DEBUG_ON_ERROR

# deduce documentation option (build-indep target)
ifeq "" "$(filter %-doc,$(shell dh_listpackages))"
  ENABLE_DOXYGEN = OFF
else
  ENABLE_DOXYGEN = ON
endif

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
  BUILD_TESTING=ON
else
  BUILD_TESTING=OFF
endif

%:
	dh $@ --buildsystem=cmake+ninja

CMAKE_EXTRA_FLAGS += \
	-DBUILD_TESTING:BOOL=$(BUILD_TESTING) \
	-DCMAKE_BUILD_RPATH_USE_ORIGIN=OFF \
	-DJPEGXL_BUNDLE_SKCMS:BOOL=OFF \
	-DJPEGXL_ENABLE_BENCHMARK:BOOL=ON \
	-DJPEGXL_ENABLE_DEVTOOLS:BOOL=ON \
	-DJPEGXL_ENABLE_DOXYGEN:BOOL=$(ENABLE_DOXYGEN) \
	-DJPEGXL_ENABLE_EXAMPLES:BOOL=ON \
	-DJPEGXL_ENABLE_JNI:BOOL=$(ENABLE_JNI) \
	-DJPEGXL_ENABLE_OPENEXR:BOOL=$(ENABLE_OPENEXR) \
	-DJPEGXL_ENABLE_PLUGINS:BOOL=ON \
	-DJPEGXL_ENABLE_PLUGIN_GDKPIXBUF:BOOL=ON \
	-DJPEGXL_ENABLE_PLUGIN_GIMP210:BOOL=OFF \
	-DJPEGXL_ENABLE_PLUGIN_MIME:BOOL=OFF \
	-DJPEGXL_ENABLE_SJPEG:BOOL=OFF \
	-DJPEGXL_ENABLE_SKCMS:BOOL=OFF \
	-DJPEGXL_ENABLE_TCMALLOC:BOOL=$(ENABLE_TCMALLOC) \
	-DJPEGXL_FORCE_SYSTEM_BROTLI:BOOL=ON \
	-DJPEGXL_FORCE_SYSTEM_GTEST:BOOL=ON \
	-DJPEGXL_FORCE_SYSTEM_HWY:BOOL=ON \
	-DJPEGXL_FORCE_SYSTEM_LCMS2:BOOL=ON \
	-DJPEGXL_INSTALL_JARDIR:PATH=share/java \
	-DJPEGXL_INSTALL_JNIDIR:PATH=lib/$(DEB_HOST_MULTIARCH)/jni \
	-DJPEGXL_TEST_DATA_PATH:PATH=/usr/share/libjxl-testdata \

override_dh_auto_configure:
	dh_auto_configure -- $(CMAKE_EXTRA_FLAGS)

override_dh_auto_build-indep:
	dh_auto_build -- doc

override_dh_auto_install-indep:

override_dh_install-indep:
	dh_install -X.md5 -pjpeg-xl-doc obj-*/html usr/share/doc/jpeg-xl-doc

override_dh_auto_test-indep:

override_dh_installman-arch: tools_manpages devtools_manpages
	dh_installman

override_dh_clean-arch:
	dh_clean debian/*.1
	# by-product of `conformance_tooling_test`:
	dh_clean tools/conformance/__pycache__/lcms2.cpython-*.pyc

debian/control: debian/control.in
	sed -e "s/@GCC_13_ARCHS@/$(GCC_13_ARCHS)/g;s/@TCMALLOC_ARCHS@/$(TCMALLOC_ARCHS)/g;s/@JAVA_ARCHS@/$(JAVA_ARCHS)/g;" $< > $@

FILE=debian/libjxl-devtools.install
DEVTOOLS=`cat $(FILE) | sed  's@usr/bin@debian@' | sed 's/$$/.1/' | tr '\n' ' '`

VER_FULL = $(DEB_VERSION_UPSTREAM)

debian/%.1: debian/%.1.in
	LD_PRELOAD= LD_LIBRARY_PATH=./debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) help2man --no-discard-stderr --include=$< --output=$@ --help-option=--help --version-string=$(VER_FULL) --no-info ./debian/tmp/usr/bin/`basename $@ .1`

.PHONY: tools_manpages devtools_manpages get-orig-source

tools_manpages: debian/jxlinfo.1
	echo "all tools manpages generated"

devtools_manpages: debian/butteraugli_main.1 debian/decode_and_encode.1 debian/display_to_hlg.1 debian/djxl_fuzzer_corpus.1 debian/generate_lut_template.1 debian/jxl_from_tree.1 debian/pq_to_hlg.1 debian/render_hlg.1 debian/ssimulacra_main.1 debian/texture_to_cube.1 debian/tone_map.1 debian/xyb_range.1 debian/benchmark_xl.1 debian/ssimulacra2.1 debian/local_tone_map.1 debian/exr_to_pq.1 debian/icc_simplify.1
	echo $(DEVTOOLS)
	echo "all devtools manpages generated"

# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=902846
get-orig-source:
	uscan --download --force-download --rename