File: rules

package info (click to toggle)
godot 3.6%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 270,588 kB
  • sloc: cpp: 971,579; ansic: 617,953; xml: 80,302; asm: 17,498; cs: 14,559; python: 11,744; java: 9,681; javascript: 4,654; pascal: 1,176; sh: 896; objc: 529; makefile: 176
file content (105 lines) | stat: -rwxr-xr-x 4,876 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
#!/usr/bin/make -f
export DH_VERBOSE = 1
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))

# Force suffix on binaries to avoid special treatment of riscv64, ppc64le, ppc64,
# ppcle and ppc in ./platform/x11/detect.py.  Without this, the install calls below
# fail to find the expected binaries.
BITS = $(shell dpkg-architecture -q DEB_TARGET_ARCH_BITS)

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

# Link with libatomic on archs where it is needed.
# See <URL: https://bugs.debian.org/1019868 >
ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),armel riscv64))
       export DEB_LDFLAGS_MAINT_APPEND += -Wl,--no-as-needed -latomic -Wl,--as-needed
endif

# The denoise module depends on OIDN which is x86_64 only (in the
# vendored version).
# Godot's own logic to disable it on other arches is a bit brittle
# when it comes to cross-compiling currently.
# See https://github.com/godotengine/godot/issues/47344
# The embree library used by raycast and lightmapper_cpu modules do
# not build on s390x, disable on archs where it is not already building.
ifneq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),amd64 i386 armel armhf))
       DISABLE_MODULES = module_denoise_enabled=no module_embree_enabled=no module_raycast_enabled=no module_lightmapper_cpu_enabled=no
endif

# replace "custom_build" with more useful Debian version info
include /usr/share/dpkg/pkg-info.mk  # provides DEB_VERSION
export BUILD_NAME = debian${DEB_VERSION}

include /usr/share/dpkg/architecture.mk  # provides DEB_HOST_ARCH_BITS

# Godot 3.x requires embree 3.x and mbedtls 2.x [0], but embree 4.x and
# mbedtls 3.x are currently all that is available in unstable. rvo2 and
# xatlas are not available within Debian.
# [0] https://github.com/godotengine/godot/issues/100390
SCONS_OPTIONS = bits=$(DEB_HOST_ARCH_BITS) \
	--jobs=$(NUMJOBS) \
	import_env_vars=CCACHE_DIR \
	CC="$(CC)" \
	CXX="$(CXX)" \
	CCFLAGS="$(CPPFLAGS)" \
	CFLAGS="$(CFLAGS)" \
	CXXFLAGS="$(CXXFLAGS)" \
	LINKFLAGS="$(LDFLAGS)" \
	builtin_bullet=no \
	builtin_certs=no \
	system_certs_path=/etc/ssl/certs/ca-certificates.crt \
	builtin_embree=yes \
	builtin_enet=no \
	builtin_freetype=no \
	builtin_libogg=no \
	builtin_libpng=no \
	builtin_libtheora=no \
	builtin_libvorbis=no \
	builtin_libvpx=no \
	builtin_libwebp=no \
	builtin_wslay=no \
	builtin_mbedtls=yes \
	builtin_miniupnpc=no \
	builtin_opus=no \
	builtin_pcre2=no \
	builtin_recast=no \
	builtin_rvo2=yes \
	builtin_squish=no \
	builtin_xatlas=yes \
	builtin_zlib=no \
	builtin_zstd=no \
	use_static_cpp=no \
	verbose=yes

%:
	dh $@

override_dh_clean:
	scons -c arch=$(BITS) platform=server tools=yes target=release_debug $(SCONS_OPTIONS) $(DISABLE_MODULES)
	scons -c arch=$(BITS) platform=x11    tools=no  target=release       $(SCONS_OPTIONS) $(DISABLE_MODULES)
	scons -c arch=$(BITS) platform=x11    tools=yes target=release_debug $(SCONS_OPTIONS) $(DISABLE_MODULES)
	dh_clean

override_dh_auto_build:
	dh_auto_build
	scons arch=$(BITS) platform=server tools=yes target=release_debug $(SCONS_OPTIONS) $(DISABLE_MODULES)
	scons arch=$(BITS) platform=x11    tools=no  target=release       $(SCONS_OPTIONS) $(DISABLE_MODULES)
	scons arch=$(BITS) platform=x11    tools=yes target=release_debug $(SCONS_OPTIONS) $(DISABLE_MODULES)

override_dh_auto_install:
	echo "Installing binaries for $(BITS) bits architecture"
	install -D -m 400 $(CURDIR)/bin/godot.x11.opt.tools.$(BITS) $(CURDIR)/debian/godot3/usr/bin/godot3
	install -D -m 400 $(CURDIR)/bin/godot.x11.opt.$(BITS) $(CURDIR)/debian/godot3-runner/usr/bin/godot3-runner
	install -D -m 400 $(CURDIR)/bin/godot_server.x11.opt.tools.$(BITS) $(CURDIR)/debian/godot3-server/usr/bin/godot3-server
	install -D -m 444 $(CURDIR)/misc/dist/linux/org.godotengine.Godot.desktop $(CURDIR)/debian/godot3/usr/share/applications/org.godotengine.Godot3.desktop
	install -D -m 444 $(CURDIR)/misc/dist/linux/org.godotengine.Godot.appdata.xml $(CURDIR)/debian/godot3/usr/share/metainfo/org.godotengine.Godot3.metainfo.xml
	install -D -m 444 $(CURDIR)/misc/dist/linux/org.godotengine.Godot.xml $(CURDIR)/debian/godot3/usr/share/mime/packages/org.godotengine.Godot3.xml
	install -D -m 644 $(CURDIR)/icon.svg $(CURDIR)/debian/godot3/usr/share/icons/hicolor/scalable/apps/godot3.svg
	install -D -m 444 $(CURDIR)/misc/dist/linux/godot.6 $(CURDIR)/debian/godot3/usr/share/man/man6/godot3.6
	install -D -m 444 $(CURDIR)/misc/dist/linux/godot.6 $(CURDIR)/debian/godot3-runner/usr/share/man/man6/godot3-runner.6
	sed -i 's/godot3/godot3-runner/' $(CURDIR)/debian/godot3-runner/usr/share/man/man6/godot3-runner.6
	install -D -m 444 $(CURDIR)/misc/dist/linux/godot.6 $(CURDIR)/debian/godot3-server/usr/share/man/man6/godot3-server.6
	sed -i 's/godot3/godot3-server/' $(CURDIR)/debian/godot3-server/usr/share/man/man6/godot3-server.6
	dh_auto_install