~ubuntu-branches/ubuntu/precise/mesa-lts-quantal/precise-updates

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Package Import Robot
  • Author(s): Maarten Lankhorst
  • Date: 2012-11-30 20:58:34 UTC
  • Revision ID: package-import@ubuntu.com-20121130205834-0vmupgz9h8w2jioa
Tags: 9.0-0ubuntu1~precise1
Rename package for the LTS point update, and add
replaces/breaks/provides

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
# debian/rules for the Debian mesa package
 
3
# Copyright © 2006 Thierry Reding <thierry@gilfi.de>
 
4
 
 
5
# Uncomment this to turn on verbose mode.
 
6
#export DH_VERBOSE=1
 
7
 
 
8
CFLAGS = -Wall -g
 
9
CXXFLAGS = -Wall -g
 
10
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
 
11
        CFLAGS += -O0
 
12
        CXXFLAGS += -O0
 
13
else
 
14
        CFLAGS += -O2
 
15
        CXXFLAGS += -O2
 
16
endif
 
17
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
 
18
        NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
 
19
        MAKEFLAGS += -j$(NUMJOBS)
 
20
endif
 
21
 
 
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)
 
31
else
 
32
        confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
 
33
endif
 
34
 
 
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
 
38
 
 
39
# build the following configurations by default
 
40
CONFIGS = dri
 
41
 
 
42
STAMP_DIR = debian/stamp
 
43
STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE)
 
44
BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS))
 
45
 
 
46
QUILT_STAMPFN = $(STAMP_DIR)/patch
 
47
include /usr/share/quilt/quilt.make
 
48
 
 
49
confflags-common = \
 
50
        CFLAGS="$(CFLAGS)" \
 
51
        CXXFLAGS="$(CXXFLAGS)"
 
52
 
 
53
DRI_DRIVERS =
 
54
GALLIUM_DRIVERS =
 
55
 
 
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=
 
61
        DRI_DRIVERS += swrast
 
62
else
 
63
        EGL_DISPLAYS = x11
 
64
 
 
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
 
68
#
 
69
# Although the KMS egl drivers will probably build on kfreebsd & hurd
 
70
# only linux actually has KMS drivers implemented at this point.
 
71
        EGL_DISPLAYS += drm
 
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
 
76
    endif
 
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
 
82
    else
 
83
        EXTRA_SED=-e"/radeonsi_dri.so/ s/^/\#/"
 
84
    endif
 
85
  endif
 
86
 
 
87
 
 
88
# Build the llvmpipe driver only on amd64, i386 and armhf until it's tested
 
89
# elsewhere
 
90
  ifeq (,$(filter $(DEB_HOST_ARCH_CPU), amd64 i386))
 
91
        DRI_DRIVERS += swrast
 
92
  else
 
93
        GALLIUM_DRIVERS += swrast
 
94
  endif
 
95
 
 
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
 
100
  endif
 
101
 
 
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
 
107
endif
 
108
 
 
109
confflags-dri = \
 
110
        --enable-dri \
 
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' \
 
114
        --disable-osmesa \
 
115
        --enable-glx-tls \
 
116
        --enable-shared-dricore \
 
117
        --enable-shared-glapi \
 
118
        --enable-texture-float \
 
119
        --enable-xa \
 
120
        $(confflags_DIRECT_RENDERING) \
 
121
        $(confflags_EGL) \
 
122
        $(confflags_GALLIUM) \
 
123
        $(confflags_GLES) \
 
124
        $(confflags_OPENVG) \
 
125
        $(confflags-common)
 
126
 
 
127
configure: $(QUILT_STAMPFN) configure.ac
 
128
        autoreconf -vfi
 
129
 
 
130
# list the configurations that will built
 
131
configs:
 
132
        @echo Building the following configurations: $(CONFIGS)
 
133
 
 
134
$(STAMP_DIR)/stamp:
 
135
        dh_testdir
 
136
        mkdir -p $(STAMP_DIR)
 
137
        >$@
 
138
 
 
139
$(QUILT_STAMPFN): $(STAMP_DIR)/stamp
 
140
 
 
141
build: build-stamp
 
142
 
 
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
 
148
 
 
149
        >$@
 
150
 
 
151
$(STAMP)-build-%: configure
 
