File: rules

package info (click to toggle)
glfw3 3.4-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,344 kB
  • sloc: ansic: 70,181; xml: 4,851; objc: 2,296; sh: 39; makefile: 33
file content (53 lines) | stat: -rwxr-xr-x 1,919 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
#!/usr/bin/make -f
# -*- makefile -*-
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildtools.mk

export DEB_BUILD_MAINT_OPTIONS := hardening=+all

# The _DEFAULT_SOURCE workaround found in upstream CMakeLists.txt
# doesn't detect non-Linux systems properly, so manually add the
# define here as well.
export DEB_CPPFLAGS_MAINT_APPEND := -D_DEFAULT_SOURCE

BUILD_WAYLAND = $(if $(findstring $(DEB_HOST_ARCH_OS),linux),ON,OFF)

# glfw dynamically loads all its library dependencies using dlopen, so
# we need to add the library dependencies for the packaging manually.
#
# Use Depends for packages required for commonly used backends, and
# Suggests for extra packages.
LIBS_X11 = -lXi -lXrandr -lXcursor -lXinerama -lX11-xcb -lXrender -lXext -lX11 -lGLX -lOpenGL
LIBS_WAYLAND = -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon -ldecor-0 -lEGL -lOpenGL
LIBS_EXTRA = -lEGL -lGLESv1_CM -lGLESv2
LIBS_VULKAN = -lvulkan

ifeq ($(BUILD_WAYLAND),ON)
LIBS_DEPENDS = $(LIBS_X11) $(LIBS_WAYLAND)
LIBS_SUGGESTS = $(LIBS_EXTRA) $(LIBS_VULKAN)
else
LIBS_DEPENDS = $(LIBS_X11)
LIBS_SUGGESTS = $(LIBS_EXTRA)
endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- -DBUILD_SHARED_LIBS=ON -DGLFW_BUILD_WAYLAND=$(BUILD_WAYLAND)

override_dh_shlibdeps:
	dh_shlibdeps
	$(CC) $(LDFLAGS) -xc -shared -Wl,--no-as-needed -o debian/tmp/dummy-depends.so /dev/null $(LIBS_DEPENDS)
	$(CC) $(LDFLAGS) -xc -shared -Wl,--no-as-needed -o debian/tmp/dummy-suggests.so /dev/null $(LIBS_SUGGESTS)
	dpkg-shlibdeps -Tdebian/libglfw3.substvars \
		-dDepends -edebian/tmp/dummy-depends.so \
		-dSuggests -edebian/tmp/dummy-suggests.so

override_dh_installdocs:
	dh_installdocs -plibglfw3-doc --doc-main-package=libglfw3-dev
	dh_installdocs --remaining-packages

override_dh_installexamples:
	dh_installexamples -plibglfw3-doc --doc-main-package=libglfw3-dev -XCMakeLists.txt
	dh_installexamples --remaining-packages