File: rules

package info (click to toggle)
qscintilla2 2.10.4+dfsg-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 19,328 kB
  • sloc: cpp: 91,848; ansic: 2,990; python: 1,359; makefile: 213; sh: 5
file content (255 lines) | stat: -rwxr-xr-x 9,636 bytes parent folder | download
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
#export DPKG_GENSYMBOLS_CHECK_LEVEL=0

CFLAGS = -Wall -g
CPPFLAGS=
CXXFLAGS=
LDFLAGS=
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0 -g
	CXXFLAGS += -O0
else
	CFLAGS += $(shell dpkg-buildflags --get CFLAGS)
	CPPFLAGS += $(shell dpkg-buildflags --get CPPFLAGS)
	CXXFLAGS += $(shell dpkg-buildflags --get CXXFLAGS)
	LDFLAGS += $(shell dpkg-buildflags --get LDFLAGS)
endif

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_HOST_ARCH_BITS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)

PYTHON3S := $(shell py3versions -vr debian/control)
PYTHONS := $(shell pyversions -vr debian/control) $(PYTHON3S)
ifneq (/usr/share/pkg-kde-tools/bin,$(filter /usr/share/pkg-kde-tools/bin,$(subst :, ,$(PATH))))
    export PATH := /usr/share/pkg-kde-tools/bin:$(PATH)
endif

# Update this on SO name bumps so files get shoved around correctly
SONAME=13

# Not all archs have Qt5 yet.  This test means python3-pyqt5 is installed
qt5 := "no"
ifeq ($(shell dpkg-query -s python3-pyqt5 |grep -o Package), Package)
	qt5 := "yes"
endif

configure-stamp:
	dh_testdir
	mkdir QSciQt4
	cp -r Qt4Qt5/* QSciQt4
	mkdir designer-Qt4
	cd QSciQt4 && qmake-qt4 QMAKE_STRIP="" DESTDIR=../QSciQt4
	cd designer-Qt4Qt5 && qmake-qt4 INCLUDEPATH+=../Qt4Qt5 QMAKE_LIBDIR+=../QSciQt4 QMAKE_STRIP="" DESTDIR=../designer-Qt4
ifeq ($(qt5), "yes")
	# Configuring for Qt5 support
	mkdir QSciQt5
	cp -r Qt4Qt5/* QSciQt5
	cd QSciQt5  && qmake -qt=qt5-$(DEB_HOST_MULTIARCH) QMAKE_STRIP="" DESTDIR=../QSciQt5
	cp -r designer-Qt4Qt5 designer-Qt5
	cd designer-Qt5 && qmake -qt=qt5-$(DEB_HOST_MULTIARCH) INCLUDEPATH+=../Qt4Qt5 QMAKE_LIBDIR+=../QSciQt5 QMAKE_STRIP="" DESTDIR=../designer-Qt5
endif
	touch $@

configure: configure-stamp $(PYTHONS:%=Python/build-%/configure-stamp) $(PYTHONS:%=Python/dbg-build-%/configure-stamp)

Python/build-%/configure-stamp:
	dh_testdir
	mkdir -p Python/build-$*
	cd Python/build-$* \
	  && QT_SELECT=qt4-$(DEB_HOST_MULTIARCH) python$* ../configure.py -n ../../QSciQt4/ -o ../../QSciQt4 \
		--sip-incdir=/usr/include/python$* -c --qsci-incdir=../../QSciQt4 \
		--qsci-libdir=../../QSciQt4 --destdir=$(CUR_DIR)/usr/lib/python$*/dist-packages/PyQt4
ifeq ($(qt5), "yes")
	mkdir -p Python/buildqt5-$*
	cd Python/buildqt5-$* \
	  && QT_SELECT=qt5-$(DEB_HOST_MULTIARCH) python$* ../configure.py -n ../../QSciQt5/ -o ../../QSciQt5 \
	  --sip-incdir=/usr/include/python$* -c --qsci-incdir=../../QSciQt5 --pyqt=PyQt5 \
	   --qsci-libdir=../../QSciQt5 --qmake=/usr/bin/qmake \
	  --destdir=$(CUR_DIR)/usr/lib/python$*/dist-packages/PyQt5
endif
	touch $@

Python/dbg-build-%/configure-stamp:
	dh_testdir
	mkdir -p Python/dbg-build-$*
	cd Python/dbg-build-$* \
	  && QT_SELECT=qt4-$(DEB_HOST_MULTIARCH) python$*-dbg ../configure.py -n ../../QSciQt4/ -o ../../QSciQt4 \
		--sip-incdir=/usr/include/python$* -c --qsci-incdir=../../QSciQt4 \
		--qsci-libdir=../../QSciQt4 --destdir=$(CUR_DIR)/usr/lib/python$*/dist-packages/PyQt4 \
		--debug
