aboutsummaryrefslogtreecommitdiffstats
blob: a278104a7fc93a02bc4f37fe9b0c35a7fe97ff3e (plain) (blame)
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/usr/bin/make -f

###
### Configuration, decide what to build
###

# Some variables:
DEB_HOST_ARCH_OS  ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)

# Linux vs. the rest:
ifeq (linux, $(DEB_HOST_ARCH_OS))
	confflags += --enable-udev
	confflags += --enable-libkms
	LIBKMS = yes
	confflags += --enable-vmwgfx-experimental-api
	confflags += --enable-nouveau
	NOUVEAU = yes
	confflags += --enable-radeon
	RADEON = yes
else
	confflags += --disable-udev
	confflags += --disable-libkms
	LIBKMS = no
	confflags += --disable-vmwgfx-experimental-api
	confflags += --disable-nouveau
	NOUVEAU = no
	confflags += --disable-radeon
	RADEON = no
	confflags += --disable-omap-experimental-api
	OMAP = no
endif

# Intel is only on x86:
ifneq (,$(filter amd64 i386,$(DEB_HOST_ARCH_CPU)))
ifneq (,$(filter linux kfreebsd,$(DEB_HOST_ARCH_OS)))
	INTEL = yes
endif
endif
ifeq ($(INTEL), yes)
	confflags += --enable-intel
else
	confflags += --disable-intel
endif

# Omap is only on arm
ifneq (,$(filter arm,$(DEB_HOST_ARCH_CPU)))
	OMAP = yes
endif
ifeq ($(OMAP), yes)
	confflags += --enable-omap-experimental-api
else
	confflags += --disable-omap-experimental-api
endif

###
### Actual build
###

override_dh_auto_configure:
	dh_auto_configure -- --enable-static=yes $(confflags)

override_dh_auto_test:
	dh_auto_test || echo "Test suite failure, but keeping on anyway"

override_dh_auto_install:
	dh_auto_install --destdir=debian/tmp

override_dh_install:
	find debian/tmp -name '*.la' -delete
	# Temporary rules for libdrm_nouveau1a
	rm debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libdrm_nouveau.a
	ln -s libdrm_nouveau.so.1 \
		debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libdrm_nouveau1.so
	ln -sf libdrm_nouveau.so.2 \
		debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libdrm_nouveau.so
	dh_install --fail-missing

override_dh_strip:
	dh_strip -plibdrm2 --dbg-package=libdrm2-dbg
ifeq ($(INTEL), yes)
	dh_strip -plibdrm-intel1 --dbg-package=libdrm-intel1-dbg
endif
ifeq ($(NOUVEAU), yes)
	dh_strip -plibdrm-nouveau1a --dbg-package=libdrm-nouveau1a-dbg
	dh_strip -plibdrm-nouveau2 --dbg-package=libdrm-nouveau2-dbg
endif
ifeq ($(RADEON), yes)
	dh_strip -plibdrm-radeon1 --dbg-package=libdrm-radeon1-dbg
endif
ifeq ($(OMAP), yes)
	dh_strip -plibdrm-omap1 --dbg-package=libdrm-omap1-dbg
endif
ifeq ($(LIBKMS), yes)
	dh_strip -p libkms1 --dbg-package=libkms1-dbg
endif
	dh_strip -s --remaining-packages

override_dh_makeshlibs:
	dh_makeshlibs -plibdrm2 -V'libdrm2 (>= 2.4.31)' --add-udeb=libdrm2-udeb -- -c4
ifeq ($(INTEL), yes)
	dh_makeshlibs -plibdrm-intel1 -V'libdrm-intel1 (>= 2.4.38)' -- -c4
endif
ifeq ($(NOUVEAU), yes)
	dh_makeshlibs -plibdrm-nouveau1a -V'libdrm-nouveau1a (>= 2.4.23)' -- -c4
	dh_makeshlibs -plibdrm-nouveau2 -V'libdrm-nouveau2 (>= 2.4.38)' -- -c4
endif
ifeq ($(RADEON), yes)
	dh_makeshlibs -plibdrm-radeon1 -V'libdrm-radeon1 (>= 2.4.39)' -- -c4
endif
ifeq ($(OMAP), yes)
	dh_makeshlibs -plibdrm-omap1 -V'libdrm-omap1 (>= 2.4.38)' -- -c4
endif
ifeq ($(LIBKMS), yes)
	dh_makeshlibs -plibkms1 -V'libkms1' -- -c4
endif

%:
	dh $@ --with quilt,autoreconf --builddirectory=build/