95 lines
3.5 KiB
Makefile
Executable file
95 lines
3.5 KiB
Makefile
Executable file
#!/usr/bin/make -f
|
|
|
|
SHLIBVER = 2.0.4
|
|
|
|
DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
|
|
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
|
|
|
|
confflags = --disable-rpath --enable-sdl-dlopen --disable-loadso \
|
|
--disable-nas --disable-esd --disable-arts \
|
|
--disable-alsa-shared --disable-pulseaudio-shared \
|
|
--disable-x11-shared --disable-video-directfb \
|
|
--enable-video-opengles \
|
|
--enable-video-wayland --disable-wayland-shared
|
|
|
|
ifeq ($(DEB_HOST_ARCH_CPU),powerpc)
|
|
confflags += --disable-altivec
|
|
endif
|
|
|
|
ifeq ($(DEB_HOST_ARCH_CPU),ppc64el)
|
|
confflags += --disable-altivec
|
|
endif
|
|
|
|
# disable Wayland on non-Linux, they do not support other kernels at the moment
|
|
ifeq (hurd,$(findstring hurd,$(DEB_HOST_ARCH_CPU)))
|
|
confflags += --disable-video-wayland
|
|
endif
|
|
ifeq (kfreefsd,$(findstring kfreebsd,$(DEB_HOST_ARCH_CPU)))
|
|
confflags += --disable-video-wayland
|
|
endif
|
|
|
|
# disable OpenGLES on Hurd, it does not support it at the moment
|
|
ifeq (hurd,$(findstring hurd,$(DEB_HOST_ARCH_CPU)))
|
|
confflags += --disable--video-opengles
|
|
endif
|
|
|
|
|
|
%:
|
|
dh $@ --with autoreconf --parallel
|
|
|
|
override_dh_autoreconf:
|
|
# aclocal needs to include in specific order, and/or it seems that
|
|
# doesn't try to find .m4 files in /usr/share/aclocal at all. Updates
|
|
# to both .m4 files and ltmain.sh (aclocal and libtoolize) are necessary
|
|
# to support new architectures aarch64 (arm64) and powerpc64le, and this
|
|
# seems the more straight way to achieve it.
|
|
#
|
|
# An alternative would be to just build-depend on libesd0-dev,
|
|
# libasound2-dev and libltdl-dev to provide the files "esd.m4 alsa.m4
|
|
# ltdl.m4" in /usr/share/aclocal, and not use the local "acinclude" dir
|
|
# at all, but this pull even more dependencies, and unneeded ones.
|
|
#
|
|
# Another equivalent alternative, but more verbose:
|
|
#
|
|
# ACLOCAL="cat acinclude/esd.m4 acinclude/alsa.m4 acinclude/ltdl.m4 \
|
|
# /usr/share/aclocal/libtool.m4 \
|
|
# /usr/share/aclocal/ltoptions.m4 \
|
|
# /usr/share/aclocal/ltversion.m4 \
|
|
# /usr/share/aclocal/ltsugar.m4 >> aclocal.m4; aclocal"
|
|
# LIBTOOLIZE="libtoolize -f -i" dh_autoreconf --as-needed
|
|
# autoreconf -- -I acinclude -f -i
|
|
AUTOHEADER=true ACLOCAL="aclocal --force --install -I /usr/share/aclocal/ -I acinclude" LIBTOOLIZE="libtoolize -fi" dh_autoreconf --as-needed
|
|
# To verify that it worked, grep should find these strings:
|
|
#
|
|
#rgrep -i aarch64 .
|
|
#rgrep -r powerpc64le .
|
|
|
|
override_dh_auto_configure:
|
|
dh_auto_configure -- $(confflags)
|
|
|
|
override_dh_auto_build-indep:
|
|
tar czf debian/examples.tar.gz test --owner=0 --group=0 --mode=go=rX,u+rw,a-s
|
|
doxygen docs/doxyfile
|
|
# useless files
|
|
find output -name "*.md5" -delete
|
|
find output -type d -empty -delete
|
|
|
|
override_dh_auto_clean-indep:
|
|
dh_auto_clean
|
|
rm -f debian/examples.tar.gz
|
|
rm -rf output
|
|
|
|
override_dh_install:
|
|
dh_install --fail-missing -XlibSDL2.la
|
|
|
|
override_dh_link:
|
|
# to address lintian warning
|
|
# 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
|
|
dh_link -plibsdl2-dev usr/lib/$(DEB_HOST_MULTIARCH)/libSDL2-2.0.so.0.4.0 usr/lib/$(DEB_HOST_MULTIARCH)/libSDL2-2.0.so
|
|
dh_link --remaining-packages
|
|
|
|
override_dh_strip:
|
|
dh_strip --dbg-package=libsdl2-dbg
|
|
|
|
override_dh_makeshlibs:
|
|
dh_makeshlibs -V"libsdl2-2.0-0 (>= $(SHLIBVER))"
|