File: rules

package info (click to toggle)
x265 3.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 13,388 kB
  • sloc: asm: 176,148; cpp: 95,292; ansic: 741; makefile: 150; sh: 91; python: 11
file content (94 lines) | stat: -rwxr-xr-x 2,644 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#! /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
# currently fails to build
# FLAGS += -DENABLE_DYNAMIC_HDR10=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, kfreebsd-amd64
ifneq (,$(filter $(DEB_HOST_ARCH),amd64 kfreebsd-amd64))
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 \
		--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

override_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
	dh_auto_build

debian/arscript:
	sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/' debian/arscript.in > debian/arscript

override_dh_auto_install-arch: debian/arscript
	dh_auto_install
	rm debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libx265.a
	ar -M <debian/arscript

# -indep bits

# no configure, test and install for indep
override_dh_auto_configure-indep override_dh_auto_test-indep override_dh_auto_install-indep:

override_dh_auto_build-indep:
	$(MAKE) -C doc/reST html

override_dh_installdocs-indep:
	dh_installdocs
	dh_sphinxdoc

override_dh_installchangelogs:
	dh_installchangelogs doc/reST/releasenotes.rst