File: rules

package info (click to toggle)
telegram-desktop 3.1.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 48,472 kB
  • sloc: cpp: 489,005; xml: 34,087; python: 3,041; objc: 916; sh: 883; makefile: 802; ansic: 738; javascript: 174
file content (84 lines) | stat: -rwxr-xr-x 2,694 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
#!/usr/bin/make -f
# -*- makefile -*-
include /usr/share/dpkg/default.mk

EXTRA_CMAKE_VARIABLES += \
	TDESKTOP_API_ID=50322 \
	TDESKTOP_API_HASH=9ff1a639196c0779c86dd661af8522ba \
	TDESKTOP_RESOURCES=Packed \
	DESKTOP_APP_REQUIRE_JEMALLOC=OFF \
	CMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON \
	CMAKE_STATIC_LINKER_FLAGS='-T'

DEB_BUILD_MAINT_OPTIONS = hardening=+all

# Reveal any errors with pre-compiled headers.
DEB_CPPFLAGS_MAINT_APPEND += -Werror=invalid-pch

# Print full stack trace of template instantiations.
DEB_CXXFLAGS_MAINT_APPEND += -ftemplate-backtrace-limit=0

ifeq ($(filter terse,$(DEB_BUILD_OPTIONS)),)
 # Print entire arguments of moc invocation.
 EXTRA_CMAKE_VARIABLES += CMAKE_AUTOGEN_VERBOSE=ON
endif

ifeq ($(filter noopt,$(DEB_BUILD_OPTIONS)),)
 # Hide warnings useless for final build.
 DEB_CXXFLAGS_MAINT_APPEND += -Wno-deprecated-declarations
endif

ifneq ($(DEB_HOST_ARCH_OS),linux)
 # Wayland is not ready on GNU/Hurd or Debian/kFreeBSD.
 # Make sure KWayland library and Qt WaylandClient plugin are not in use.
 EXTRA_CMAKE_VARIABLES += DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION=ON
 DEB_CPPFLAGS_MAINT_APPEND += -UQT_WAYLANDCLIENT_LIB
endif

ifeq ($(filter pkg.$(DEB_SOURCE).lotmem,$(DEB_BUILD_PROFILES)),)
 ifeq ($(DEB_BUILD_ARCH_BITS),32)
  ATTEMPT_SAVE_MEMORY = 1
 endif
 ifneq ($(filter Debian-riscv64 Ubuntu-arm64 Ubuntu-ppc64el,$(DEB_VENDOR)-$(DEB_BUILD_ARCH)),)
  ATTEMPT_SAVE_MEMORY = 1
 endif
endif
ifdef ATTEMPT_SAVE_MEMORY
 # Less debug info by default to fit small address space.
 ifneq ($(filter -g,$(CXXFLAGS)),)
  DEB_CXXFLAGS_MAINT_STRIP = -g
  DEB_CXXFLAGS_MAINT_PREPEND = -g1
 endif
 # Attempt to reduce RAM consumption even more.
 DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-keep-memory
endif

CPPLIBS_PACKAGES = libexpected-dev libmsgsl-dev librange-v3-dev libtgowt-dev
EXTRA_SUBSTVARS += \
	cpplibs:Built-Using=$(shell dpkg-query -Wf '$${source:Package}(=$${Version}),' $(CPPLIBS_PACKAGES))

# Make visible all possible maintainer's flags.
export DEB_BUILD_MAINT_OPTIONS $(foreach flag,$(DPKG_BUILDFLAGS_LIST),\
	$(foreach operation,STRIP APPEND PREPEND,DEB_$(flag)_MAINT_$(operation)))

# Make debugging a little easier. https://stackoverflow.com/a/25817631/5000805
# Print also export line if the variable is being exported.
print-%:
	@echo $* = $($*)
	@env | sed '/^\($*\)=.*/s//export \1/;t;d'

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- $(EXTRA_CMAKE_VARIABLES:%=-D%)

override_dh_installchangelogs:
	dh_installchangelogs changelog.txt

# Maximize the limit of debug information entries and ignore possible overflow errors.
override_dh_dwz:
	-dh_dwz -- -L 2147483647

override_dh_gencontrol:
	dh_gencontrol -- $(EXTRA_SUBSTVARS:%="-V%")