ifeq ($(qt5), "yes")
	mkdir -p Python/dbg-buildqt5-$*
	cd Python/dbg-buildqt5-$* \
	  && QT_SELECT=qt5-$(DEB_HOST_MULTIARCH) python$*-dbg ../configure.py -n ../../QSciQt5/ -o ../../QSciQt5 \
	  --sip-incdir=/usr/include/python$* -c --qsci-incdir=../../QSciQt5 --pyqt=PyQt5 \
	  --qsci-libdir=../../QSciQt5 --qmake=/usr/bin/qmake \
	  --destdir=$(CUR_DIR)/usr/lib/python$*/dist-packages/PyQt5 \
	  --debug
endif
	touch $@


build-library-stamp: configure
	dh_testdir
	cd QSciQt4 && $(MAKE)
	cd designer-Qt4Qt5 && $(MAKE)
ifeq ($(qt5), "yes")
	cd QSciQt5 && $(MAKE)
	cd designer-Qt5 && $(MAKE)
endif
	touch $@

build: build-arch build-indep
build-arch: build-library-stamp $(PYTHONS:%=Python/build-%/build-stamp) $(PYTHONS:%=Python/dbg-build-%/configure-stamp)

Python/build-%/build-stamp: Python/build-%/configure-stamp build-library-stamp
	dh_testdir
	$(MAKE) -C Python/build-$*
	touch $@

Python/dbg-build-%/build-stamp: Python/dbg-build-%/configure-stamp
	dh_testdir
	$(MAKE) -C Python/build-$*
	touch $@


build-indep: build-stamp
build-stamp:

