2
# debian/rules for the Debian mesa package
3
# Copyright © 2006 Thierry Reding <thierry@gilfi.de>
5
# Uncomment this to turn on verbose mode.
10
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
17
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
18
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
19
MAKEFLAGS += -j$(NUMJOBS)
22
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
23
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
24
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
25
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
26
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
27
DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
28
DEB_BUILD_DIR ?= $(CURDIR)/build
29
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
30
confflags += --build=$(DEB_HOST_GNU_TYPE)
32
confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
35
# keep a list of files we don't install (yet), but since it's a bit
36
# large, use an external file:
37
include debian/not-installed
39
# build the following configurations by default
42
STAMP_DIR = debian/stamp
43
STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE)
44
BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS))
46
QUILT_STAMPFN = $(STAMP_DIR)/patch
47
include /usr/share/quilt/quilt.make
51
CXXFLAGS="$(CXXFLAGS)"
56
# hurd doesn't do direct rendering
57
ifeq ($(DEB_HOST_ARCH_OS), hurd)
58
confflags_DIRECT_RENDERING = --disable-driglx-direct
59
confflags_EGL = --disable-egl
60
confflags_GALLIUM = --with-gallium-drivers=
65
ifeq ($(DEB_HOST_ARCH_OS), linux)
66
# Gallium drivers require libdrm-{nouveau,radeon}, only available on Linux
67
GALLIUM_DRIVERS += nouveau r600 r300 svga
69
# Although the KMS egl drivers will probably build on kfreebsd & hurd
70
# only linux actually has KMS drivers implemented at this point.
72
# Non-Linux ports also lack *_CLOEXEC and epoll, so wayland isn't ready yet:
73
EGL_DISPLAYS += wayland
74
ifeq (,$(filter $(DEB_HOST_ARCH), s390 s390x))
75
DRI_DRIVERS += r200 radeon nouveau
77
ifneq (,$(filter $(DEB_HOST_ARCH_CPU), amd64 i386))
78
DRI_DRIVERS += i915 i965
79
# Radeonsi needs LLVM, so only build it on the subset of archs
80
# where we have LLVM enabled.
81
GALLIUM_DRIVERS += radeonsi
83
EXTRA_SED=-e"/radeonsi_dri.so/ s/^/\#/"
88
# Build the llvmpipe driver only on amd64, i386 and armhf until it's tested
90
ifeq (,$(filter $(DEB_HOST_ARCH_CPU), amd64 i386))
93
GALLIUM_DRIVERS += swrast
96
# LLVM is required for r300g and recommended for swrastg on x86:
97
ifneq (,$(filter $(DEB_HOST_ARCH),amd64 i386 kfreebsd-amd64 kfreebsd-i386))
98
confflags_GALLIUM += --enable-gallium-llvm
99
confflags_GALLIUM += --with-llvm-shared-libs
102
confflags_DIRECT_RENDERING = --enable-driglx-direct
103
confflags_EGL = --with-egl-platforms="$(EGL_DISPLAYS)"
104
confflags_GALLIUM += --with-gallium-drivers="$(GALLIUM_DRIVERS)"
105
confflags_GLES = --enable-gles1 --enable-gles2
106
confflags_OPENVG = --enable-openvg --enable-gallium-egl
111
--with-dri-drivers="$(DRI_DRIVERS)" \
112
--with-dri-driverdir=/usr/lib/$(DEB_HOST_MULTIARCH)/dri \
113
--with-dri-searchpath='/usr/lib/$(DEB_HOST_MULTIARCH)/dri:\$$$${ORIGIN}/dri:/usr/lib/dri' \
116
--enable-shared-dricore \
117
--enable-shared-glapi \
118
--enable-texture-float \
120
$(confflags_DIRECT_RENDERING) \
122
$(confflags_GALLIUM) \
124
$(confflags_OPENVG) \
127
configure: $(QUILT_STAMPFN) configure.ac
130
# list the configurations that will built
132
@echo Building the following configurations: $(CONFIGS)
136
mkdir -p $(STAMP_DIR)
139
$(QUILT_STAMPFN): $(STAMP_DIR)/stamp
143
build-stamp: $(BUILD_STAMPS)
144
# Build pot file for pkgstriptranslations
145
# We do this only once, and outside the build trees, so that
146
# pkgstriptranslations doesn't get confused.
147
$(MAKE) -C src/mesa/drivers/dri/common/xmlpool pot
151
$(STAMP)-build-%: configure
154
mkdir -p $(DEB_BUILD_DIR)/$*
155
find $(CURDIR)/* -maxdepth 0 -not -path '$(DEB_BUILD_DIR)*' | \
156
xargs cp -rlf -t $(DEB_BUILD_DIR)/$*
158
cd $(DEB_BUILD_DIR)/$* && \
159
../../configure --prefix=/usr --mandir=\$${prefix}/share/man \
160
--infodir=\$${prefix}/share/info --sysconfdir=/etc \
161
--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
162
--localstatedir=/var $(confflags) $(confflags-$*)
163
cd $(DEB_BUILD_DIR)/$* && $(MAKE)
165
# Remove extra po files. These confuse pkgstriptranslations
166
# and aren't shipped anyway.
167
rm $(DEB_BUILD_DIR)/$*/src/mesa/drivers/dri/common/xmlpool/*.po ; \
172
# Add here commands to install the package into debian/tmp
177
set -e; for config in $(filter-out dri, $(CONFIGS)); do \
178
$(MAKE) -C $(DEB_BUILD_DIR)/$$config DESTDIR=$(CURDIR)/debian/tmp install; \
180
$(MAKE) -C $(DEB_BUILD_DIR)/dri DESTDIR=$(CURDIR)/debian/tmp/dri install
181
for file in debian/*.in; \
183
sed -e"s,\$${DEB_HOST_MULTIARCH},$(DEB_HOST_MULTIARCH),g" \
185
$${file} > $${file%%.in}; \
192
rm -f config.cache config.log config.status
193
rm -f */config.cache */config.log */config.status
194
rm -f conftest* */conftest*
195
rm -rf autom4te.cache */autom4te.cache
197
rm -rf configure bin/config.guess bin/config.sub config.h.in
198
rm -rf $$(find -name Makefile.in)
199
rm -rf aclocal.m4 bin/missing bin/depcomp install-sh bin/ltmain.sh
200
rm -f bin/ar-lib bin/compile bin/ylwrap bin/install-sh
202
for file in debian/*.in; do rm -f $${file%%.in}; done
203
rm -f src/glsl/builtins/tools/texture_builtins.pyc
204
rm -f src/mapi/glapi/gen/*.pyc
205
rm -f src/mesa/main/*.pyc
207
# And for pkgstriptranslation's benefit…
208
rm -f src/mesa/drivers/dri/common/xmlpool/xmlpool.pot
212
# Build architecture-independent files here.
213
binary-indep: install
215
allpkg = $(shell dh_listpackages -s)
216
dbgpkg = $(filter %-dbg, $(allpkg))
217
otherpkg = $(filter-out %-dbg, $(allpkg))
218
havedbgpkg = $(patsubst %-dbg,%,$(dbgpkg))
219
nodbgpkg = $(filter-out $(havedbgpkg),$(otherpkg))
221
# Build architecture-dependent files here.
225
dh_installchangelogs -s
226
dh_installchangelogs -pmesa-common-dev-lts-quantal
228
dh_installexamples -s
230
# Also get rid of other files which aren't installed. Do not
231
# use -f to ensure we notice disappearing files:
232
set -e; for file in $(NOT_INSTALLED); do rm debian/tmp/$$file; done
233
# Files only in git, not in tarballs, OK to use rm -f here:
234
set -e; for file in $(NOT_INSTALLED_EITHER); do rm -f debian/tmp/$$file; done
235
# No need for these .so, they're just convenience libraries:
236
rm debian/tmp/dri/usr/lib/${DEB_HOST_MULTIARCH}/libglapi.so
237
rm debian/tmp/dri/usr/lib/${DEB_HOST_MULTIARCH}/libdricore*.so
238
# rm debian/tmp/dri/usr/lib/${DEB_HOST_MULTIARCH}/libgallium*.so
240
find debian/tmp/ -name '*.la' -exec rm '{}' ';'
242
dh_install -s --fail-missing
244
# Create an ld.so.conf which says where to find libGL from Mesa
245
echo "/usr/lib/$(DEB_HOST_MULTIARCH)/mesa" \
246
> $(CURDIR)/debian/libgl1-mesa-glx-lts-quantal/usr/lib/$(DEB_HOST_MULTIARCH)/mesa/ld.so.conf
248
# Empty directory for the alternative
249
mkdir -p $(CURDIR)/debian/libgl1-mesa-glx-lts-quantal/usr/lib/$(DEB_HOST_MULTIARCH)/xorg/x11-extra-modules
251
# Create an ld.so.conf which says where to find libEGL, libGLES{1,2}
252
# and libOpenVG from Mesa.
253
echo "/usr/lib/$(DEB_HOST_MULTIARCH)/mesa-egl" \
254
> $(CURDIR)/debian/libegl1-mesa-lts-quantal/usr/lib/$(DEB_HOST_MULTIARCH)/mesa-egl/ld.so.conf
259
# Install bug control and script:
260
set -e; for p in $(allpkg); do \
261
install -d debian/$$p/usr/share/bug/$$p && \
262
install -m 644 debian/local/control debian/$$p/usr/share/bug/$$p && \
263
install -m 755 debian/local/script debian/$$p/usr/share/bug/$$p; \
265
set -e; for p in $(havedbgpkg); do \
266
dh_strip -p$${p} --dbg-package=$${p}-dbg; \
268
# dh_strip -s --remaining-packages doesn't work with resumed
269
# builds (see changelog for mesa 7.10-1):
270
dh_strip $(foreach p,$(nodbgpkg),-p$(p))
273
ifeq (,$(filter sparc sparc64,$(DEB_HOST_ARCH)))
274
# Resolve EGL/GLES/OpenVG symbols in the private library path.
275
# Because there's no packaging problem so onerous that accomodating
276
# proprietary alternatives can't make more difficult…
277
set -e ; for PACKAGE in \
278
libegl1-mesa libgles1-mesa libgles2-mesa libopenvg1-mesa ; do \
279
dh_makeshlibs -p$$PACKAGE-lts-quantal -- -c4 \
280
-edebian/$$PACKAGE-lts-quantal/usr/lib/$(DEB_HOST_MULTIARCH)/mesa-egl/\* \
283
dh_makeshlibs -s --remaining-packages -- -c4
285
# Temporarily work around FTBFS on sparc, ignore new symbols:
286
dh_makeshlibs -s -- -c1
289
dh_shlibdeps -s -l/usr/lib/$(DEB_HOST_MULTIARCH)/mesa:\
290
/usr/lib/$(DEB_HOST_MULTIARCH)/mesa-egl
293
dh_builddeb -s -- -Zxz
295
binary: binary-indep binary-arch
296
.PHONY: configs build clean binary-indep binary-arch binary install
298
# For maintainer use only, generate a tarball:
299
gentarball: SOURCE=mesa
300
gentarball: UV=$(shell dpkg-parsechangelog|awk '/^Version:/ {print $$2}'|sed 's/-.*$$//')
302
git archive --format=tar upstream-experimental --prefix=$(SOURCE)-$(UV)/ | gzip -9 > ../$(SOURCE)_$(UV).orig.tar.gz