152
        dh_testdir
 
153
 
 
154
        mkdir -p $(DEB_BUILD_DIR)/$*
 
155
        find $(CURDIR)/* -maxdepth 0 -not -path '$(DEB_BUILD_DIR)*' | \
 
156
                xargs cp -rlf -t $(DEB_BUILD_DIR)/$*
 
157
 
 
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)
 
164
 
 
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 ; \
 
168
 
 
169
        >$@
 
170
 
 
171
install: build
 
172
        # Add here commands to install the package into debian/tmp
 
173
        dh_testdir
 
174
        dh_testroot
 
175
        dh_prep
 
176
        dh_installdirs
 
177
        set -e; for config in $(filter-out dri, $(CONFIGS)); do \
 
178
                $(MAKE) -C $(DEB_BUILD_DIR)/$$config DESTDIR=$(CURDIR)/debian/tmp install; \
 
179
        done
 
180
        $(MAKE) -C $(DEB_BUILD_DIR)/dri DESTDIR=$(CURDIR)/debian/tmp/dri install
 
181
        for file in debian/*.in; \
 
182
        do \
 
183
                sed -e"s,\$${DEB_HOST_MULTIARCH},$(DEB_HOST_MULTIARCH),g" \
 
184
                    $(EXTRA_SED) \
 
185
                        $${file} > $${file%%.in}; \
 
186
        done
 
187
 
 
188
clean: unpatch
 
189
        dh_testdir
 
190
        rm -rf .pc
 
191
 
 
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
 
196
        rm -rf build
 
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
 
201
        rm -rf $(STAMP_DIR)
 
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
 
206
 
 
207
        # And for pkgstriptranslation's benefit…
 
208
        rm -f src/mesa/drivers/dri/common/xmlpool/xmlpool.pot
 
209
 
 
210
        dh_clean
 
211
 
 
212
# Build architecture-independent files here.
 
213
binary-indep: install
 
214
 
 
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))
 
220
 
 
221
# Build architecture-dependent files here.
 
222
binary-arch: install
 
223
        dh_testdir
 
224
        dh_testroot
 
225
        dh_installchangelogs -s
 
226
        dh_installchangelogs -pmesa-common-dev-lts-quantal
 
227
        dh_installdocs -s
 
228
        dh_installexamples -s
 
229
 
 
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
 
239
        # purge .la files
 
240
        find debian/tmp/ -name '*.la' -exec rm '{}' ';'
 
241
 
 
242
        dh_install -s --fail-missing
 
243
 
 
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
 
247
 
 
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
 
250
 
 
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
 
255
 
 
256
        dh_installman -s
 
257
        dh_lintian -s
 
258
        dh_link -s
 
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; \
 
264
        done
 
265
        set -e; for p in $(havedbgpkg); do \
 
266
                dh_strip -p$${p} --dbg-package=$${p}-dbg; \
 
267
        done
 
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))
 
271
        dh_compress -s
 
272
        dh_fixperms -s
 
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/\* \
 
281
                ; done
 
282
 
 
283
        dh_makeshlibs -s --remaining-packages -- -c4
 
284
else
 
285
        # Temporarily work around FTBFS on sparc, ignore new symbols:
 
286
        dh_makeshlibs -s -- -c1
 
287
endif
 
288
        dh_installdeb -s
 
289
        dh_shlibdeps -s -l/usr/lib/$(DEB_HOST_MULTIARCH)/mesa:\
 
290
/usr/lib/$(DEB_HOST_MULTIARCH)/mesa-egl
 
291
        dh_gencontrol -s
 
292
        dh_md5sums -s
 
293
        dh_builddeb -s -- -Zxz
 
294
 
 
295
binary: binary-indep binary-arch
 
296
.PHONY: configs build clean binary-indep binary-arch binary install
 
297
 
 
298
# For maintainer use only, generate a tarball:
 
299
gentarball: SOURCE=mesa
 
300
gentarball: UV=$(shell dpkg-parsechangelog|awk '/^Version:/ {print $$2}'|sed 's/-.*$$//')
 
301
gentarball:
 
302
        git archive --format=tar upstream-experimental --prefix=$(SOURCE)-$(UV)/ | gzip -9 > ../$(SOURCE)_$(UV).orig.tar.gz