clean:
	dh_testdir
	dh_testroot
	-cd Qt4Qt5 && $(MAKE) distclean
	-cd designer-Qt4Qt5 && $(MAKE) distclean

	rm -rf Python/*build*
	rm -rf QSciQt4
	rm -rf QSciQt5
	rm -rf designer-Qt4
	rm -rf designer-Qt5
	rm -f *-stamp

	dh_clean

d3_qt4_dbg = debian/python3-pyqt4.qsci-dbg
d3_qt5_dbg = debian/python3-pyqt5.qsci-dbg

install-python-3%:
	$(MAKE) -C Python/build-3$* install INSTALL_ROOT=$(CURDIR)/debian/tmp DESTDIR=$(CURDIR)/debian/tmp
	$(MAKE) -C Python/dbg-build-3$* install INSTALL_ROOT=$(CURDIR)/debian/tmp DESTDIR=$(CURDIR)/$(d3_qt4_dbg)

ifeq ($(qt5), "yes")
	$(MAKE) -C Python/buildqt5-3$* install INSTALL_ROOT=$(CURDIR)/debian/tmp DESTDIR=$(CURDIR)/debian/tmp
	$(MAKE) -C Python/dbg-buildqt5-3$* install INSTALL_ROOT=$(CURDIR)/debian/tmp DESTDIR=$(CURDIR)/debian/tmp
endif
	ABITAG=`python3$* -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))"`; \
	  for f in `find debian/tmp/usr/lib/python3* -name '*.so' ! -name '*.cpython*.so'`; do \
	  mv $$f $${f%.so}.$$ABITAG.so || exit 1; \
	done;

d_qt4_dbg = debian/python-qscintilla2-dbg
d_qt5_dbg = debian/python-pyqt5.qsci-dbg

install-python-%:
	$(MAKE) -C Python/build-$* install INSTALL_ROOT=$(CURDIR)/debian/tmp DESTDIR=$(CURDIR)/debian/tmp
	$(MAKE) -C Python/dbg-build-$* install INSTALL_ROOT=$(CURDIR)/debian/tmp DESTDIR=$(CURDIR)/$(d_qt4_dbg)

ifeq ($(qt5), "yes")
	$(MAKE) -C Python/buildqt5-$* install INSTALL_ROOT=$(CURDIR)/debian/tmp DESTDIR=$(CURDIR)/debian/tmp
	$(MAKE) -C Python/dbg-buildqt5-$* install INSTALL_ROOT=$(CURDIR)/debian/tmp DESTDIR=$(CURDIR)/debian/tmp
endif


install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	cd QSciQt4 && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/tmp install
	mkdir -p $(CURDIR)/debian/libqscintilla2-doc/usr/share/qt4/api/python3
	cp $(CURDIR)/Python/build-$(shell py3versions -dv)/QScintilla2.api $(CURDIR)/debian/libqscintilla2-doc/usr/share/qt4/api/python3
ifeq ($(qt5), "yes")
	cd QSciQt5 && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/libqscintilla2-qt5-$(SONAME) install
	mkdir -p $(CURDIR)/debian/libqscintilla2-qt5-dev/usr/include/$(DEB_HOST_MULTIARCH)/qt5/Qsci
	mkdir -p $(CURDIR)/debian/libqscintilla2-qt5-dev/usr/lib/$(DEB_HOST_MULTIARCH)/qt5/mkspecs/features
	mkdir -p $(CURDIR)/debian/libqscintilla2-doc/usr/share/qt5/api/python3
	cp $(CURDIR)/debian/libqscintilla2-qt5-$(SONAME)/usr/include/$(DEB_HOST_MULTIARCH)/qt5/Qsci/*.h $(CURDIR)/debian/libqscintilla2-qt5-dev/usr/include/$(DEB_HOST_MULTIARCH)/qt5/Qsci/
	rm -rf $(CURDIR)/debian/libqscintilla2-qt5-$(SONAME)/usr/include
	mv $(CURDIR)/debian/libqscintilla2-qt5-$(SONAME)/usr/lib/*.so $(CURDIR)/debian/libqscintilla2-qt5-dev/usr/lib
	cp $(CURDIR)/debian/libqscintilla2-qt5-$(SONAME)/usr/lib/$(DEB_HOST_MULTIARCH)/qt5/mkspecs/features/* $(CURDIR)/debian/libqscintilla2-qt5-dev/usr/lib/$(DEB_HOST_MULTIARCH)/qt5/mkspecs/features
	rm -rf $(CURDIR)/debian/libqscintilla2-qt5-$(SONAME)/usr/lib/$(DEB_HOST_MULTIARCH)
	cd designer-Qt5 && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/libqscintilla2-qt5-designer install
	mkdir -p $(CURDIR)/debian/libqscintilla2-qt5-l10n/usr/share/qt5/translations
	cp $(CURDIR)/debian/libqscintilla2-qt5-$(SONAME)/usr/share/qt5/translations/* $(CURDIR)/debian/libqscintilla2-qt5-l10n/usr/share/qt5/translations
	mkdir -p $(CURDIR)/debian/libqscintilla2-doc/usr/share/qt5/qsci/api/python
	cp $(CURDIR)/debian/libqscintilla2-qt5-$(SONAME)/usr/share/qt5/qsci/api/python/* $(CURDIR)/debian/libqscintilla2-doc/usr/share/qt5/qsci/api/python
	rm -rf $(CURDIR)/debian/libqscintilla2-qt5-$(SONAME)/usr/share/qt5
	cp $(CURDIR)/Python/buildqt5-$(shell py3versions -dv)/QScintilla2.api $(CURDIR)/debian/libqscintilla2-doc/usr/share/qt5/api/python3
endif
	cd designer-Qt4Qt5 && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/tmp install
	for p in $(PYTHONS) ; do \
                $(MAKE) -f debian/rules install-python-$$p || exit 1;\
        done

binary-common:
	dh_testdir
	dh_testroot
	dh_installman
	dh_install --sourcedir=$(CURDIR)/debian/tmp
	dh_installchangelogs NEWS
	dh_installdocs -A
	dh_installexamples
	dh_link
ifeq (,$(findstring -i, $(DH_OPTIONS)))
	set -e; \
	for p in libqscintilla2-qt4-$(SONAME) libqscintilla2-qt4-designer \
	    python-qscintilla2 python3-pyqt4.qsci \
	    ; do \
	    DH_OPTIONS= dh_strip -p$$p --dbg-package=$$p-dbg; \
	    rm -rf debian/$$p-dbg/usr/share/doc/$$p-dbg; \
	    mkdir -p debian/$$p-dbg/usr/share/doc; \
	    ln -s $$p debian/$$p-dbg/usr/share/doc/$$p-dbg; \
	done
ifeq ($(qt5), "yes")
	set -e; \
	for p in libqscintilla2-qt5-$(SONAME) libqscintilla2-qt5-designer \
	    python-pyqt5.qsci python3-pyqt5.qsci \
	    ; do \
	    DH_OPTIONS= dh_strip -p$$p --dbg-package=$$p-dbg; \
	    rm -rf debian/$$p-dbg/usr/share/doc/$$p-dbg; \
	    mkdir -p debian/$$p-dbg/usr/share/doc; \
	    ln -s $$p debian/$$p-dbg/usr/share/doc/$$p-dbg; \
	done
endif
endif
	dh_compress
	dh_fixperms
	dh_python2
	dh_python3
	rm -rf $(CURDIR)/debian/python-qscintilla2/usr/share/pyshared
	dh_sip
	dh_sip3
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture independant packages using the common target.
binary-indep: install
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

# Build architecture dependant packages using the common target.
binary-arch: install
	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
.NOTPARALLEL: