#!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow built_binaries := $(shell dh_listpackages) include /usr/share/dpkg/default.mk ifneq (,$(filter-out experimental UNRELEASED,$(DEB_DISTRIBUTION))) $(error This version of SDL is not yet suitable for testing/unstable) endif export SDL_AUDIO_DRIVER=dummy export SDL_VIDEO_DRIVER=dummy confflags = \ -DCMAKE_BUILD_RPATH_USE_ORIGIN=ON \ -DSDL_ALSA_SHARED=OFF \ -DSDL_EXAMPLES=ON \ -DSDL_HIDAPI_LIBUSB_SHARED=OFF \ -DSDL_JACK=OFF \ -DSDL_JACK_SHARED=OFF \ -DSDL_KMSDRM_SHARED=OFF \ -DSDL_OSS=OFF \ -DSDL_PIPEWIRE_SHARED=ON \ -DSDL_PULSEAUDIO_SHARED=OFF \ -DSDL_RPATH=OFF \ -DSDL_RPI=OFF \ -DSDL_SHARED=ON \ -DSDL_SNDIO_SHARED=ON \ -DSDL_STATIC=ON \ -DSDL_STATIC_PIC=ON \ -DSDL_TESTS=ON \ -DSDL_TESTS_TIMEOUT_MULTIPLIER=5 \ -DSDL_TEST_LIBRARY=ON \ -DSDL_VENDOR_INFO="${DEB_VENDOR} ${DEB_VERSION}" \ -DSDL_VIVANTE=OFF \ -DSDL_X11=ON \ -DSDL_X11_SHARED=OFF \ $(NULL) ifneq ($(filter %-tests,$(built_binaries)),) confflags += -DSDL_INSTALL_EXAMPLES=ON confflags += -DSDL_INSTALL_TESTS=ON endif ifeq ($(filter %-doc,$(built_binaries)),) confflags += -DSDL_DISABLE_INSTALL_DOCS=ON else confflags += -DSDL_DISABLE_INSTALL_DOCS=OFF endif ifeq ($(DEB_HOST_ARCH_CPU),powerpc) confflags += -DSDL_ALTIVEC=OFF endif ifeq ($(DEB_HOST_ARCH_CPU),ppc64el) confflags += -DSDL_ALTIVEC=OFF endif ifeq ($(DEB_HOST_ARCH_OS),linux) confflags += -DSDL_WAYLAND=ON confflags += -DSDL_WAYLAND_SHARED=OFF else confflags += -DSDL_WAYLAND=OFF endif %: dh $@ --buildsystem=cmake override_dh_auto_configure: #if [ $(DEB_VERSION_UPSTREAM) = 3.1.3~git20241004.1~bd4cd34+ds ]; then \ # echo prerelease-3.1.2-2020-gbd4cd34a7 > VERSION.txt; \ #fi set -e; for bmp in test/icon.bmp test/gamepad_*.bmp test/glass.bmp; do \ python3 cmake/xxd.py -i "$${bmp}" -o "$${bmp%.bmp}.h"; \ done cd build-scripts && ./makecasefoldhashtable.pl > ../src/stdlib/SDL_casefolding.h cd src/render/gpu/shaders && bash -ex ./build-shaders.sh # This is intended as a Windows batch file, but at the time of writing # it's so simple that it's also a valid shell script cd src/render/vulkan && sh -ex ./compile_shaders.bat cd test/testgpu && OSTYPE=$(DEB_HOST_ARCH_OS) bash -ex ./build-shaders.sh cp debian/placeholders/testgpu_*.h test/testgpu/ dh_auto_configure -- $(confflags) execute_after_dh_auto_build: ifneq ($(filter %-doc,$(built_binaries)),) sed -e 's/FULL_PATH_NAMES *=.*/FULL_PATH_NAMES = NO/' < docs/doxyfile > debian/Doxyfile cd docs && doxygen ../debian/Doxyfile # useless files find docs/output -name "*.md5" -delete find docs/output -type d -empty -delete endif execute_after_dh_auto_clean-indep: rm -f debian/Doxyfile rm -rf docs/output # debhelper >= 13.4 makes all of /usr/libexec executable, which is not # quite right for installed-tests override_dh_fixperms: dh_fixperms -Xusr/libexec/installed-examples -Xusr/libexec/installed-tests ifneq ($(filter %-tests,$(built_binaries)),) chmod --recursive --changes a+rX,u+w,og-w debian/libsdl3-tests/usr/libexec/installed-examples chmod --recursive --changes a+rX,u+w,og-w debian/libsdl3-tests/usr/libexec/installed-tests endif override_dh_installchangelogs: dh_installchangelogs -- WhatsNew.txt