debian/rules
author Cameron Gutman <aicommander@gmail.com>
Sun, 28 Apr 2019 17:37:49 -0700
changeset 12746 132a2af7edac
parent 12403 a4d730631698
permissions -rwxr-xr-x
Fix use-after-free when pumping the event loop after SDL_DestroyWindow()

Closing the window is asynchronous, but we free the window data immediately,
so we can get an updateLayer callback before the window is really destroyed which
will cause us to access the freed memory.

Clearing the content view will cause it to be immediately released, so no further
updateLayer callbacks will occur.
     1 #!/usr/bin/make -f
     2 
     3 DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
     4 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
     5 
     6 confflags = --disable-rpath --disable-video-directfb \
     7             --disable-nas --disable-esd --disable-arts
     8 
     9 # These flags can be used to create a package directly linking with external libraries and having the appropriate package dependencies
    10 #confflags += --disable-alsa-shared
    11 #confflags += --disable-arts-shared
    12 #confflags += --disable-directfb-shared
    13 #confflags += --disable-esd-shared
    14 #confflags += --disable-fusionsound-shared
    15 #confflags += --disable-jack-shared
    16 #confflags += --disable-kmsdrm-shared
    17 #confflags += --disable-libsamplerate-shared
    18 #confflags += --disable-nas-shared
    19 #confflags += --disable-pulseaudio-shared
    20 #confflags += --disable-sndio-shared
    21 #confflags += --disable-wayland-shared
    22 #confflags += --disable-x11-shared
    23 
    24 %:
    25 	dh $@ --parallel
    26 
    27 override_dh_auto_configure:
    28 	dh_auto_configure -Bbuilddir/all -- $(confflags)
    29 
    30 override_dh_auto_build:
    31 	dh_auto_build -Bbuilddir/all
    32 	tar czf debian/examples.tar.gz test
    33 
    34 override_dh_auto_install:
    35 	dh_auto_install -Bbuilddir/all
    36 
    37 override_dh_auto_clean:
    38 	dh_auto_clean -Bbuilddir/all
    39 	rm -f debian/examples.tar.gz
    40 
    41 override_dh_install:
    42 	dh_install --remaining-packages --fail-missing -XlibSDL2.la
    43 
    44 override_dh_installexamples:
    45 	dh_installexamples -plibsdl2-dev debian/examples.tar.gz
    46 	dh_installexamples --remaining-packages
    47 
    48 override_dh_link:
    49 	# to address lintian warning
    50 	# W: libsdl2-2.0-0: dev-pkg-without-shlib-symlink usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.0.0 usr/lib/x86_64-linux-gnu/libSDL2-2.0.so
    51 	dh_link -plibsdl2-dev usr/lib/$(DEB_HOST_MULTIARCH)/libSDL2-2.0.so.0.0.0 usr/lib/$(DEB_HOST_MULTIARCH)/libSDL2-2.0.so
    52 
    53 override_dh_strip:
    54 	dh_strip --dbg-package=libsdl2-dbg