#! /usr/bin/make -f include /usr/share/dpkg/architecture.mk export DEB_BUILD_MAINT_OPTIONS=hardening=+all export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed \ -L$(CURDIR)/x265-10bit \ -L$(CURDIR)/x265-12bit # see #789111 export DEB_LDFLAGS_MAINT_STRIP=-Wl,-Bsymbolic-functions # LFS support export DEB_CPPFLAGS_MAINT_APPEND=$(shell getconf LFS_CFLAGS) FLAGS = -DENABLE_PIC=ON # no shared libs are built if HDR10+ is enabled # FLAGS += -DENABLE_HDR10_PLUS=ON FLAGS_OTHERBIT = -DENABLE_CLI=OFF FLAGS_OTHERBIT += -DENABLE_SHARED=OFF FLAGS_OTHERBIT += -DEXPORT_C_API=OFF FLAGS_OTHERBIT += -DHIGH_BIT_DEPTH=ON # enable assembly builds on amd64 and arm64 ifneq (,$(filter $(DEB_HOST_ARCH),amd64 arm64)) FLAGS += -DENABLE_ASSEMBLY=ON else FLAGS += -DENABLE_ASSEMBLY=OFF endif # disable altivec on ppc64 (see #923650) ifneq (,$(filter $(DEB_HOST_ARCH),ppc64)) FLAGS += -DENABLE_ALTIVEC=OFF -DCPU_POWER8=OFF endif # disable altivec on ppc64el if building 10 bit and 12 bit versions # see https://bitbucket.org/multicoreware/x265/issues/320/fail-to-build-on-power8-le ifneq (,$(filter $(DEB_HOST_ARCH),ppc64el)) FLAGS_OTHERBIT += -DENABLE_ALTIVEC=OFF endif %: dh $@ --buildsystem=cmake+ninja \ --sourcedirectory=source \ --builddirectory=x265-8bit override_dh_auto_clean: dh_auto_clean --builddirectory=x265-10bit dh_auto_clean --builddirectory=x265-12bit dh_auto_clean rm -rf doc/reST/build # -arch bits override_dh_auto_configure-arch: dh_auto_configure --builddirectory=x265-10bit -- \ $(FLAGS) $(FLAGS_OTHERBIT) dh_auto_configure --builddirectory=x265-12bit -- \ $(FLAGS) $(FLAGS_OTHERBIT) \ -DMAIN12=ON dh_auto_configure -- \ $(FLAGS) $(FLAGS_8BIT) \ -DLIB_INSTALL_DIR=lib/$(DEB_HOST_MULTIARCH) \ -DEXTRA_LIB="x265_main10.a;x265_main12.a" \ -DLINKED_10BIT=ON \ -DLINKED_12BIT=ON execute_before_dh_auto_build-arch: dh_auto_build --builddirectory=x265-10bit dh_auto_build --builddirectory=x265-12bit mv x265-10bit/libx265.a x265-10bit/libx265_main10.a mv x265-12bit/libx265.a x265-12bit/libx265_main12.a override_dh_auto_test-arch: # no tests debian/arscript: sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/' debian/arscript.in > debian/arscript execute_after_dh_auto_install-arch: debian/arscript rm debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libx265.a ar -M