]> git.saurik.com Git - wxWidgets.git/blame_incremental - debian/rules
making Xcode builds work against against libtiff, copied over from a console build
[wxWidgets.git] / debian / rules
... / ...
CommitLineData
1#!/usr/bin/make -f
2# debian/rules file to build packages from wx CVS source
3#
4# Sculpted 13/2/2000 by Ron Lee <ron@debian.org> from new and
5# variously stolen code :-)
6# It makes copious use of the debhelper utilities written by
7# Joey Hess and others.
8#
9# Significantly hacked up in July 2007 by Robin Dunn
10#
11
12#export DH_VERBOSE=1
13export DH_OPTIONS
14
15ifdef CONCURRENCY_LEVEL
16 # A user who knows what they want, that's like gold...
17 # respect their precious opinion of how much blue smoke to use.
18 JOB_COUNT := $(CONCURRENCY_LEVEL)
19else ifdef DISTCC_HOSTS
20 # Otherwise, if they have a cluster, try to put it to good use.
21 JOB_COUNT := $(shell set $${DISTCC_HOSTS} > /dev/null 2>&1 ; echo $$\#)
22endif
23
24ifdef JOB_COUNT
25 FAST_MAKE = $(MAKE) -j $(JOB_COUNT)
26else
27 FAST_MAKE = $(MAKE)
28endif
29
30
31# Find the python version(s) to build for
32PYVERS := $(shell pyversions -vr || pyversions -vs)
33ifeq ($(strip $(PYVERS)),)
34 PYVERS := $(shell python -c 'import sys; print sys.version[:3]')
35 NO_PYCENTRAL = 1
36 PY_BUILD_DEPS = python$(PYVERS), python$(PYVERS)-dbg, python$(PYVERS)-dev
37else
38 DEB_PYTHON_SYSTEM=pycentral
39 PY_BUILD_DEPS = python-all, python-all-dbg, python-all-dev, python-central
40endif
41
42# If another source package is to supply the common binary packages
43# for a particular Debian release, then define this variable to indicate
44# the $(release) that is expected to provide it. Do not define it at
45# all if this is to be the default (or only) wx source package for the
46# target release.
47#
48#DEBIAN_WX_DEFAULT_VERSION = 2.8
49
50
51# This will extract a flavour out of the name of the source directory
52# and flavour the packages and binaries with it. 'Official' builds
53# should use a source dir of the form wxwidgets$RELEASE-$VERSION.
54# Flavoured builds may use wxwidgets$RELEASE-$FLAVOUR-$VERSION, where
55# any descriptive alphanumeric name will do for FLAVOUR. This will
56# allow a custom build to be installed alongside the mainline ones
57# without conflict. You will also need to make a corresponding
58# changelog entry for your flavour source package using:
59# wxwidget$RELEASE-$FLAVOUR ($VERSION) to satify dpkg-source and
60# to correctly set the release below.
61DEBIAN_WXFLAVOUR := $(shell pwd | sed -e 's@.*/wxwidgets[0-9.]\+-\?\(.*\)-[0-9.]\+-\?.*@\1@')
62
63
64wx_major_version_number := $(shell sed -n 's/^wx_major_version_number=//p' configure.in)
65wx_minor_version_number := $(shell sed -n 's/^wx_minor_version_number=//p' configure.in)
66wx_release_number := $(shell sed -n 's/^wx_release_number=//p' configure.in)
67wx_subrelease_number := $(shell sed -n 's/^wx_subrelease_number=//p' configure.in)
68
69##release := $(shell dpkg-parsechangelog | sed -n 's/^Source: wxwidgets//p' | sed 's/-ansi//')
70release := $(wx_major_version_number).$(wx_minor_version_number)
71
72# This is broken completely now by bakefiles changes. Until we add
73# some hocus pocus to the main tree, to export these values from it
74# again, we approximate its behaviour (fairly precisely fwiw) to
75# specify $soversion below. Re-automate if incompatible changes
76# result in it actually changing.
77#soversion := $(shell grep '^WX_CURRENT=' configure.in | sed 's/WX_CURRENT=\([0-9]\+\).*/\1/')
78soversion := 0
79sorelease := $(release:%-$(DEBIAN_WXFLAVOUR)=%)-$(soversion)$(addprefix -,$(DEBIAN_WXFLAVOUR))
80
81# In some places we use the full version number, including the micro version,
82# for the development releases (which can be incompatible for the same major
83# and minor version) but just the major.minor for the stable releases (which
84# are supposed to be compatible), this variable contains the appropriate value
85ifeq ($(shell echo `echo $(release) | sed 's/.\+\.\(.\+\)/\1/'`%2 | bc),1)
86 # development release
87 compatible_release := $(release).$(wx_release_number)
88else
89 compatible_release := $(release)
90endif
91
92# Base value for alternative priorities.
93alt_prio := $(subst .,,$(release))
94
95cross_host := i586-mingw32msvc
96cross_build := $(shell ./config.guess)
97
98config_cache = ../config_deb.cache
99config_cache_cross = ../config_deb_cross.cache
100
101
102# build options
103COMMON_CONFIGURE_OPTIONS = \
104 --prefix=/usr \
105 --cache-file=$(config_cache) \
106 --with-flavour=$(DEBIAN_WXFLAVOUR) \
107 --with-zlib=sys \
108 --disable-reserved_virtual \
109
110BASE_CONFIGURE_OPTIONS = $(COMMON_CONFIGURE_OPTIONS) \
111 --disable-gui \
112
113GTK_CONFIGURE_OPTIONS = $(COMMON_CONFIGURE_OPTIONS) \
114 --with-gtk \
115 --enable-mediactrl \
116 --enable-sound \
117 --with-sdl \
118 --enable-display \
119 --enable-geometry \
120 --enable-graphics_ctx \
121 --with-libjpeg=sys \
122 --with-libpng=sys \
123 --with-libtiff=sys \
124
125
126pytoolkit := gtk2
127PY_WX_CONFIG_OPTIONS = --version=$(release) --toolkit=$(pytoolkit) --static=no
128
129WX_UNICODE := 1
130WX_OPENGL := 1
131
132ifeq ($(WX_UNICODE),1)
133 COMMON_CONFIGURE_OPTIONS += --enable-unicode
134 PY_WX_CONFIG_OPTIONS += --unicode
135 PY_UNICODE = UNICODE=1
136 wxpydir := wx-$(compatible_release)-$(pytoolkit)-unicode
137
138 # for compatibility with the existing 2.6 packages, we don't use "u" in
139 # the Unicode (default) package names
140 unicode_suffix :=
141else
142 # but we do need to use something for non-Unicode packages to distinguish
143 # them
144 unicode_suffix := -ansi
145 PY_UNICODE = UNICODE=0
146 wxpydir := wx-$(compatible_release)-$(pytoolkit)
147endif
148
149ifeq ($(WX_OPENGL),1)
150 GTK_CONFIGURE_OPTIONS += --with-opengl
151else
152 GTK_CONFIGURE_OPTIONS += --without-opengl
153endif
154
155#---------------------------------------------------------------------------
156# Packages to build
157
158package_wxbase_lib := libwxbase$(sorelease)$(unicode_suffix)
159package_wxbase_dev := libwxbase$(release)$(unicode_suffix)-dev
160package_wxbase_dbg := libwxbase$(release)$(unicode_suffix)-dbg
161
162package_gtk_lib := libwxgtk$(sorelease)$(unicode_suffix)
163package_gtk_dev := libwxgtk$(release)$(unicode_suffix)-dev
164package_gtk_dbg := libwxgtk$(release)$(unicode_suffix)-dbg
165
166package_headers := wx$(release)-headers
167package_i18n := wx$(release)-i18n
168package_doc := wx$(release)-doc
169package_examples := wx$(release)-examples
170package_common = wx-common
171
172package_gtk_py_lib := python-wxgtk$(release)$(unicode_suffix)
173package_gtk_py_ver = python-wxversion
174package_gtk_py_tools = python-wxtools
175package_gtk_py_addons = python-wxaddons
176package_gtk_dbg_py := python-wxgtk$(release)$(unicode_suffix)-dbg
177
178
179# The packages listed here are common to all wx versions, and may be provided
180# by another source package if more than one is in the release simultaneously.
181common_packages := $(package_common) $(package_gtk_py_ver) $(package_gtk_py_tools) $(package_gtk_py_addons)
182
183
184package_msw_dev := libwxmsw$(release)$(unicode_suffix)-dev
185package_msw_dbg := libwxmsw$(release)$(unicode_suffix)-dbg
186package_headers_msw := wx$(release)-headers-msw
187
188# The packages listed here will not be built by default.
189extra_packages := $(package_msw_dev) $(package_msw_dbg) $(package_headers_msw)
190
191ifdef DEBIAN_WX_DEFAULT_VERSION
192 extra_packages += $(common_packages)
193endif
194
195
196#---------------------------------------------------------------------------
197# Build directories
198
199objdir_wxbase_shared = objs_wxbase_sh
200objdir_wxbase_debug = objs_wxbase_d
201objdir_gtk_shared = objs_gtk_sh
202objdir_gtk_debug = objs_gtk_d
203objdir_gtk_install = objs_gtk_install
204objdir_doc_cruft = objs_doc_con
205objdir_doc = docs/wx-manual.html
206objdir_examples = docs/examples
207objdir_i18n = locale
208
209objdir_msw_shared = objs_msw_sh
210objdir_msw_static = objs_msw_st
211objdir_msw_dbg = objs_msw_d
212objdir_msw_install = objs_msw_install
213
214objdirs := $(objdir_wxbase_shared) $(objdir_wxbase_debug) \
215 $(objdir_gtk_shared) $(objdir_gtk_debug) $(objdir_gtk_install) \
216 $(objdir_doc_cruft) $(objdir_doc) $(objdir_examples) \
217 $(objdir_msw_shared) $(objdir_msw_static) $(objdir_msw_dbg) \
218 $(objdir_msw_install)
219
220#---------------------------------------------------------------------------
221# Build stamps:
222
223# note that the i18n package is actually arch indep (once built)
224# but must be built (and installed) during the arch any phase as
225# it's pulled out of the wxGTK shared lib package.
226#
227# similarly some of the wxpython packages are arch indep too, but
228# all files for it are installed during the arch any phase.
229
230
231build_arch_stamps = build-wxbase-shared-stamp build-wxbase-debug-stamp \
232 build-gtk-shared-stamp build-gtk-shared-contrib-stamp \
233 build-gtk-debug-stamp build-gtk-debug-contrib-stamp \
234 build-i18n-stamp build-gtk-py-stamp build-gtk-dbg-py-stamp
235
236build_indep_stamps = build-examples-stamp build-doc-stamp
237
238build_cross_stamps = build-msw-shared-stamp build-msw-static-stamp build-msw-dbg-stamp
239
240build_stamps_native := $(build_arch_stamps) $(build_indep_stamps)
241
242build_stamps := $(build_stamps_native) $(build_cross_stamps)
243
244
245#---------------------------------------------------------------------------
246# Install targets:
247install_all_arch = install-wxbase-lib install-wxbase-dev install-wxbase-dbg \
248 install-gtk-lib install-gtk-dev install-gtk-dbg \
249 install-headers install-i18n install-gtk-py install-gtk-dbg-py
250
251ifndef DEBIAN_WX_DEFAULT_VERSION
252 install_all_arch += install-common
253endif
254
255install_all_indep = install-examples install-doc
256
257install_all_cross = install-msw-dev install-msw-dbg install-headers-msw
258
259install_all_native := $(install_all_arch) $(install_all_indep)
260
261install_all := $(install_all_native) $(install_all_cross)
262
263
264
265#---------------------------------------------------------------------------
266# Setup Rules:
267
268debian/control: debian/control.in debian/rules
269 sed -e 's/=V/$(release)/g; '\
270' s/=SOV/$(sorelease)/g; '\
271' s/=U/$(unicode_suffix)/g; '\
272' s/=PY_BUILD_DEPS/$(PY_BUILD_DEPS)/g '\
273 < debian/control.in > debian/control
274
275control-files-stamp: debian/control
276 dh_testdir
277 @for f in postinst prerm; do \
278 echo "generating control file $(package_wxbase_dev).$$f"; \
279 sed -e 's/=V/$(release)/g; '\
280' s/=PRIO/$(alt_prio)/g' \
281 < debian/libwxbase-dev.$$f \
282 > debian/$(package_wxbase_dev).$$f; \
283 done;
284 @for f in postinst prerm; do \
285 echo "generating control file $(package_wxbase_dbg).$$f"; \
286 sed -e 's/=V/$(release)/g; '\
287' s/=PRIO/$(alt_prio)/g' \
288 < debian/libwxbase-dbg.$$f \
289 > debian/$(package_wxbase_dbg).$$f; \
290 done;
291 @for f in postinst prerm; do \
292 echo "generating control file $(package_gtk_dev).$$f"; \
293 sed -e 's/=V/$(release)/g; '\
294' s/=PRIO/$(alt_prio)/g' \
295 < debian/libwxgtk-dev.$$f \
296 > debian/$(package_gtk_dev).$$f; \
297 done;
298 @for f in postinst prerm; do \
299 echo "generating control file $(package_gtk_dbg).$$f"; \
300 sed -e 's/=V/$(release)/g; '\
301' s/=PRIO/$(alt_prio)/g' \
302 < debian/libwxgtk-dbg.$$f \
303 > debian/$(package_gtk_dbg).$$f; \
304 done;
305 @for f in docs postinst prerm; do \
306 echo "generating control file $(package_gtk_py_lib).$$f"; \
307 sed -e 's/=PYVERS/$(PYVERS)/g; '\
308' s|=WXPYDIR|$(wxpydir)|g; '\
309' s/=V/$(release)/g; '\
310' s/=PRIO/$(alt_prio)/g' \
311 < debian/python-wxgtk.$$f \
312 > debian/$(package_gtk_py_lib).$$f; \
313 done;
314 @echo "generating control file $(package_gtk_dbg_py).docs";
315 @cp debian/python-wxgtk.docs debian/$(package_gtk_dbg_py).docs;
316 @for f in docs doc-base; do \
317 echo "generating control file $(package_doc).$$f"; \
318 sed -e 's/=V/$(release)/g' < debian/wx-doc.$$f \
319 > debian/$(package_doc).$$f; \
320 done;
321 @for f in examples; do \
322 echo "generating control file $(package_examples).$$f"; \
323 cp debian/wx-examples.$$f debian/$(package_examples).$$f; \
324 done;
325 @for f in postinst prerm; do \
326 echo "generating control file $(package_msw_dev).$$f"; \
327 sed -e 's/=V/$(release)/g; '\
328' s/=H/$(cross_host)/g; '\
329' s/=PRIO/$(alt_prio)/g' \
330 < debian/libwxmsw-dev.$$f \
331 > debian/$(package_msw_dev).$$f; \
332 done;
333 @for f in postinst prerm; do \
334 echo "generating control file $(package_msw_dbg).$$f"; \
335 sed -e 's/=V/$(release)/g; '\
336' s/=H/$(cross_host)/g; '\
337' s/=PRIO/$(alt_prio)/g' \
338 < debian/libwxmsw-dbg.$$f \
339 > debian/$(package_msw_dbg).$$f; \
340 done;
341# @echo "generating control file $(package_common).menu"; \
342# sed -e 's/=V/$(release)/g' < debian/wx-common.menu \
343# > debian/$(package_common).menu;
344 @echo "generating control file lintian-override"; \
345 sed -e 's/=V/$(release)/g; '\
346' s/=SOV/$(sorelease)/g' \
347 < debian/lintian-override.in \
348 > debian/lintian-override; \
349 touch $@
350
351#---------------------------------------------------------------------------
352# wx Build rules
353
354build_arch: control-files-stamp $(build_arch_stamps)
355build_all: control-files-stamp $(build_stamps_native)
356
357# Really we should probably do nothing here until we know which
358# binary target is being called, but alpha builds were exploding
359# (compiler segfaults) in random places when building under fakeroot
360# from the binary-arch target. Build all -arch files here then, and
361# let the -indep stuff fend for itself later.
362
363build: build_arch
364
365
366# The wx2.6 build system makes us run around in circles to get a separate
367# libwxbase. We need to configure it here in order to get the correct
368# config files to use it alone, but there is no point building it as the
369# wxgtk build is going to do that again anyway. We'll move the relevant
370# files out when that is done.
371#
372# TODO: Is this still necessary? Can we just take the wxbase files
373# from the wxgui build now without special treatment?
374
375configure-wxbase-shared-stamp:
376 dh_testdir
377 mkdir -p $(objdir_wxbase_shared)
378 cd $(objdir_wxbase_shared) \
379 && ../configure $(BASE_CONFIGURE_OPTIONS)
380 touch $@
381
382build-wxbase-shared-stamp: configure-wxbase-shared-stamp
383 dh_testdir
384 # Nothing to build here, move along...
385 #cd $(objdir_wxbase_shared) && $(FAST_MAKE)
386 touch $@
387
388configure-wxbase-debug-stamp:
389 dh_testdir
390 mkdir -p $(objdir_wxbase_debug)
391 cd $(objdir_wxbase_debug) \
392 && ../configure $(BASE_CONFIGURE_OPTIONS) --enable-debug
393 touch $@
394
395build-wxbase-debug-stamp: configure-wxbase-debug-stamp
396 dh_testdir
397 # Nothing to build here, move along...
398 #cd $(objdir_wxbase_debug) && $(FAST_MAKE)
399 touch $@
400
401configure-gtk-shared-stamp:
402 dh_testdir
403 mkdir -p $(objdir_gtk_shared)
404 cd $(objdir_gtk_shared) \
405 && ../configure $(GTK_CONFIGURE_OPTIONS)
406 touch $@
407
408build-gtk-shared-stamp: configure-gtk-shared-stamp
409 dh_testdir
410 cd $(objdir_gtk_shared) && $(FAST_MAKE)
411 touch $@
412
413
414configure-gtk-debug-stamp:
415 dh_testdir
416 mkdir -p $(objdir_gtk_debug)
417 cd $(objdir_gtk_debug) \
418 && ../configure $(GTK_CONFIGURE_OPTIONS) --enable-debug
419 touch $@
420
421build-gtk-debug-stamp: configure-gtk-debug-stamp
422 dh_testdir
423 cd $(objdir_gtk_debug) && $(FAST_MAKE)
424 touch $@
425
426
427build-gtk-shared-contrib-stamp: build-gtk-shared-stamp
428 dh_testdir
429 cd $(objdir_gtk_shared)/contrib/src && $(FAST_MAKE)
430 cd $(objdir_gtk_shared)/utils/wxrc && $(FAST_MAKE)
431 touch $@
432
433
434build-gtk-debug-contrib-stamp: build-gtk-debug-stamp
435 dh_testdir
436 cd $(objdir_gtk_debug)/contrib/src && $(FAST_MAKE)
437 touch $@
438
439
440purge-dbg-py:
441 @if [ ! -e build-gtk-py-stamp ]; then \
442 $(MAKE) -f debian/rules clean-py; \
443 fi
444 $(RM) build-gtk-dbg-py-stamp
445
446build-gtk-py-stamp: build-gtk-shared-stamp purge-dbg-py
447 dh_testdir
448 touch docs/lgpl.txt
449 cd wxPython \
450 && $(python_ver) ./setup.py build \
451 WX_CONFIG='$(wxconfig)' \
452 WXPORT=$(pytoolkit) \
453 $(PY_UNICODE) \
454 FLAVOUR=$(DEBIAN_WXFLAVOUR)
455 touch $@
456
457build-doc-stamp: build-gtk-shared-stamp
458 dh_testdir
459 # the tarball may already have the generated docs in it
460 if [ ! -e docs/html/wx/index.html ]; then \
461 cd $(objdir_gtk_shared)/utils/tex2rtf/src && $(FAST_MAKE); \
462 cd -; \
463 rm -rf $(objdir_doc); \
464 rm -rf $(objdir_doc_cruft); \
465 mkdir $(objdir_doc); \
466 mkdir $(objdir_doc_cruft); \
467 cd $(objdir_doc_cruft); \
468 LD_LIBRARY_PATH=../$(objdir_gtk_shared)/lib:$(LD_LIBRARY_PATH) \
469 ../$(objdir_gtk_shared)/utils/tex2rtf/src/tex2rtf \
470 ../docs/latex/wx/manual.tex \
471 ../$(objdir_doc)/wx$(release)-manual.html \
472 -twice -html; \
473 cd -; \
474 cp docs/latex/wx/*.gif $(objdir_doc); \
475 rm -rf $(objdir_doc_cruft); \
476 rm -f $(objdir_doc)/wx$(release)-manual.{con,hh*,htx,ref}; \
477 else \
478 echo Copying docs...; \
479 mkdir -p $(objdir_doc); \
480 cp docs/html/wx/* $(objdir_doc); \
481 mv $(objdir_doc)/index.html $(objdir_doc)/wx-$(release)-manual_contents.html; \
482 fi
483 touch $@
484
485build-examples-stamp: build-gtk-shared-stamp
486 dh_testdir
487 mkdir -p $(objdir_examples)
488
489 # copy all samples and the Makefile generated for libwxgtk.
490 cp -a samples $(objdir_examples)
491 rm -f $(objdir_examples)/samples/Makefile
492 cp -a $(objdir_gtk_shared)/samples/Makefile $(objdir_examples)/samples
493
494 cd $(objdir_examples)/samples \
495 && find -name 'Makefile.in' -exec rm -f '{}' ';' \
496 && for d in $$(find -type d); do \
497 if [ -f $$d/makefile.unx ]; then \
498 mv $$d/makefile.unx $$d/Makefile; \
499 fi; \
500 done \
501
502 cp -a wxPython/demo $(objdir_examples)/wxPython
503
504 echo "generating install_examples.sh script";
505 sed -e 's/=V/$(release)/g' < debian/unpack_examples.sh.in \
506 > debian/unpack_examples.sh
507 chmod 755 debian/unpack_examples.sh
508
509 touch $@
510
511build-i18n-stamp: build-gtk-shared-stamp
512 dh_testdir
513
514 # touch .po files first, since if they are not already up
515 # to date then _now_ is not the time to fix it.
516 # That should have been been done before cvs was tagged.
517 cd $(objdir_i18n) \
518 && touch *.po \
519 && $(MAKE) allmo
520 touch $@
521
522purge-release-py:
523 @if [ ! -e build-gtk-dbg-py-stamp ]; then \
524 $(MAKE) -f debian/rules clean-py; \
525 fi
526 $(RM) build-gtk-py-stamp
527
528build-gtk-dbg-py-stamp: build-gtk-debug-stamp purge-release-py
529 dh_testdir
530 touch docs/lgpl.txt
531 cd wxPython \
532 && $(python_ver) ./setup.py build \
533 WX_CONFIG='$(wxconfig-dbg)' \
534 WXPORT=$(pytoolkit) \
535 $(PY_UNICODE) \
536 FLAVOUR=$(addsuffix -,$(DEBIAN_WXFLAVOUR))dbg
537 touch $@
538
539
540configure-msw-shared-stamp:
541 dh_testdir
542 mkdir -p $(objdir_msw_shared)
543 cd $(objdir_msw_shared) \
544 && ../configure --prefix=/usr/$(cross_host) \
545 --cache-file=$(config_cache_cross) \
546 --host=$(cross_host) \
547 --build=$(cross_build) \
548 --with-flavour=$(DEBIAN_WXFLAVOUR)
549 touch $@
550
551build-msw-shared-stamp: configure-msw-shared-stamp
552 dh_testdir
553 cd $(objdir_msw_shared) && $(FAST_MAKE)
554 touch $@
555
556configure-msw-static-stamp:
557 dh_testdir
558 mkdir -p $(objdir_msw_static)
559 cd $(objdir_msw_static) \
560 && ../configure --prefix=/usr/$(cross_host) \
561 --cache-file=$(config_cache_cross) \
562 --host=$(cross_host) \
563 --build=$(cross_build) \
564 --with-flavour=$(DEBIAN_WXFLAVOUR) \
565 --disable-shared
566 touch $@
567
568build-msw-static-stamp: configure-msw-static-stamp
569 dh_testdir
570 cd $(objdir_msw_static) && $(FAST_MAKE)
571 touch $@
572
573configure-msw-dbg-stamp:
574 dh_testdir
575 mkdir -p $(objdir_msw_dbg)
576 cd $(objdir_msw_dbg) \
577 && ../configure --prefix=/usr/$(cross_host) \
578 --cache-file=$(config_cache_cross) \
579 --host=$(cross_host) \
580 --build=$(cross_build) \
581 --with-flavour=$(DEBIAN_WXFLAVOUR) \
582 --enable-debug
583 touch $@
584
585build-msw-dbg-stamp: configure-msw-dbg-stamp
586 dh_testdir
587 cd $(objdir_msw_dbg) && $(FAST_MAKE)
588 touch $@
589
590#---------------------------------------------------------------------------
591# Cleaning rules
592
593clean-py:
594 cd wxPython && rm -rf licence build* docs/xml-raw wx/*.py src/__version__.py
595
596
597clean: debian/control clean-py
598 dh_testdir
599 dh_testroot
600
601 rm -rf config_deb.cache config_deb_cross.cache *-stamp $(objdirs)
602 rm -f docs/lgpl.txt
603 rm -f $(objdir_i18n)/*.mo
604
605 dh_clean
606 rm -f debian/$(package_wxbase_lib).*
607 rm -f debian/$(package_wxbase_dev).*
608 rm -f debian/$(package_wxbase_dbg).*
609 rm -f debian/$(package_gtk_lib).*
610 rm -f debian/$(package_gtk_dev).*
611 rm -f debian/$(package_gtk_dbg).*
612 rm -f debian/$(package_gtk_py_lib).*
613 rm -f debian/$(package_headers).*
614 rm -f debian/$(package_i18n).*
615 rm -f debian/$(package_doc).*
616 rm -f debian/$(package_examples).*
617 rm -f debian/$(package_gtk_dbg_py).*
618 rm -f debian/$(package_msw_dev).*
619 rm -f debian/$(package_msw_dbg).*
620 rm -f debian/lintian-override
621 rm -f debian/unpack_examples.sh
622 find -name '*.py[co]' | xargs -r rm -f
623 rm -rf include/wx-$(release)
624
625
626#---------------------------------------------------------------------------
627# wx Install Rules
628
629install_arch: build_arch $(install_all_arch)
630
631install: build_all $(install_all_native)
632
633
634install-wxbase-lib: DH_OPTIONS=-p$(package_wxbase_lib)
635install-wxbase-lib: build-wxbase-shared-stamp install-gtk-shared-stamp
636 dh_testdir
637 dh_testroot
638 dh_clean -k
639 @# No, this is not a typo, we steal these libs from the gtk build.
640 dh_install $(objdir_gtk_install)/lib/libwx_base*.so.* usr/lib
641 dh_installdirs usr/share/lintian/overrides
642 cp debian/lintian-override debian/$(package_wxbase_lib)/usr/share/lintian/overrides/$(package_wxbase_lib)
643
644install-wxbase-dev: DH_OPTIONS=-p$(package_wxbase_dev)
645install-wxbase-dev: build-wxbase-shared-stamp install-gtk-shared-stamp
646 dh_testdir
647 dh_testroot
648 dh_clean -k
649 @# No, this is not a typo, we steal these libs from the gtk build.
650 dh_install $(objdir_gtk_install)/lib/libwx_base*.so usr/lib
651 dh_install $(objdir_wxbase_shared)/lib/wx/include usr/lib/wx
652 dh_install $(objdir_wxbase_shared)/lib/wx/config/base* usr/lib/wx/config
653
654install-wxbase-dbg: DH_OPTIONS=-p$(package_wxbase_dbg)
655install-wxbase-dbg: build-wxbase-debug-stamp
656 dh_testdir
657 dh_testroot
658 dh_clean -k
659 @# No, this is not a typo, we steal these libs from the gtk debug build.
660 dh_install $(objdir_gtk_debug)/lib/libwx_base* usr/lib
661 dh_install $(objdir_wxbase_debug)/lib/wx/include usr/lib/wx
662 dh_install $(objdir_wxbase_debug)/lib/wx/config/base* usr/lib/wx/config
663 dh_installdirs usr/share/lintian/overrides
664 cp debian/lintian-override debian/$(package_wxbase_dbg)/usr/share/lintian/overrides/$(package_wxbase_dbg)
665
666install-gtk-shared-stamp: build-gtk-shared-stamp build-gtk-shared-contrib-stamp
667 dh_testdir
668 mkdir -p $(objdir_gtk_install)
669 cd $(objdir_gtk_shared) \
670 && $(MAKE) install prefix=`pwd`/../$(objdir_gtk_install)
671 cd $(objdir_gtk_shared)/contrib/src \
672 && $(MAKE) install prefix=`pwd`/../../../$(objdir_gtk_install)
673 touch $@
674
675install-gtk-lib: DH_OPTIONS=-p$(package_gtk_lib)
676install-gtk-lib: install-gtk-shared-stamp
677 dh_testdir
678 dh_testroot
679 dh_clean -k
680 dh_install $(objdir_gtk_install)/lib/libwx_gtk*.so.* usr/lib
681 dh_installdirs usr/share/lintian/overrides
682 cp debian/lintian-override debian/$(package_gtk_lib)/usr/share/lintian/overrides/$(package_gtk_lib)
683
684install-gtk-dev: DH_OPTIONS=-p$(package_gtk_dev)
685install-gtk-dev: install-gtk-shared-stamp
686 dh_testdir
687 dh_testroot
688 dh_clean -k
689 dh_install $(objdir_gtk_install)/lib/libwx_gtk*.so usr/lib
690 dh_install $(objdir_gtk_install)/lib/wx/include usr/lib/wx
691 dh_install $(objdir_gtk_install)/lib/wx/config/gtk* usr/lib/wx/config
692
693install-gtk-dbg: DH_OPTIONS=-p$(package_gtk_dbg)
694install-gtk-dbg: build-gtk-debug-stamp build-gtk-debug-contrib-stamp
695 dh_testdir
696 dh_testroot
697 dh_clean -k
698 dh_install $(objdir_gtk_debug)/lib/libwx_gtk* usr/lib
699 dh_install $(objdir_gtk_debug)/lib/wx/include usr/lib/wx
700 dh_install $(objdir_gtk_debug)/lib/wx/config/gtk* usr/lib/wx/config
701 dh_installdirs usr/share/lintian/overrides
702 cp debian/lintian-override debian/$(package_gtk_dbg)/usr/share/lintian/overrides/$(package_gtk_dbg)
703
704
705install-gtk-py-lib: DH_OPTIONS=-p$(package_gtk_py_lib)
706install-gtk-py-lib: build-gtk-py-stamp
707 dh_testdir
708 dh_testroot
709 dh_clean -k
710 dh_installdirs usr/lib/wx/python
711 cd wxPython \
712 && $(python_ver) ./setup.py install \
713 --prefix=`pwd`/../debian/$(package_gtk_py_lib)/usr \
714 WX_CONFIG='$(wxconfig)' \
715 SYS_WX_CONFIG='$(py_wxconfig)' \
716 WXPORT=$(pytoolkit) \
717 $(PY_UNICODE) \
718 FLAVOUR=$(DEBIAN_WXFLAVOUR)
719
720 mv debian/$(package_gtk_py_lib)/$(pydir)/wx.pth \
721 debian/$(package_gtk_py_lib)/usr/lib/wx/python/wx$(release).pth
722
723 find debian/$(package_gtk_py_lib)/$(pydir) -name '*.py?' -exec rm '{}' ';'
724
725 # This is rather bogus, its included in the main copyright file now though.
726 rm -f debian/$(package_gtk_py_lib)/$(wxpydir)/wx/tools/XRCed/license.txt
727
728install-gtk-py-ver: DH_OPTIONS=-p$(package_gtk_py_ver)
729install-gtk-py-ver: install-gtk-py-lib
730 dh_testdir
731 dh_testroot
732 dh_clean -k
733
734ifndef DEBIAN_WX_DEFAULT_VERSION
735
736 dh_movefiles --sourcedir=debian/$(package_gtk_py_lib) $(pydir)/wxversion.py
737else
738 rm debian/$(package_gtk_py_lib)/$(pydir)/wxversion.py
739endif
740
741
742
743install-gtk-py-tools: DH_OPTIONS=-p$(package_gtk_py_tools)
744install-gtk-py-tools: install-gtk-py-ver
745 dh_testdir
746 dh_testroot
747 dh_clean -k
748
749ifndef DEBIAN_WX_DEFAULT_VERSION
750
751 dh_movefiles --sourcedir=debian/$(package_gtk_py_lib) usr/bin
752
753 dh_installman debian/wxPython-tools.1
754 dh_link usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/img2py.1 \
755 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/img2xpm.1 \
756 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/img2png.1 \
757 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pycrust.1 \
758 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pyshell.1 \
759 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/xrced.1 \
760 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/helpviewer.1 \
761 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pyalacarte.1 \
762 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pyalamode.1 \
763 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pywrap.1 \
764 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pywxrc.1
765
766 dh_installdirs usr/share/lintian/overrides
767 cp debian/lintian-override debian/$(package_gtk_py_tools)/usr/share/lintian/overrides/$(package_gtk_py_tools)
768endif
769 mkdir -p debian/$(package_gtk_py_tools)/usr/share/pixmaps
770 mkdir -p debian/$(package_gtk_py_tools)/usr/share/applications
771
772 cp wxPython/wx/py/PyCrust_32.png debian/$(package_gtk_py_tools)/usr/share/pixmaps/pycrust.png
773 cp wxPython/wx/py/PyCrust_32.png debian/$(package_gtk_py_tools)/usr/share/pixmaps/pyshell.png
774 cp wxPython/wx/tools/XRCed/XRCed_32.png debian/$(package_gtk_py_tools)/usr/share/pixmaps/xrced.png
775 cp debian/pycrust.desktop debian/$(package_gtk_py_tools)/usr/share/applications
776 cp debian/pyshell.desktop debian/$(package_gtk_py_tools)/usr/share/applications
777 cp debian/xrced.desktop debian/$(package_gtk_py_tools)/usr/share/applications
778
779 rm -r debian/$(package_gtk_py_lib)/usr/bin
780
781install-gtk-py-addons: DH_OPTIONS=-p$(package_gtk_py_addons)
782install-gtk-py-addons: install-gtk-py-tools
783 dh_testdir
784 dh_testroot
785 dh_clean -k
786ifndef DEBIAN_WX_DEFAULT_VERSION
787
788 dh_movefiles --sourcedir=debian/$(package_gtk_py_lib) $(pydir)/wxaddons
789else
790 rm -r debian/$(package_gtk_py_lib)/$(pydir)/wxaddons
791endif
792
793
794install-gtk-py: install-gtk-py-addons
795
796
797install-common: DH_OPTIONS=-p$(package_common)
798install-common: install-gtk-shared-stamp
799 dh_testdir
800 dh_testroot
801 dh_clean -k
802
803 dh_install $(objdir_gtk_install)/share/bakefile/presets usr/share/bakefile
804 dh_install $(objdir_gtk_install)/share/bakefile/presets/wx*.bkl usr/share/bakefile/presets
805
806 dh_install $(objdir_gtk_install)/share/aclocal usr/share
807 dh_installman debian/wx-config.1
808
809 dh_install $(objdir_gtk_shared)/utils/wxrc/wxrc usr/bin
810 dh_installman debian/wxrc-tools.1
811 dh_link usr/share/man/man1/wxrc-tools.1 usr/share/man/man1/wxrc.1
812
813
814install-headers: DH_OPTIONS=-p$(package_headers)
815install-headers: install-gtk-shared-stamp
816 dh_testdir
817 dh_testroot
818 dh_clean -k
819
820# The only way to be really sure we get the univ headers correct is to install
821# them. Do that in a scratch dirs, and move the gtk ones last, so at least
822# they win in the result of any uncaught conflict.
823
824# cd $(objdir_gtk_univ) \
825# && $(MAKE) install prefix=`pwd`/../$(objdir_univ_install)/usr
826
827# dh_movefiles --sourcedir=$(objdir_univ_install)
828 dh_install $(objdir_gtk_install)/include usr
829
830 # TODO: Should probably use setup.py's install of the wxPython headers...
831 mkdir -p debian/$(package_headers)/usr/include/wx-$(release)/wx/wxPython
832 mkdir -p debian/$(package_headers)/usr/include/wx-$(release)/wx/wxPython/i_files
833 cp -p wxPython/include/wx/wxPython/*.h \
834 debian/$(package_headers)/usr/include/wx-$(release)/wx/wxPython/
835 cp -p wxPython/include/wx/wxPython/src/*.i wxPython/include/wx/wxPython/src/_*.py \
836 wxPython/include/wx/wxPython/src/*.swg \
837 debian/$(package_headers)/usr/include/wx-$(release)/wx/wxPython/i_files
838
839install-i18n: DH_OPTIONS=-p$(package_i18n)
840install-i18n: build-i18n-stamp install-gtk-shared-stamp
841 dh_testdir
842 dh_testroot
843 dh_clean -k
844 dh_install $(objdir_gtk_install)/share/locale usr/share
845
846
847install-doc: DH_OPTIONS=-p$(package_doc)
848install-doc: build-doc-stamp
849 dh_testdir
850 dh_testroot
851 dh_clean -k
852 dh_install $(objdir_doc) usr/share/doc/$(package_doc)
853
854 @# Link this monstrosity with an overly obfuscated name
855 @# to something that both people and browsers can expect to find.
856 dh_link usr/share/doc/$(package_doc)/wx-manual.html/wx-$(release)-manual_contents.html \
857 usr/share/doc/$(package_doc)/wx-manual.html/index.html
858
859
860install-examples: DH_OPTIONS=-p$(package_examples)
861install-examples: build-examples-stamp
862 dh_testdir
863 dh_testroot
864 dh_clean -k
865
866install-gtk-dbg-py: DH_OPTIONS=-p$(package_gtk_dbg_py)
867install-gtk-dbg-py: build-gtk-dbg-py-stamp
868 dh_testdir
869 dh_testroot
870 dh_clean -k
871 dh_installdirs usr/lib/wx/python
872 cd wxPython \
873 && $(python_ver) ./setup.py install \
874 --prefix=`pwd`/../debian/$(package_gtk_dbg_py)/usr \
875 WX_CONFIG='$(wxconfig-dbg)' \
876 SYS_WX_CONFIG='$(pyd_wxconfig)' \
877 WXPORT=$(pytoolkit) \
878 $(PY_UNICODE) \
879 FLAVOUR=$(addsuffix -,$(DEBIAN_WXFLAVOUR))dbg
880
881 mv debian/$(package_gtk_py_lib)/$(pydir)/wx.pth \
882 debian/$(package_gtk_py_lib)/usr/lib/wx/python/wx$(release)-dbg.pth
883
884 find debian/$(package_gtk_dbg_py)/$(pydir) -name '*.py?' -exec rm '{}' ';'
885 rm -rf usr/bin $(pydir)/{wxversion.py,wx.pth}
886
887 # This is rather bogus, its included in the main copyright file now though.
888 rm -f debian/$(package_gtk_dbg_py)/$(wxpydir)/wx/tools/XRCed/license.txt
889
890
891install-msw-dev: DH_OPTIONS=-p$(package_msw_dev)
892install-msw-dev: build-msw-shared-stamp build-msw-static-stamp
893 dh_testdir
894 dh_testroot
895 dh_clean -k
896 dh_install $(objdir_msw_shared)/lib/*.dll* usr/$(cross_host)/lib
897 dh_install $(objdir_msw_shared)/lib/wx/include usr/$(cross_host)/lib/wx
898 dh_install $(objdir_msw_shared)/lib/wx/config/$(cross_host)* usr/$(cross_host)/lib/wx/config
899 dh_install $(objdir_msw_static)/lib/*.a usr/$(cross_host)/lib
900 dh_install $(objdir_msw_static)/lib/wx/include usr/$(cross_host)/lib/wx
901 dh_install $(objdir_msw_static)/lib/wx/config/$(cross_host)* usr/$(cross_host)/lib/wx/config
902 $(cross_host)-strip --strip-debug debian/$(package_msw_dev)/usr/$(cross_host)/lib/*.a
903
904 @# As a special case for the cross packages, we link their config
905 @# under /usr as well as under the normal cross prefix. This way
906 @# --prefix=/usr/$(cross_host) and --prefix=/usr --host=$(cross_host)
907 @# will have a congruent effect on wx-config.
908 @( for f in `ls -1 debian/$(package_msw_dev)/usr/$(cross_host)/lib/wx/config`; do \
909 all_cfg="$${all_cfg} usr/$(cross_host)/lib/wx/config/$$f usr/lib/wx/config/$$f"; \
910 echo "linking cross config /usr/$(cross_host)/lib/wx/config/$$f"; \
911 done; \
912 dh_link $${all_cfg}; \
913 )
914
915install-msw-dbg: DH_OPTIONS=-p$(package_msw_dbg)
916install-msw-dbg: build-msw-dbg-stamp
917 dh_testdir
918 dh_testroot
919 dh_clean -k
920 dh_install $(objdir_msw_dbg)/lib/*.dll* usr/$(cross_host)/lib
921 dh_install $(objdir_msw_dbg)/lib/wx/include usr/$(cross_host)/lib/wx
922 dh_install $(objdir_msw_dbg)/lib/wx/config/$(cross_host)* usr/$(cross_host)/lib/wx/config
923 # No static lib, they're freakin' huge!
924 #$(cross_host)-strip --strip-debug debian/$(package_msw_dbg)/usr/$(cross_host)/lib/*.a
925
926 @( for f in `ls -1 debian/$(package_msw_dbg)/usr/$(cross_host)/lib/wx/config`; do \
927 all_cfg="$${all_cfg} usr/$(cross_host)/lib/wx/config/$$f usr/lib/wx/config/$$f"; \
928 echo "linking cross config /usr/$(cross_host)/lib/wx/config/$$f"; \
929 done; \
930 dh_link $${all_cfg}; \
931 )
932
933install-headers-msw: DH_OPTIONS=-p$(package_headers_msw)
934install-headers-msw:
935 dh_testdir
936 dh_testroot
937 dh_clean -k
938
939 cd $(objdir_msw_shared) \
940 && $(MAKE) install prefix=`pwd`/../$(objdir_msw_install)
941
942# Symlink all the headers that will be installed by the main -headers
943# package to where the cross compiler will expect them.
944 @( for f in `ls -1 $(objdir_msw_install)/include/wx-$(release)/wx`; do \
945 all_h="$${all_h} usr/include/wx-$(release)/wx/$$f usr/$(cross_host)/include/wx-$(release)/wx/$$f"; \
946 echo "linking header /usr/include/wx-$(release)/wx/$$f"; \
947 done; \
948 dh_link $${all_h}; \
949 )
950
951# But install this lot for real.
952 rm -f debian/$(package_headers_msw)/usr/$(cross_host)/include/wx-$(release)/wx/msw
953 dh_install $(objdir_msw_install)/include/wx-$(release)/wx/msw usr/$(cross_host)/include/wx-$(release)/wx
954
955
956#---------------------------------------------------------------------------
957# Tying it all together
958
959
960binary-indep: build_all install
961 dh_testdir -i
962 dh_testroot -i
963 dh_installdocs -i
964 dh_installchangelogs -i
965 dh_installexamples -i
966 dh_installmenu -i
967ifdef NO_PYCENTRAL
968 dh_python -i
969else
970 dh_pycentral -i
971endif
972 dh_link -i
973 dh_compress -i
974 dh_fixperms -i
975 dh_installdeb -i
976 dh_gencontrol -i
977 dh_md5sums -i
978 dh_builddeb -i
979
980
981binary-arch: build_arch install_arch
982 dh_testdir -a
983 dh_testroot -a
984 dh_installdocs -a
985 dh_installchangelogs -a
986 dh_installexamples -a
987 dh_installmenu -a
988
989 rm -rf debian/$(package_gtk_dbg_py)/usr/share/doc/$(package_gtk_dbg_py)
990 ln -s $(package_gtk_py_lib) debian/$(package_gtk_dbg_py)/usr/share/doc/$(package_gtk_dbg_py)
991
992ifdef NO_PYCENTRAL
993 dh_python -a
994else
995 dh_pycentral -a
996endif
997
998# Don't strip debug libs at all, and strip cross libs elsewhere
999# with the cross host tools until dh_strip gets smarter.
1000 dh_strip -p$(package_gtk_py_lib) --dbg-package=$(package_gtk_dbg_py)
1001 dh_strip -N$(package_gtk_dbg) -N$(package_wxbase_dbg) \
1002 -N$(package_msw_dev) -N$(package_msw_dbg) \
1003 -N$(package_gtk_py_lib) -N$(package_gtk_dbg_py)
1004
1005 dh_link -a
1006 dh_compress -a
1007 dh_fixperms -a
1008 dh_makeshlibs -N$(package_gtk_py_lib) -N$(package_gtk_dbg_py) -V
1009 dh_installdeb -a
1010 dh_shlibdeps -ldebian/$(package_wxbase_lib)/usr/lib:debian/$(package_wxbase_dbg)/usr/lib:debian/$(package_gtk_lib)/usr/lib:debian/$(package_gtk_dbg)/usr/lib
1011 dh_gencontrol -a
1012 dh_md5sums -a
1013 dh_builddeb -a
1014
1015
1016# Build all packages target.
1017binary: binary-indep binary-arch
1018
1019
1020
1021# This is a special target for building the wxMSW-cross packages.
1022# It's not currently called during the official package build run
1023# but may be run separately to build the extra packages.
1024# There is an implied build dep on the mingw32 cross compiler
1025# that is not in the control file.
1026binary-cross: control-files-stamp $(install_all_cross)
1027 $(MAKE) -f debian/rules \
1028 DH_OPTIONS="-p$(package_msw_dev) -p$(package_msw_dbg) -p$(package_headers_msw)" \
1029 binary-common
1030
1031
1032############################################################################
1033#
1034# Some rules to build a subset of the complete list of packages that can be
1035# built from CVS. Beware that packages produced with these rules may *NOT*
1036# be compatible with packages built using the 'binary' target or even with
1037# Debian policy. Do not distribute packages built with these rules, they
1038# are currently useful for rapid in-house testing by developers only.
1039
1040DH_OPTIONS_GTK := -p$(package_wxbase_lib) -p$(package_gtk_lib) -p$(package_headers)
1041
1042# libwxgtk shared lib package
1043binary-gtk: control-files-stamp install-gtk-lib install-wxbase-lib install-headers
1044 $(MAKE) -f debian/rules DH_OPTIONS="$(DH_OPTIONS_GTK)" binary-common
1045
1046binary-gtk-dev: control-files-stamp install-gtk-dev install-wxbase-dev install-headers
1047 $(MAKE) -f debian/rules \
1048 DH_OPTIONS="-p$(package_wxbase_dev) -p$(package_gtk_dev) $(DH_OPTIONS_GTK)" \
1049 binary-common
1050
1051binary-gtk-dbg: control-files-stamp install-gtk-dbg install-wxbase-dbg install-headers
1052 $(MAKE) -f debian/rules \
1053 DH_OPTIONS="-p$(package_wxbase_dbg) -p$(package_gtk_dbg) -p$(package_headers)" \
1054 binary-common
1055
1056
1057# docs package
1058binary-doc: control-files-stamp install-doc
1059 $(MAKE) -f debian/rules DH_OPTIONS=-p$(package_doc) binary-common
1060
1061binary-fast:control-files-stamp install-gtk-dbg install-msw-dev install-headers install-headers-msw
1062 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_gtk_dbg) -p$(package_msw_dev) -p$(package_headers) -p$(package_headers_msw)" binary-common
1063
1064
1065.PHONY: build build_all build_arch \
1066 clean clean-py purge-release-py purge-dbg-py \
1067 binary-indep binary-arch binary binary-common \
1068 binary-gtk binary-gtk-dev binary-gtk-dbg \
1069 binary-wxbase binary-wxbase-dev binary-wxbase-dbg \
1070 binary-doc binary-cross binary-dbg-py \
1071 install install_arch install-gtk-lib install-gtk-dev \
1072 install-gtk-dbg \
1073 install-gtk-py install-gtk-py-tools install-gtk-py-ver \
1074 install-gtk-py-lib install-gtk-dbg-py \
1075 install-common install-headers install-i18n install-doc \
1076 install-examples install-msw-dev install-msw-dbg install-headers-msw
1077