File: rules

package info (click to toggle)
qscintilla2 2.14.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 19,408 kB
  • sloc: cpp: 99,506; javascript: 189; python: 104; makefile: 99; ansic: 20; sh: 7
file content (126 lines) | stat: -rwxr-xr-x 4,026 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
# -*- makefile -*-

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

include /usr/share/dpkg/default.mk

QMAKE_FLAGS = QMAKE_CXXFLAGS+="$(CXXFLAGS) $(CPPFLAGS)" QMAKE_LFLAGS+="$(LDFLAGS)" QMAKE_STRIP=

PYTHON3S := $(shell py3versions -vr debian/control)
PYTHONS := $(PYTHON3S)

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

# Make the package buildable with only PyQt5 available
qt6 := "no"
ifeq ($(shell dpkg-query -s python3-pyqt6 |grep -o Package), Package)
	qt6 := "yes"
endif

%:
	dh $@ --with pkgkde_symbolshelper,python3

configure-stamp:
	dh_testdir
	# Configuring for Qt5 support
	mkdir -p QSciQt5
	cp -r src/* QSciQt5
	cd QSciQt5 && /usr/bin/qmake -qt=5 DESTDIR=../QSciQt5 $(QMAKE_FLAGS)
	cp -r designer designer-Qt5
	cd designer-Qt5 && /usr/bin/qmake -qt=5 INCLUDEPATH+=../src QMAKE_LIBDIR+=../QSciQt5 DESTDIR=../designer-Qt5 $(QMAKE_FLAGS)
ifeq ($(qt6), "yes")
	mkdir -p QSciQt6
	cp -r src/* QSciQt6
	cd QSciQt6 && /usr/bin/qmake6 DESTDIR=../QSciQt6 $(QMAKE_FLAGS)
	cp -r designer designer-Qt6
	cd designer-Qt6 && /usr/bin/qmake6 INCLUDEPATH+=../src QMAKE_LIBDIR+=../QSciQt6 DESTDIR=../designer-Qt6 $(QMAKE_FLAGS)
endif
	touch $@

override_dh_auto_configure: configure-stamp

Python/build-%/configure-stamp: build-library-stamp
	dh_testdir
	cp -f Python/pyproject-qt5.toml Python/pyproject.toml
	cd Python && python$* /usr/bin/sip-build \
		--verbose --no-make --pep484-pyi \
		--qmake /usr/bin/$(DEB_HOST_GNU_TYPE)-qmake \
		--qmake-setting 'QMAKE_CXXFLAGS += "$(CXXFLAGS) $(CPPFLAGS)"' \
		--qmake-setting 'QMAKE_LFLAGS += "$(LDFLAGS)"' \
		--target-dir /usr/lib/python3/dist-packages \
		--build-dir build-$* \
		--api-dir /usr/share/qt5/api/python3 \
		--qsci-features-dir $(CURDIR)/src/features \
		--qsci-include-dir $(CURDIR)/QSciQt5 \
		--qsci-library-dir $(CURDIR)/QSciQt5
ifeq ($(qt6), "yes")
	cp -f Python/pyproject-qt6.toml Python/pyproject.toml
	cd Python && python$* /usr/bin/sip-build \
		--verbose --no-make --pep484-pyi \
		--qmake /usr/bin/qmake6 \
		--qmake-setting 'QMAKE_CXXFLAGS += "$(CXXFLAGS) $(CPPFLAGS)"' \
		--qmake-setting 'QMAKE_LFLAGS += "$(LDFLAGS)"' \
		--target-dir /usr/lib/python3/dist-packages \
		--build-dir buildqt6-$* \
		--api-dir /usr/share/qt6/api/python3 \
		--qsci-features-dir $(CURDIR)/src/features \
		--qsci-include-dir $(CURDIR)/QSciQt6 \
		--qsci-library-dir $(CURDIR)/QSciQt6
endif
	touch $@


build-library-stamp: configure-stamp
	dh_testdir
	cd QSciQt5 && $(MAKE)
	cd designer-Qt5 && $(MAKE)
ifeq ($(qt6), "yes")
	cd QSciQt6 && $(MAKE)
	cd designer-Qt6 && $(MAKE)
endif
	touch $@

Python/build-%/build-stamp: Python/build-%/configure-stamp
	dh_testdir
	$(MAKE) -C Python/build-$*
ifeq ($(qt6), "yes")
	$(MAKE) -C Python/buildqt6-$*
endif
	touch $@

override_dh_auto_build: build-library-stamp $(PYTHONS:%=Python/build-%/build-stamp)

execute_after_dh_auto_build-indep:
	cd doc && doxygen qscintilla.dxy

override_dh_auto_install:
	ln -sf Python/README .
	$(MAKE) -C QSciQt5 install INSTALL_ROOT=$(CURDIR)/debian/tmp
	$(MAKE) -C designer-Qt5 install INSTALL_ROOT=$(CURDIR)/debian/libqscintilla2-qt5-designer
	cp -f Python/pyproject-qt5.toml Python/pyproject.toml
	set -ex; for p in $(PYTHONS); do \
		$(MAKE) -C Python/build-$$p install INSTALL_ROOT=$(CURDIR)/debian/tmp; \
	done
ifeq ($(qt6), "yes")
	$(MAKE) -C QSciQt6 INSTALL_ROOT=$(CURDIR)/debian/tmp install
	$(MAKE) -C designer-Qt6 install INSTALL_ROOT=$(CURDIR)/debian/libqscintilla2-qt6-designer
	cp -f Python/pyproject-qt6.toml Python/pyproject.toml
	set -ex; for p in $(PYTHONS); do \
		$(MAKE) -C Python/buildqt6-$$p install INSTALL_ROOT=$(CURDIR)/debian/tmp; \
	done
	mkdir -p $(CURDIR)/debian/libqscintilla2-doc/usr/share/qt6/qsci/api/python
endif

override_dh_installdocs:
	dh_installdocs -A NEWS

execute_after_dh_installdocs-indep:
	dh_doxygen

override_dh_strip:
	dh_strip -ppython3-pyqt5.qsci --dbgsym-migration='python3-pyqt5.qsci-dbg (<< 2.11.6+dfsg-3~)'
	dh_strip --remaining-packages