File: rules

package info (click to toggle)
dxvk 2.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,224 kB
  • sloc: cpp: 123,108; ansic: 76,058; sh: 545; python: 174; makefile: 81
file content (106 lines) | stat: -rwxr-xr-x 3,597 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
#!/usr/bin/make -f

built_binaries := $(shell dh_listpackages)

include /usr/share/dpkg/architecture.mk

# The name of the build-*.txt profile to choose
WINE_BUILD_NAME = win$(DEB_HOST_ARCH_BITS)

# The directory in which we will build
WINE_BUILD_DIR   = build-$(WINE_BUILD_NAME)

%:
	dh $@

# fails with: unrecognized option '-z'
export DEB_BUILD_MAINT_OPTIONS := hardening=-relro

# Use amd64 build flags when building the package on 64 bit architectures, i386
# otherwise
ifeq ($(DEB_HOST_ARCH_BITS),64)
	WINE_CFLAGS = $(shell dpkg-architecture -aamd64 -f -c dpkg-buildflags --get CFLAGS)
	WINE_CXXFLAGS = $(shell dpkg-architecture -aamd64 -f -c dpkg-buildflags --get CXXFLAGS)
else
	WINE_CFLAGS = $(shell dpkg-architecture -ai386 -f -c dpkg-buildflags --get CFLAGS)
	WINE_CXXFLAGS = $(shell dpkg-architecture -ai386 -f -c dpkg-buildflags --get CXXFLAGS)
endif

LDFLAGS += -flto -Wl,--build-id

# Meson flags
# TODO: why do dll files end-up in the bindir directory???
WINE_MESON_FLAGS = --buildtype=plain \
			   --cross-file=build-$(WINE_BUILD_NAME).txt \
			   --prefix=/usr \
			   --bindir=lib/dxvk/wine$(DEB_HOST_ARCH_BITS) \
			   --libdir=lib/dxvk/wine$(DEB_HOST_ARCH_BITS) \
               $(WINE_BUILD_DIR)

NATIVE_MESON_FLAGS = \
	-Dnative_glfw=disabled \
	-Dnative_sdl2=enabled \
	-Dnative_sdl3=enabled \
	$(NULL)

execute_after_dh_auto_clean:
	rm -fr $(WINE_BUILD_DIR)

override_dh_auto_configure:
	echo "blhc: ignore-line-regexp: C\+\+ linker for the build machine: .*"

	mkdir -p include/vulkan/include include/spirv/include
	# DXVK 2.0 now links to vulkan and spirv headers using submodules
	# add temporary symlinks to use packaged headers instead
	ln -s /usr/include/vulkan include/vulkan/include/vulkan
	ln -s /usr/include/vk_video include/vulkan/include/vk_video
	ln -s /usr/include/spirv include/spirv/include/spirv

	# DXVK 2.1 now embeds libdisplay-info
	# TODO: use libdisplay-info-src instead when no need for the fork
	#ln -s /usr/src/libdisplay-info-src subprojects/libdisplay-info
	mkdir -p subprojects
	rm -fr subprojects/libdisplay-info
	ln -fns ../libdisplay-info subprojects/
	test -f subprojects/libdisplay-info/displayid.c

	# DXVK Native requires a subset of MinGW DirectX headers
	mkdir -p include/native
	rm -fr include/native/directx
	ln -fns ../../mingw-directx-headers include/native/directx
	test -f include/native/directx/d3d.h

	dh_auto_configure -- $(NATIVE_MESON_FLAGS)

ifneq ($(filter dxvk-wine%,$(built_binaries)),)
	echo "WINE_MESON_FLAGS: $(WINE_MESON_FLAGS)"
	CFLAGS="$(WINE_CFLAGS)" CXXFLAGS="$(WINE_CXXFLAGS)" meson setup $(WINE_MESON_FLAGS)
endif

ifneq ($(filter dxvk-wine%,$(built_binaries)),)
execute_after_dh_auto_build:
	dh_auto_build --buildsystem=ninja --builddirectory=$(WINE_BUILD_DIR)
endif

execute_after_dh_auto_install:
	find debian/tmp/usr/include \( -name "*.txt" -o -name "*.md" \) -delete
ifneq ($(filter dxvk-wine%,$(built_binaries)),)
	dh_auto_install --buildsystem=ninja --builddirectory=$(WINE_BUILD_DIR)
	# we could change the install script but then the previous installations would be broken
	rename 's/\.dll$$/.dll.so/' debian/tmp/usr/lib/dxvk/wine$(DEB_HOST_ARCH_BITS)/*.dll
endif

override_dh_strip:
ifneq ($(filter dxvk-wine%,$(built_binaries)),)
	# strip debug info out of ddls and store it in a separate debug file
	# (dh_strip for windows)
	./debian/strip_debug.sh dxvk-wine$(DEB_HOST_ARCH_BITS)
endif
	# call dh_strip to create the doc directory
	dh_strip

override_dh_shlibdeps:
	dh_shlibdeps -- -l/usr/lib/$(DEB_HOST_MULTIARCH)/wine

execute_after_dh_clean:
	rm -rf include/vulkan include/spirv subprojects